<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/FiniqAppMasterPage.Master" CodeBehind="WorkFlowDocMap.aspx.vb" Inherits="FinIQWebApp.WorkFlowDocMap" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
     <asp:ScriptManagerProxy ID="ScriptManagerProxy1" EnableViewState="true" runat="server"></asp:ScriptManagerProxy>
       <script type="text/javascript" lang="javascript">
                function loadOnDemand() {
                    try {

                        document.getElementById('<%=btnCancel.ClientID()%>').click();
                    }
                    catch (Error) {

                    }
                }
           function AllowOnlyNumeric() {
               //
               var key = window.event.keyCode;

               if (key > 47 && key < 58)
                   return true;
               else
                   return false;
           }
            </script>
    
    <link href="../App_Themes/workflowCSS.css" rel="stylesheet" type="text/css" />
  
      <style type="text/css">
        .lblgrpWFtypeCss {
            width: 90px;
        }

        .defaultWidthbtn {
            Width: 100px !important;
        }

        .Visible {
            display: block;
        }

        .invisible {
            display: none;
        }

        .cboWFTypeddl {
            width: 230px;
        } 
        .tdcboWFTypeddl {
            width: 260px;
        }

        .btnGroupbox {
            width: 70px;
        }

        .DDLYN {
            width: 80px;
        }

        .groupBoxGridsButtons, .groupBoxUserAccess, .groupBoxGridsAllowedQ, .groupBoxGridsRightClickAction {
            position: absolute;
            left: 580px;
            top: 250px;
            height: auto;
            border: solid 1px #ccc;
        }

        .groupBoxGridsButtons {
            width: 1000px;
            height: auto;
        }

        .groupBoxUserAccess {
            width: 340px !important;
            /*max-height: 400px !important;*/
        }

        .groupBoxGridsAllowedQ {
            width: 330px;
            max-height: 403px !important;
        }

        .groupBoxGridsRightClickAction {
            width: 350px;
            /*max-height: 403px !important;*/
        }

        .btnDetailsDiv {
            background-color: #FFF;
            height: auto;
        }

        .CloseButton {
            float: right;
        }

        #divButtonDetailsControls, #divUserAccessControls, #divAllowedQControls, #divRightClickActionControls, #divRightClickAction {
            padding: 6px;
        }

        #divButtonDetailsGrid, #divUserAccessGrid, #divAllowedQGrid, #divAllowedQ, #divRightClickActionGrid {
            width: auto;
            height: auto;
            overflow: auto;
            padding: 5px;
            background-color: #f9f9f9;
        }

        #divButtonDetailsGrid {
            max-width: 1000px !important;
            max-height: 450px !important;
            overflow-y: hidden;
        }

        #divUserAccessGrid {
            max-width: 325px !important;
            max-height: 357px !important;
            margin-bottom: 5px;
        }

        #divAllowedQGrid {
            max-width: 325px !important;
            max-height: 400px !important;
            height: 357px;
            overflow-y: hidden;
        }

        #divRightClickActionGrid {
            max-width: 350px !important;
            max-height: 360px !important;
            width: 335px;
        }

        .divLoading {
            position: absolute;
            top: 40px;
            left: 360px;
        }

        .tblGrid {


            margin-top: 6px;
        }
    </style>

     <asp:UpdatePanel ID="UpdatePanelCP" runat="server">
        <ContentTemplate>
            <asp:HiddenField runat="server" ID="rowIndexBtn" Value="" />
            <asp:HiddenField runat="server" ID="rowIndexUsr" Value="" />
            <asp:HiddenField runat="server" ID="rowIndexAllQ" Value="" />
            <asp:HiddenField runat="server" ID="rowIndexRightClick" Value="" />
              <table id="upperTable" runat="server" class="">
                <tr>
                    <td>
                        <table>
                            <tr>
                                <td colspan="4">
                                    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanelCP"
                                        DisplayAfter="0">
                                        <ProgressTemplate>
                                            <div class="divLoading">
                                                <img alt="Loading" src="../App_Resources/loading.gif" /><span class="lbl">Loading...&nbsp;&nbsp;</span>
                                            </div>
                                        </ProgressTemplate>
                                    </asp:UpdateProgress>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4">
                                    <asp:Label ID="lblError" runat="server" Text="" CssClass="lblError" ForeColor="#ff6767"></asp:Label>
                                    <asp:Label ID="lblMessage" runat="server" Text="" CsssClass="lbl" ForeColor="#008000"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                
                                <td class="lblgrpWFtypeCss">
                                    <asp:Label ID="lblWFL" runat="server" CssClass="lbl" Text="Workflow Type"></asp:Label>
                                </td>
                                <td >
                                    <asp:DropDownList ID="ddlWFL" runat="server" CssClass="ddl" AutoPostBack="true" ></asp:DropDownList>
                                </td>
                                <td style="vertical-align: top;">
                                    <asp:Button ID="btnAdd" runat="server" Text="Add" CssClass="btn defaultWidthbtn" />
                                    <asp:Button ID="btnLoad" runat="server" Text="Load" CssClass="btn defaultWidthbtn" />
                                    <asp:Button ID="btnSave" runat="server" Text="Save" CssClass="btn defaultWidthbtn" />
                                    <asp:Button ID="btnDelete" runat="server" Text="Delete" CssClass="btn defaultWidthbtn" OnClientClick="return confirm('Are you sure you want to delete this queue ?');" />
                                    <asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="btn defaultWidthbtn"  />

                                    
                                </td>
                                 <td style="padding-left: 15px">
                                 <asp:Label ID="LblRowCountName" runat="server" CssClass="lbl" Text="Total Record(s) "></asp:Label>
                                 </td>
                                 <td style="padding-left: 5px">
                                 <asp:Label ID="LblRowCount" runat="server" CssClass="lbl"></asp:Label>
                                  </td>
                                 <td style="padding-left: 15px">
                                 <asp:Label ID="lblRowsperpage" runat="server" CssClass="lbl" Text="Records(s) Per Page" />
                                 </td>
                                 <td style="padding-left: 5px">
                                 <asp:TextBox ID="txtRowperpage" runat="server" CssClass="txt" AutoPostBack="true" MaxLength="2"  oncopy="return false" onpaste="return false" oncut="return false" Width="27px" OnTextChanged="txtRowperpage_TextChanged" onkeypress='return event.charCode >= 48 && event.charCode <= 57'></asp:TextBox>  <%--OnTextChanged="txtRowperpage_TextChanged"--%>
                                 </td>
                              
                            </tr>
                            </table>
                       <div style="height:5px; ">
                           
                           </div>
                            <table>
                           <tr>
                           <td>
                       
                            <table id="lowerTable" runat="server" class="tblGrid">
                            <tr>
                                <td>
                                    <div style="overflow-x:auto ;width:1888px">
                                        <asp:GridView ID="grd_WFLDcoMapping" runat="server" CellPadding="3" EmptyDataText="No data found." AutoGenerateColumns="False"
                                        PageSize="10" CssClass="Grid" AllowPaging="True" ShowHeaderWhenEmpty="true" AllowSorting="true"  TabIndex="6" BorderColor="White" GridLines="Both">
                                        <SelectedRowStyle CssClass="GridItemSelect" />
                                        <AlternatingRowStyle CssClass="AlternatItemStyle"></AlternatingRowStyle>
                                        <RowStyle CssClass="GridItem" />
                                        <HeaderStyle CssClass="GridHeader" />
                                        <FooterStyle CssClass="GridFooter" />
                                        <PagerStyle CssClass="GridPager" />
                                        <PagerSettings FirstPageText="First" LastPageText="Last" Mode="NumericFirstLast" Position="Bottom" />

                                        <Columns>

                                             <asp:TemplateField HeaderText="">
                                                <HeaderStyle Wrap="true"></HeaderStyle>
                                                <HeaderTemplate>
                                                    <asp:CheckBox ID="chkAllList" runat="server" AutoPostBack="true" OnCheckedChanged="CheckBox_CheckedChanged" />
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <%--<asp:CheckBox ID="chk" runat="server"  Text='<%# (DataBinder.Eval(Container, "DataItem.ChkSingle"))%>' OnCheckedChanged="ChkSingle_CheckedChanged" AutoPostBack="true"></asp:CheckBox>--%>
                                                    <%--<asp:CheckBox ID="chk" runat="server" Checked='<%# If(IsDBNull(Eval("ChkSingle")), False, Eval("ChkSingle"))%>' OnCheckedChanged="ChkSingle_CheckedChanged" AutoPostBack="true"></asp:CheckBox>--%>
                                                    <asp:CheckBox ID="chk" runat="server" OnCheckedChanged="ChkSingle_CheckedChanged" AutoPostBack="true" Style="margin-left: 4px"></asp:CheckBox>

                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="QDE_ID" HeaderStyle-HorizontalAlign="Center" Visible="false">
                                                <HeaderStyle HorizontalAlign="Center" Wrap="true" Width="10px" />
                                                <ItemStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle" Width="10px"></ItemStyle>
                                                <ItemTemplate>
                                                    <asp:Label ID="lblCL_Id" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.QDE_ID").ToString)%>' />

                                                </ItemTemplate>
                                            </asp:TemplateField>

                                              <asp:TemplateField HeaderText="Queue id" HeaderStyle-HorizontalAlign="Center" Visible="false">
                                                <HeaderStyle HorizontalAlign="Center" Wrap="true" Width="109px" />
                                                <ItemStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
                                                <ItemTemplate>
                                                    <asp:Label ID="lblQueueid" runat="server" Visible="TRUE" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.QM_Id").ToString)%>' />

                                                    <asp:DropDownList ID="ddlQueueid"  runat="server" CssClass="ddl" AutoPostBack="true" Visible="false">
                                                    </asp:DropDownList>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Queue Name" HeaderStyle-HorizontalAlign="Center">
                                                <HeaderStyle HorizontalAlign="Center" Wrap="true" Width="109px" />
                                                <ItemStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
                                                <ItemTemplate>
                                                    <asp:Label ID="lblQueueName" runat="server" Visible="TRUE" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.QM_Name").ToString)%>' />

                                                    <asp:DropDownList ID="ddlQueueName"  runat="server" CssClass="ddl" AutoPostBack="true" Visible="false">
                                                    </asp:DropDownList>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                             <asp:TemplateField HeaderText="Workflow Object Type" HeaderStyle-HorizontalAlign="Center">
                                                <HeaderStyle HorizontalAlign="Center" Wrap="true" Width="109px" />
                                                <ItemStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
                                                <ItemTemplate>
                                                    <asp:Label ID="lblWorkflowObjectType" runat="server" Visible="TRUE" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Workflow_Object_type").ToString)%>' />

                                                    <asp:DropDownList ID="ddlWorkflowObjectType"  runat="server" CssClass="ddl" AutoPostBack="true" Visible="false">
                                                    </asp:DropDownList>
                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Document id" HeaderStyle-HorizontalAlign="Center" Visible="false">
                                                <HeaderStyle HorizontalAlign="Center" Wrap="true" Width="109px" />
                                                <ItemStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
                                                <ItemTemplate>
                                                    <asp:Label ID="lblDocumentid" runat="server" Visible="TRUE" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.DOc_Event_ID").ToString)%>' />

                                                    <asp:DropDownList ID="ddlDocumentid"  runat="server" CssClass="ddl" AutoPostBack="true" Visible="false">
                                                    </asp:DropDownList>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                             <asp:TemplateField HeaderText="Document Event" HeaderStyle-HorizontalAlign="Center">
                                                <HeaderStyle HorizontalAlign="Center" Wrap="true" Width="109px" />
                                                <ItemStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
                                                <ItemTemplate>
                                                    <asp:Label ID="lblDocumentEvent" runat="server" Visible="TRUE" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Event_Code").ToString)%>' />

                                                    <asp:DropDownList ID="ddlDocumentEvent"  runat="server" CssClass="ddl" AutoPostBack="true" Visible="false">
                                                    </asp:DropDownList>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Workflow Type code" HeaderStyle-HorizontalAlign="Center" Visible="false" >
                                                <HeaderStyle HorizontalAlign="Center" Wrap="true" Width="109px" />
                                                <ItemStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
                                                <ItemTemplate>
                                                    <asp:Label ID="lblworkflowtypecode" runat="server" Visible="TRUE" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WorkFlow_Type_Code").ToString)%>' />

                                                    <asp:DropDownList ID="ddlworkflowtypecode"  runat="server" CssClass="ddl" AutoPostBack="true" Visible="false">
                                                    </asp:DropDownList>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Workflow Type ID" HeaderStyle-HorizontalAlign="Center" Visible="false" >
                                                <HeaderStyle HorizontalAlign="Center" Wrap="true" Width="109px" />
                                                <ItemStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
                                                <ItemTemplate>
                                                    <asp:Label ID="lblworkflowtypeid" runat="server" Visible="TRUE" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Workflow_TYPE_ID").ToString)%>' />

                                                    <asp:DropDownList ID="ddlworkflowtypeid"  runat="server" CssClass="ddl" AutoPostBack="true" Visible="false">
                                                    </asp:DropDownList>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                             <asp:TemplateField HeaderText="Active Y/N" HeaderStyle-HorizontalAlign="Center">
                                                <HeaderStyle HorizontalAlign="Center" Wrap="true" Width="109px" />
                                                <ItemStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
                                                <ItemTemplate>
                                                    <asp:Label ID="lblActiveYN" runat="server" Visible="TRUE" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Active_YN").ToString)%>' />

                                                    <asp:DropDownList ID="ddlActiveYN"  runat="server" CssClass="ddl" AutoPostBack="true" Visible="false">
                                                    <asp:ListItem Value="Y" Text="Y"></asp:ListItem>
                                                    <asp:ListItem Value="N" Text="N"></asp:ListItem>
                                                    </asp:DropDownList>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Object Type" HeaderStyle-HorizontalAlign="Center">
                                                <HeaderStyle HorizontalAlign="Center" Wrap="true" Width="109px" />
                                                <ItemStyle Wrap="False" HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
                                                <ItemTemplate>
                                                    <asp:Label ID="lblObjectType" runat="server" Visible="TRUE" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Document_Object_Type").ToString)%>' />

                                                    <asp:DropDownList ID="ddlObjectType"  runat="server" CssClass="ddl" AutoPostBack="true" Visible="false">
                                                    </asp:DropDownList>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            </Columns>
                                        </asp:GridView>
                                             </div>
                                </td>
                            </tr>
                        </table>

                    </td>
                </tr>
                        </table>
                    </td>
                </tr>

            </table>
           <table>
                <tr>
                    <td>
                        <asp:TextBox ID="txtInsertupdate" runat="server" Height="16px" Visible="False" Width="51px"></asp:TextBox>
                    </td>
                </tr>
            </table>
              </ContentTemplate>
    </asp:UpdatePanel>
  
    </asp:Content>
