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

<%@ Register Src="~/Workflow/FinIQ_Mapping_CTL.ascx" TagPrefix="dtMapping" TagName="FinIQ_Mapping_CTL" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">

    <meta http-equiv="Content-Language" content="en" />

    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    </asp:ScriptManagerProxy>
    <script src="../FinIQJS/SortFilter_Grid.js"></script>
    <script src="../Workflow/FinIQ_Mapping_CTL.js"></script>
    <%--Start Added by shubham k on 11-Feb-21 for UBP UI Standard--%>
    <%--Start Commented by shubham k on 18-Feb-21--%>
<%--        <link href="../FinIQJS/FreezeGrid.css" type="text/css" rel="stylesheet">
 <script src="../FinIQJS/FreezeGrid.js" type="text/javascript"></script> --%>
    <%--End Commented by shubham k on 18-Feb-21--%>
    <%--End Added by shubham k on 11-Feb-21 for UBP UI Standard--%>

    <style>
	/*  Changed By Nikhil Mali on 11-02-2020||  WBDIN-40 || for Pop Up Changes */
        .panel {
            top: 249px !important; 
            left: 770px !important;
            position: fixed !important;      
            display: none;
            z-index:99999   /*13-Sept-2019: Added by Shraddha D for Vertical edit*/
        }

        .table-align {
            margin-left: 10px;
            margin-top: 6px;
            margin-right: 6px;
            margin-bottom: 6px;
            font: normal 11px verdana !important;
        }


        .PopUpButton {
            Width: 80px !important;
            margin-left: 6px !important;
            margin-top: 6px !important;
            margin-bottom: 6px !important;
        }

        .legendBox {
            margin-top: 2px;
            width: 10px;
            height: 10px;
            float: left;
        }

        .legend {
            margin-left: 6px;
            margin-top: 1px;
            margin-bottom: 2px;
            float: left;
            /*font: normal 11px verdana !important;*/
        }

        .UserPermissions {
            height: 382px;   /*  Changed By Nikhil Mali on 11-02-2020||  WBDIN-40 || for Pop Up Changes */
            width: 380px;
            /*position: absolute;
            left: 580px;
            top: 250px;*/
            background-color: #FFFFFF;
            border: solid 1px #CCCCCC;
            /*overflow: auto;*/  /*  Changed By Nikhil Mali on 11-02-2020||  WBDIN-40 || for Pop Up Changes */
        }

        .hideGV {
            display: none;
        }

        .popupText {
            width: 120px;
            margin-left: 6px;
            margin-top: 6px;
            margin-bottom: 6px;
            /*font: normal 11px verdana !important;*/
        }

        .closeButton {
            Width: 20px !important;
        }


        .ActiveN span {
            /*color: RGB(83, 142, 213) !important;*/
            color: #66a3ff;
        }


        .DupColumn span {
            /*color: #ff6767;*/
            color: #CCCCCC;
        }

        #one {
            /*background-color: rgb(83, 142, 213);*/
            background-color: #66a3ff !important;
        }

        #two {
            background-color: #CCCCCC;
        }

        .displayPanel {
            display: block;
        }

        .btn {
            /*height: 28px !important;*/
            /*border-radius: 5px;*/
            width: 100px;
        }

        .gridCol {
            width: 120px;
        }

        fieldset {
            border: 1px solid #E6E6E6 !important;
        }


        .Grid {
            table-layout: fixed;
            /*width: 100%;*/
        }



        .tdLong {
            width: 200px;
        }

        .divLoading {
            position: absolute;
            top: 60px;
            left: 350px;
        }

        .FilterPad {
            margin-left: 10px;
        }
        .lbl {
                white-space: normal !important;
        }
        /*Start: 13-Sept-2019: Added by Shraddha D for Vertical edit*/
          .invisible {
            display: none;
        }
         .groupBoxGrids2 {
            position: absolute !important;
            background-color: #f9f9f9;
            left: 744px;
            top: 300px;  /*  Changed By Nikhil Mali on 11-02-2020||  WBDIN-40 || for Pop Up Changes */
            /*height: 310px !important;*/
            width: 450px !important;
            /*display: none;*/
        }
            .btnGroupbox {
            width: 65px;
        }
             .btnClose {
            width: 30px;
        }
              .Visible {
            display: block;
        }
         .beutifyPopUp {
            border-radius: 8px;
            box-shadow: 0 0 10px #000000;
        }     
        .UserGrpPopup {
          z-index: 10000000 !important;
        }
        .UserGrpPopup1 {
          z-index: 9999 !important;
        }
        .overlaySearch {
        z-index:-1;
        background-color: #000000; /* Black background with opacity */
        }
        .divVerticalEditmain {
            background-color: #FFF;
            height: auto;
        }
        .beutifyPopUp {
            border-radius: 12px;
            box-shadow: 0 0 10px #000000;
        }
        .beutifyPopUpVertEdit {
            border-radius: 12px;
            box-shadow: 0 0 10px #0a0a0a;
        }
          .btnDetailsDiv {
            background-color: #FFF;
            height: auto;
        }
          .groupBoxUserAccess {
            position: absolute;
            /*left: 580px;
            top: 250px;*/
            height: auto;
            border: solid 1px #ccc;
            border-radius: 12px;
        }
           .groupBoxGrids {
            position: absolute !important;
            background-color: #f9f9f9;
            left: 744px;
            top: 205px;
            height: 305px !important;
            width: 404px !important;
            /*display: none;*/
        }
           /*End: 13-Sept-2019: Added by Shraddha D for Vertical edit*/
		   /*  Added By Nikhil Mali on 11-02-2020||  WBDIN-40 || for Pop Up Changes */
           .divusergroup{
               overflow:auto;
               height:336px;
           }
           /*Start Added by shubham k on 11-Feb-2021 for UBP*/
        .btn_padding {
            padding-right: 10px !important;
            padding-top: 5px !important;
        }
        /*End Added by shubham k on 11-Feb-2021 for UBP*/
    </style>
    
    <script type="text/javascript">
        //Start Added by shubham k on 12-Feb-2021 for UBP
        document.onkeyup = function (e) {
            if (e.ctrlKey && e.key == "r") {
                document.getElementById('<%= btnLoad.ClientID %>').click();
            } else if (e.ctrlKey && e.shiftKey && e.key == "E") {
                document.getElementById('<%= btnexcel.ClientID %>').click();
            }
        }
        //End Added by shubham k on 12-Feb-2021 for UBP
    </script>

    <asp:UpdatePanel ID="UpdatePanelCP" runat="server">
        <ContentTemplate>

            <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>

            <%--<fieldset class ="UpperOuterContainer--%>
            <table id="tbMain" runat="server" cellpadding="0" cellspacing="0" class="FilterPad">

                <tr>
                    <td>
                        <table>
                            <tr>
                                <td>
									<%--Start Added by shubham k on 11-Feb-2021 for UBP--%>
									<asp:Label ID="lblSuccess" CssClass="lblSuccess" runat="server" Text=""></asp:Label>
                                    <asp:Label ID="lblInfo" CssClass="lblInfo" runat="server" Text=""></asp:Label>                                    
                                    <%--End Added by shubham k on 11-Feb-2021 for UBP--%>
                                    <asp:Label ID="lblError" CssClass="lbl lblerror" runat="server" Text=""></asp:Label>                                 
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>

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

                                <td style="width: 40px;" class="btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                                    <asp:Label ID="lblCodeSeach" CssClass="lbl" runat="server" Text="Code"></asp:Label>
                                </td>
                                <td style="width: 182px;" class="btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                                    <asp:TextBox runat="server" ID="TxtWTMSearch" CssClass="txt" Width="180px" onkeydown="return EnterEvent(event)" />
                                    <%-- <asp:Label ID="SearchLabel" class="label" runat="server" Text="Code Search"></asp:Label> --%>                       
                                </td>
                                <td style="width: 40px;" class="btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                                    <asp:Button ID="btnSearch" runat="server" CssClass="btnSearch" />
                                </td>
                                <td id="tdLoad" class="tdBtn btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%> 
                                    <asp:Button ID="BtnLoad" runat="server" CssClass="btn" Text="Load" ToolTip="Load (crtl + r)"></asp:Button>
                                </td>
                                <td id="tdAdd" class="tdBtn btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                                    <asp:Button ID="BtnAdd" runat="server" CssClass="btn" Text="Add"></asp:Button>
                                </td>
                                <td id="tdSave" class="tdBtn btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                                    <asp:Button ID="BtnSave" runat="server" CssClass="btn" Text="Save"></asp:Button>
                                </td>
                                <td id="tdActivate" class="tdBtn btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                                    <asp:Button ID="BtnActiveYN" runat="server" CssClass="btn" Text="Activate"></asp:Button>
                                </td>

                                <td id="tdDeactivate" class="btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                                    <asp:Button ID="BtnDeactivate" runat="server" CssClass="btn" Text="Deactivate"></asp:Button>
                                </td>
                                <%--Start Added by shubham k on 11-Feb-21 for UBP Standards--%>
                                <td class="btn_padding">
                                    <asp:Button ID="btnExcel" runat="server" CssClass="Export2Excel" ToolTip="Export to Excel (ctrl + shift + e)" Text="" Width="100px" />
                                </td>
                                <%--End Added by shubham k on 11-Feb-21 for UBP Standards--%>
                                <td id="td1" class="btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                                    <div id="one" class="legendBox" style="margin-left: 10px;"></div>
                                    <asp:Label ID="divOneLbl" CssClass="lbl legend" runat="server" Text="Deactivated"></asp:Label>
                                </td>
                                <td class="btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                                    <div id="two" class="legendBox" style="margin-left: 10px;"></div>
                                    <asp:Label ID="divTwoLbl" CssClass="lbl legend" runat="server" Text="Duplicate Data"></asp:Label>
                                </td>
                                    <%--Added by Nikhil Mali for Rows Per Page - 999 : START--%>
                                <td class="btn_padding"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                                    <%--UBPINT-6 changed by Prateek M--%>
                                    <%--Added by shubham k on 11-Feb-21 for UBP, Changed Rows to Record(s),Removed Text=999--%>
                                    <asp:Label ID="lblRowsPerPage" runat="server" Text="Record(s) per page: "/>
                                    <asp:TextBox ID="txtRowsPerPage" runat="server" Text="" Width="40px"  Style="text-align:center;" AutoPostBack="true" MaxLength="3" onkeydown="EnterEvent(event)" onkeypress="return isNumberKey(event)" />
                                </td>
                                <td class="btn_padding">
                                    <%--Added by shubham k on 11-Feb-21 for UBP--%>
                                    <asp:Label ID="lblTotalRecords" runat="server" CssClass="lbl" Text="Total Record(s) :"></asp:Label>
                                    <asp:Label ID="lblRowCount" runat="server" CssClass="lbl"></asp:Label>
                                </td>                                      
                                <%--Added by Nikhil Mali for Rows Per Page - 999 : END--%>
                                     <%-- Start: 15-Nov-2019 : Added by Shraddha D for vertical edit--%>
                                   <%-- End: 15-Nov-2019 : Added by Shraddha D for vertical edit--%>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td style="height: 10px;"></td>
                </tr>

                <tr>
                    <td>
                        <table style="margin-top:18px;"><%--Added by shubham k on 11-Feb-21 for UBP--%>
                            <tr>
                                <td><%-- <div class="gridHolder" id="gridHolder" runat="server">--%>
                                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                        <ContentTemplate>
                                            <%-- <asp:GridView ID="GV_WorkFlowTypeMaster" runat="server" AllowSorting="True" AutoGenerateColumns="False" BorderStyle="None" BorderWidth="0px" CellPadding="3" PageSize="7" PagerStyle-Height="32px"
                                        AllowPaging="true" CssClass="Grid" ShowHeaderWhenEmpty="true" RowHeadersWidthSizeMode="DisableResizing;" SelectedRowStyle-Wrap="true" HeaderStyle-CssClass="GridHeaderTitle">--%>
                                            <%--Added by shubham k on 11-Feb-2021 for UBP added frozengrid--%>
                                            <%--Added by shubham k on 18-Feb-2021 for UBP removed frozengrid--%>
                                            <asp:GridView ID="GV_WorkFlowTypeMaster" runat="server" AllowPaging="true" AllowSorting="True" AutoGenerateColumns="False" BorderStyle="Solid" BorderWidth="1px" 
                                                CellPadding="3" CssClass="Grid Gridview" PagerStyle-Height="32px" PageSize="10" RowHeadersWidthSizeMode="DisableResizing;" 
                                                SelectedRowStyle-Wrap="true" ShowHeaderWhenEmpty="true" HeaderStyle-CssClass="GridHeaderTitle">
                                                <SelectedRowStyle CssClass="GridItemSelect" />
                                                <RowStyle CssClass="GridItem" />
                                                <HeaderStyle CssClass="GridHeader" />
                                                <FooterStyle CssClass="GridFooter" />
                                                <PagerStyle CssClass="GridPager" />
                                                <PagerSettings FirstPageText="First" LastPageText="Last" Mode="NumericFirstLast" Position="Bottom" />
                                                <EmptyDataTemplate>
                                                    <asp:Label ID="lbldatagrid" runat="server" Text="No data found."></asp:Label>
                                                </EmptyDataTemplate>
                                                <Columns>
                                                    <asp:TemplateField ControlStyle-Width="25px">
                                                        <HeaderStyle HorizontalAlign="Center" Width="25px" Wrap="True" />
                                                        <ItemStyle HorizontalAlign="Center" Width="25px" Wrap="True" />
                                                        <HeaderTemplate>
                                                            <asp:CheckBox ID="chkAll" runat="server" onclick="checkAll(this);" />
                                                        </HeaderTemplate>
                                                        <ItemTemplate>
                                                            <asp:CheckBox ID="ChkBox" runat="server" onclick="Check_Click(this)" />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:CommandField ButtonType="Link" EditText="Edit" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="40px" ItemStyle-Wrap="false" ShowEditButton="true" UpdateText="Update" />
                                                       <%-- Start: 15-Nov-2019 : Added by Shraddha D for vertical edit--%>
                                                     <%--<asp:TemplateField>
                                                        <HeaderStyle Width="40" />
                                                           <ItemStyle Wrap="false" Width="40" HorizontalAlign="center"  />
                                                        <ItemTemplate>
                                                             <asp:LinkButton ID="lbEditVertical" runat="server" Text="Edit" CommandArgument='<%#Eval("WTM_ID")%>' CommandName="EditVertically"/>
                                                        </ItemTemplate>
                                                     </asp:TemplateField>--%>
                                                       <%-- End: 15-Nov-2019 : Added by Shraddha D for vertical edit--%>
                                                    <asp:TemplateField HeaderText="ID" Visible="FALSE">
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblID" runat="server" CssClass="lbl" Text='<%# DataBinder.Eval(Container, "DataItem.WTM_ID")%>' />
                                                        </ItemTemplate>
                                                        <%-- <EditItemTemplate>
                                                <asp:Label ID="lblEditID"  runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.WTM_ID")%>' CssClass="lbl"/>
                                            </EditItemTemplate>--%></asp:TemplateField>
                                                    <asp:TemplateField ControlStyle-Width="210px" HeaderText="CODE"> <%--Added by shubham k on 11-Feb-21 for UBP--%>
                                                        <HeaderStyle CssClass="gridCol" Wrap="True" />
                                                        <ItemStyle CssClass="gridCol" Wrap="True" />
                                                        <ItemTemplate>
                                                            <%--Added by shubham k on 11-Feb-21 for UBP--%>
                                                            <asp:Label ID="lblCode" runat="server" Style="display: inline !important;" CssClass="lbl" Text='<%# DataBinder.Eval(Container, "DataItem.WTM_Code")%>' />
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtCode" runat="server" CssClass="txt" Text="" Width="90px"></asp:TextBox>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField ControlStyle-Width="190" HeaderText="Name">
                                                        <HeaderStyle CssClass="gridCol" Wrap="True" />
                                                        <ItemStyle CssClass="gridCol" Wrap="False" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblName" runat="server" CssClass="lbl" Text='<%# DataBinder.Eval(Container, "DataItem.WTM_Title")%>' />
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtName" runat="server" CssClass="txt"></asp:TextBox>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="ActiveYN" Visible="False">
                                                        <HeaderStyle CssClass="gridCol" Wrap="True" />
                                                        <ItemStyle CssClass="gridCol" Wrap="True" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblActiveYN" runat="server" CssClass="lbl" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WTM_ActiveYN").ToString)%>'>
                                                            </asp:Label>
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField ControlStyle-Width="120" HeaderText="Super Type"><%--<HeaderStyle Wrap="True"></HeaderStyle>--%><%--<ItemStyle Wrap="True" />--%>
                                                        <HeaderStyle CssClass="gridCol" Wrap="True" />
                                                        <ItemStyle CssClass="gridCol" Wrap="True" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblSuper_type" runat="server" CssClass="lbl" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WTM_Super_type").ToString)%>'>
                                                            </asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:DropDownList ID="ddlSuper_type" runat="server" CssClass="ddl">
                                                            </asp:DropDownList>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="User Permissions"><%--<HeaderStyle Wrap="True"></HeaderStyle>--%><%--<ItemStyle Wrap="true" Width="260px"/>--%>
                                                        <HeaderStyle Width="300px" Wrap="True" />
                                                        <ItemStyle Width="300px" Wrap="True" />
                                                        <ItemTemplate>
                                                            <div><asp:Label ID="lblUserPermissions" runat="server" CssClass="lbl" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.UserPermissions").ToString)%>'>
                                                            </asp:Label></div>
                                                             
                                                            <asp:LinkButton runat="server" ID="MapUsers" Visible="false" CommandArgument='<%# Container.DataItemIndex%>' CommandName="MapUsers">Map User</asp:LinkButton>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:Label ID="lblUserPermissionsEdit" runat="server" CssClass="lbl" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.UserPermissions").ToString)%>'>
                                                            </asp:Label>
                                                        <asp:LinkButton runat="server" ID="MapUsersEdit" visible="false" CommandArgument='<%# Container.DataItemIndex%>'
                                                        CommandName="MapUsers"  >Map User</asp:LinkButton>

                                                        </EditItemTemplate>

                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Show On Dashboard"><%--<HeaderStyle Wrap="True"></HeaderStyle>--%><%--<ItemStyle Wrap="True" />--%>
                                                        <HeaderStyle CssClass="gridCol" Width="50px" Wrap="True" />
                                                        <ItemStyle CssClass="gridCol" HorizontalAlign="Center" Width="50px" Wrap="True" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblShowOnDashBoardYN" runat="server" CssClass="lbl" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WTM_ShowOnDashBoardYN").ToString)%>'>
                                                            </asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <%--24-Aug-2020 | Rajeshree Kathariya- Increased width of dropdown--%>
                                                            <asp:DropDownList ID="ddlShowOnDashBoardYN" runat="server" CssClass="ddl" Width="35px">
                                                            </asp:DropDownList>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <asp:TemplateField HeaderText="Show Buttons On Workflow"><%--<HeaderStyle Wrap="True"></HeaderStyle>--%><%--<ItemStyle Wrap="True" />--%>
                                                        <HeaderStyle CssClass="gridCol" Width="50px" Wrap="True" />
                                                        <ItemStyle CssClass="gridCol" HorizontalAlign="Center" Width="50px" Wrap="True" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblShowButtonsOnWFYN" runat="server" CssClass="lbl" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WTM_ShowButtonsOnWFYN").ToString)%>'>
                                                            </asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <%--24-Aug-2020 | Rajeshree Kathariya- Increased width of dropdown--%>
                                                            <asp:DropDownList ID="ddlShowButtonsOnWFYN" runat="server" CssClass="ddl" Width="35px">
                                                            </asp:DropDownList>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>

                                                    <asp:TemplateField HeaderText="Display Priority" Visible="True" ControlStyle-Width="40"><%--Added by Arati K on 08 Feb 2019--%>
                                                        <HeaderStyle Width="40px" />
                                                        <ItemStyle Wrap="true" Width="40px" HorizontalAlign="right" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblDisplayPriority" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WTM_Display_seqence").ToString)%>' />
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtDisplayPriority" runat="server" Style="text-align: right;" CssClass="txt" onkeypress="return isNumberKey(event)" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WTM_Display_seqence").ToString)%>'></asp:TextBox>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <%--Start | 20-Aug-2020 | Added by Rajeshree K for addiotional column- Partner workflow--%>
                                                    <asp:TemplateField HeaderText="Partner Workflows" Visible="True" ControlStyle-Width="350">
                                                        <HeaderStyle Width="350px" Wrap="True" />
                                                        <ItemStyle Width="350px" Wrap="True" />                                                        
                                                        <ItemTemplate>
                                                          <asp:Label ID="lblPartnerWorkflows" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WTM_Partner_Workflow_Names").ToString)%>' />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                    <%--End | 20-Aug-2020 | Added by Rajeshree K for addiotional column- Partner workflow--%>
                                                      <asp:TemplateField ControlStyle-Width="150" HeaderText="Page Link">
                                                        <HeaderStyle CssClass="gridCol" Wrap="True" />
                                                        <ItemStyle CssClass="gridCol" Wrap="False" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblPageLink" runat="server" CssClass="lbl" Text='<%# DataBinder.Eval(Container, "DataItem.WTM_Page_Link")%>' />
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtPageLink" runat="server" CssClass="txt"></asp:TextBox>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                     <asp:TemplateField ControlStyle-Width="150" HeaderText="Column Specifier">
                                                        <HeaderStyle CssClass="gridCol" Wrap="True" />
                                                        <ItemStyle CssClass="gridCol" Wrap="False" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblWF_Column_Specifier" runat="server" CssClass="lbl" Text='<%# DataBinder.Eval(Container, "DataItem.WF_Column_Specifier")%>' />
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtWF_Column_Specifier" runat="server" CssClass="txt"></asp:TextBox>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                     <asp:TemplateField HeaderText="Apply Date Filter"><%--<HeaderStyle Wrap="True"></HeaderStyle>--%><%--<ItemStyle Wrap="True" />--%>
                                                        <HeaderStyle CssClass="gridCol" Width="40px" Wrap="True" />
                                                        <ItemStyle CssClass="gridCol" HorizontalAlign="Center" Width="50px" Wrap="True" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblApply_Date_FilterYN" runat="server" CssClass="lbl" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WTM_Apply_Date_Filter").ToString)%>'>
                                                            </asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <%--24-Aug-2020 | Rajeshree Kathariya- Increased width of dropdown--%>
                                                            <asp:DropDownList ID="ddlApply_Date_FilterYN" runat="server" CssClass="ddl" Width="35px">
                                                            </asp:DropDownList>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                    <%--added by Jyoti k on 14 Feb 2022 UCP-230--%>
                                                     <asp:TemplateField ControlStyle-Width="150" HeaderText="Source SP">
                                                        <HeaderStyle CssClass="gridCol" Wrap="True" />
                                                        <ItemStyle CssClass="gridCol" Wrap="False" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblWF_SourceSP" runat="server" CssClass="lbl" Text='<%# DataBinder.Eval(Container, "DataItem.WTM_SourceSP")%>' /> 
                                                        </ItemTemplate>
                                                        <EditItemTemplate>
                                                            <asp:TextBox ID="txtWF_SourceSP" runat="server" CssClass="txt"></asp:TextBox>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                     <asp:TemplateField HeaderText="Stop Push Notification">
                                                        <HeaderStyle CssClass="gridCol" Width="50px" Wrap="True" />
                                                        <ItemStyle CssClass="gridCol" HorizontalAlign="Center" Width="50px" Wrap="True" />
                                                        <ItemTemplate>
                                                            <asp:Label ID="lblStopPushNotification" runat="server" CssClass="lbl" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WTM_StopPushNotification").ToString)%>'>
                                                            </asp:Label>
                                                        </ItemTemplate>
                                                        <EditItemTemplate>                                                      
                                                            <asp:DropDownList ID="ddlStopPushNotification" runat="server" CssClass="ddl" Width="35px">
                                                            </asp:DropDownList>
                                                        </EditItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                            </asp:GridView>
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                    <%-- </div>--%></td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>

            <%--fieldset--%>

            <%--<fieldset class="LowerOuterContainer">--%>



            <asp:Panel ID="pnlUserPermission" runat="server" CssClass="panel groupBoxGrids invisible" > <%--  13-Sept-2019: Added by Shraddha D for Vertical edit--%>
                <div id="divUser_permissions" class="UserPermissions beutifyPopUp" runat="server">
                    <asp:TextBox runat="server" ID="PopUp_UName" CssClass="txt popupText" onkeydown="return EnterEventOnPopUp(event)" />
                    <asp:Button ID="btnPopUp_Load" runat="server" CssClass="btn PopUpButton" Text="Load" />
                    <asp:Button ID="btnPopUp_Save" runat="server" CssClass="btn PopUpButton" Text="Save" />
                    <asp:Button ID="btnPopUpClose" runat="server" CssClass="btn PopUpButton closeButton" Text="X" />

                    <%-- <asp:GridView ID="GV_UserPermissions" runat="server" AllowSorting="True" AutoGenerateColumns="False" BorderStyle="None" BorderWidth="0px" CellPadding="3"
                        CssClass="Grid" PageSize="10">--%>

                    <%-- <asp:GridView ID="GV_UserPermissions" runat="server" AllowSorting="True" AutoGenerateColumns="False" BorderStyle="None" BorderWidth="0px" CellPadding="3" PageSize="7" PagerStyle-Height="32px"
                        AllowPaging="false" CssClass="Grid" ShowHeaderWhenEmpty="true" RowHeadersWidthSizeMode="DisableResizing;" SelectedRowStyle-Wrap="true" HeaderStyle-CssClass="GridHeaderTitle"
                        Style="margin: 5px;">--%>
                    <div class="divusergroup">  <%-- Changed By Nikhil Mali on 11-02-2020||  WBDIN-40 || for Pop Up Changes --%>
                    <asp:GridView ID="GV_UserPermissions" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                        BorderStyle="Solid" BorderWidth="1px" CellPadding="3" PageSize="10" PagerStyle-Height="32px"
                        AllowPaging="false" CssClass="Grid" ShowHeaderWhenEmpty="true" RowHeadersWidthSizeMode="DisableResizing;" SelectedRowStyle-Wrap="true">

                        <SelectedRowStyle CssClass="GridItemSelect" />
                        <RowStyle CssClass="GridItem" />
                        <HeaderStyle CssClass="GridHeader" />
                        <FooterStyle CssClass="GridFooter" />
                        <PagerStyle CssClass="GridPager" />

                        <PagerSettings Mode="NumericFirstLast"
                            FirstPageText="First"
                            LastPageText="Last"
                            Position="Bottom" />

                        <EmptyDataTemplate>
                            <asp:Label ID="lbldatagrid" runat="server" Text="No data found."></asp:Label>
                        </EmptyDataTemplate>

                        <Columns>
                            <asp:TemplateField>
                                  <HeaderStyle Wrap="True" Width="25px" HorizontalAlign="Center" />
                                            <HeaderTemplate>
                                                <asp:CheckBox ID="chkAll" runat="server" onclick="checkAll(this);" />
                                            </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkboxUserPermission" runat="server" ItemStyle-Width="25px"></asp:CheckBox>
                                </ItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Users" ItemStyle-Width="220px">
                                <ItemTemplate>
                                    <asp:Label ID="lblUsers" CssClass="lbl" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.U_id").ToString)%>' />
                                </ItemTemplate>
                                <%--<EditItemTemplate>
                                        <asp:TextBox ID="txtUsers" runat="server"  CssClass="txt" ></asp:TextBox>
                                    </EditItemTemplate>--%>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Name" ItemStyle-Width="220px">
                                <ItemTemplate>
                                    <asp:Label ID="lblName" CssClass="lbl" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Name").ToString)%>' />
                                </ItemTemplate>
                            </asp:TemplateField>

                        </Columns>
                    </asp:GridView>
                    </div> <%-- Changed By Nikhil Mali on 11-02-2020||  WBDIN-40 || for Pop Up Changes--%>
                </div>
                <div id="overlayDiv" class="overlaySearch"></div>  <%--  13-Sept-2019: Added by Shraddha D for Vertical edit--%>
            </asp:Panel>

            <%--START | 20-Aug-2020 | Rajeshree K- Added panel for partner workflows--%>
            <asp:Panel ID="pnlPartnerWorkflows" runat="server" CssClass="panel groupBoxGrids invisible"> <%--  13-Sept-2019: Added by Shraddha D for Vertical edit--%>
                <div id="div1" class="UserPermissions beutifyPopUp" runat="server">
                    <asp:TextBox runat="server" ID="txtWFPopup" CssClass="txt popupText" onkeydown="return EnterEventOnWorkflowPopUp(event)" />
                    <asp:Button ID="btnLoadPartnerWorkflows" runat="server" CssClass="btn PopUpButton" Text="Load" />
                    <asp:Button ID="btnSavePartnerWorkflows" runat="server" CssClass="btn PopUpButton" Text="Save" />
                    <asp:Button ID="btnCloseWFPopup" runat="server" CssClass="btn PopUpButton closeButton" Text="X" />

                    <div class="divusergroup">  <%-- Changed By Nikhil Mali on 11-02-2020||  WBDIN-40 || for Pop Up Changes --%>
                    <asp:GridView ID="gvWorkflows" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                        BorderStyle="Solid" BorderWidth="1px" CellPadding="3" PageSize="10" PagerStyle-Height="32px"
                        AllowPaging="false" CssClass="Grid" ShowHeaderWhenEmpty="true" RowHeadersWidthSizeMode="DisableResizing;" SelectedRowStyle-Wrap="true">

                        <SelectedRowStyle CssClass="GridItemSelect" />
                        <RowStyle CssClass="GridItem" />
                        <HeaderStyle CssClass="GridHeader" />
                        <FooterStyle CssClass="GridFooter" />
                        <PagerStyle CssClass="GridPager" />

                        <PagerSettings Mode="NumericFirstLast"
                            FirstPageText="First"
                            LastPageText="Last"
                            Position="Bottom" />

                        <EmptyDataTemplate>
                            <asp:Label ID="lbldatagrid" runat="server" Text="No data found."></asp:Label>
                        </EmptyDataTemplate>

                        <Columns>
                            <asp:TemplateField>
                                  <HeaderStyle Wrap="True" Width="25px" HorizontalAlign="Center" />
                                            <HeaderTemplate>
                                                <asp:CheckBox ID="chkAllWF" runat="server" onclick="checkAll(this);" />
                                            </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkboxWorkflow" runat="server" ItemStyle-Width="25px"></asp:CheckBox>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <%--24-Aug-2020 | Rajeshree Kathariya | Modified header text--%>
                            <asp:TemplateField HeaderText="Workflow ID" ItemStyle-Width="150px">
                                <ItemTemplate>
                                    <asp:Label ID="lblWorkflowId" CssClass="lbl" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WTM_ID").ToString)%>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                            <%--24-Aug-2020 | Rajeshree Kathariya | Modified header text--%>
                            <asp:TemplateField HeaderText="Workflow Name" ItemStyle-Width="250px">
                                <ItemTemplate>
                                    <asp:Label ID="lblWorkflowName" CssClass="lbl" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WTM_Code").ToString)%>' />
                                </ItemTemplate>
                            </asp:TemplateField>

                        </Columns>
                    </asp:GridView>
                    </div> 
                </div>
                <div id="overlayDiv1" class="overlaySearch"></div> 
            </asp:Panel>
            <%--END | 20-Aug-2020 | Rajeshree K- Added panel for partner workflows--%>
            <asp:HiddenField runat="server" ID="rowIndex" Value="" />
            <asp:HiddenField runat="server" ID="hdnTop" Value="" />
            <asp:HiddenField runat="server" ID="hdnLeft" Value="" />
            <%-- <asp:Label ID="display" class="label" runat="server" Text="Text : " Visible="true"></asp:Label>      --%>
            <%--</fieldset>--%>
            <%--<asp:Label ID="lblUserPermissionFlag" class="label" runat="server" Text="" Visible="false"></asp:Label>  --%>
        </ContentTemplate>
                <Triggers>
            <asp:PostBackTrigger ControlID="btnExcel" />
        </Triggers>
    </asp:UpdatePanel>

        <asp:UpdatePanel runat="server" ID="controlPanel" >
         <ContentTemplate> </ContentTemplate>
    </asp:UpdatePanel>

    <script type="text/javascript">
        
    
        //Start| 26-JUN-2020 | Added by Rajeshree K for grid filters
        $(document).ready(function () {
            SetSorting_Filter1();
        });
        //End| 26-JUN-2020 | Added by Rajeshree K for grid filters

        //Start:13-Sept-2019: Added by Shraddha D for Vertical edit
        Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function () {
            $(document).ready(function () {
                $('[id$="ctl00_MainContent_pnlUserPermission"], .groupBoxGrids').draggable();
                $('[id$="ctl00_MainContent_pnlWorkflows"], .groupBoxGrids').draggable();
                $('[id$="ctl00_MainContent_RowEditPanel"], .groupBoxGrids').draggable();
                $('[id$="mappingDiv"]').draggable();

            });
        })
        function OpenVerticalEditPopUp() {
            document.getElementById("overlay2").style.display = "block";
        }
        //End:13-Sept-2019: Added by Shraddha D for Vertical edit
        function displayUserPermissionGrid(RowP) {

            document.getElementById('<%=lblError.ClientID%>').innerHTML = "";
            document.getElementById('<%=pnlUserPermission.ClientID%>').className = "panel";
            document.getElementById('<%=pnlUserPermission.ClientID%>').style.display = "block";
            document.getElementById("overlayDiv").style.display = "block";  //13-Sept-2019: Added by Shraddha D for Vertical edit
           // Start || Commented By Nikhil Mali on 11-02-2020||  WBDIN-40 || for Pop Up Changes
			//var tempX = 0;
            //var tempY = 0;
            //e = window.event || event;
            //var bodyOffsets = document.body.getBoundingClientRect();
            //tempX = e.pageX - bodyOffsets.left;
            //tempY = e.pageY;
            //if (tempY >= 700) {
            //    tempY = 505;

            //}

            <%--document.getElementById('<%=pnlUserPermission.ClientID%>').style.left = tempX + "px";
            document.getElementById('<%=pnlUserPermission.ClientID%>').style.top = tempY + "px";
            document.getElementById('<%=hdnTop.ClientID%>').value = tempY;
            document.getElementById('<%=hdnLeft.ClientID%>').value = tempX;--%>
			
			// End || Commented By Nikhil Mali on 11-02-2020||  WBDIN-40 || for Pop Up Changes
         
            document.getElementById('<%=rowIndex.ClientID%>').value = $(RowP).parent().parent().children().index($(RowP).parent()) - 1;
            // alert($(RowP).parent().parent().children().index($(RowP).parent()) - 1)

            if (document.getElementById('<%=rowIndex.ClientID%>').value >= 0) {
                document.getElementById('<%=btnPopUp_Load.ClientID%>').click();
            }
        }
        //START | 20-Aug-2020 | Rajeshree K- Function for displaying partner workflows grid
        function displayPartnerWFGrid(RowP) {

            document.getElementById('<%=lblError.ClientID%>').innerHTML = "";
            document.getElementById('<%=pnlPartnerWorkflows.ClientID%>').className = "panel";
            document.getElementById('<%=pnlPartnerWorkflows.ClientID%>').style.display = "block";
            document.getElementById("overlayDiv").style.display = "block";  //13-Sept-2019: Added by Shraddha D for Vertical edit

         
            document.getElementById('<%=rowIndex.ClientID%>').value = $(RowP).parent().parent().children().index($(RowP).parent()) - 1;
            // alert($(RowP).parent().parent().children().index($(RowP).parent()) - 1)

            if (document.getElementById('<%=rowIndex.ClientID%>').value >= 0) {
                document.getElementById('<%=btnLoadPartnerWorkflows.ClientID%>').click();
            }
        }
        //END | 20-Aug-2020 | Rajeshree K- Function for displaying partner workflows grid

        function displayUserPermission() {
            document.getElementById('<%=lblError.ClientID%>').innerHTML = "";
            document.getElementById('<%=pnlUserPermission.ClientID%>').className = "panel";
            document.getElementById('<%=pnlUserPermission.ClientID%>').style.display = "block";
			 // Commented By Nikhil Mali on 11-02-2020||  WBDIN-40 || for Pop Up Changes
           <%-- document.getElementById('<%=pnlUserPermission.ClientID%>').style.left = document.getElementById('<%=hdnLeft.ClientID%>').value + "px";
            document.getElementById('<%=pnlUserPermission.ClientID%>').style.top = document.getElementById('<%=hdnTop.ClientID%>').value + "px";--%>


        }

        //START | 20-Aug-2020 | Rajeshree K- Function for displaying partner workflows grid
        function displayPartnerWF() {
            document.getElementById('<%=lblError.ClientID%>').innerHTML = "";
            document.getElementById('<%=pnlPartnerWorkflows.ClientID%>').className = "panel";
            document.getElementById('<%=pnlPartnerWorkflows.ClientID%>').style.display = "block";

        }
        //END | 20-Aug-2020 | Rajeshree K- Function for displaying partner workflows grid

        function EnterEvent(e) {
            if (e.keyCode == 13) {
                document.getElementById('<%=BtnLoad.ClientID%>').click();
            }
        }

        function EnterEventOnPopUp(e) {
            if (e.keyCode == 13) {
                document.getElementById('<%=btnPopUp_Load.ClientID%>').click();
            }
        }

        //START | 20-Aug-2020 | Rajeshree K- Function for displaying partner workflows grid
        function EnterEventOnWorkflowPopUp(e) {
            if (e.keyCode == 13) {
                document.getElementById('<%=btnLoadPartnerWorkflows.ClientID%>').click();
            }
        }
        //END | 20-Aug-2020 | Rajeshree K- Function for displaying partner workflows grid

        $(function () {

            var rx = /INPUT|SELECT|TEXTAREA/i;

            $(document).bind("keydown keypress", function (e) {
                if (e.which == 8) {
                    if (!rx.test(e.target.tagName) || e.target.disabled || e.target.readOnly) {
                        e.preventDefault();
                    }
                }
            });
        });

        function Check_Click(chkBox) {

            var row = chkBox.parentNode.parentNode.parentNode;
            var GridView = row.parentNode;

            var inputList = GridView.getElementsByTagName("input");

            for (var i = 0; i < inputList.length; i++) {

                var headerCheckBox = inputList[0];
                var checked = true;

                if (inputList[i].type == "checkbox" && inputList[i] != headerCheckBox) {
                    if (!inputList[i].checked) {
                        checked = false;
                        break;
                    }
                }
            }
            headerCheckBox.checked = checked;
        }

        function checkAll(chkAll) {

            var GridView = chkAll.parentNode.parentNode.parentNode;
            var inputList = GridView.getElementsByTagName("input");

            for (var i = 0; i < inputList.length; i++) {

                var row = inputList[i].parentNode.parentNode;
                if (inputList[i].type == "checkbox" && chkAll != inputList[i]) {
                    if (chkAll.checked) {
                        inputList[i].checked = true;
                    }
                    else {
                        inputList[i].checked = false;
                    }
                }
            }
        }

        function isNumberKey(evt) {
            var charCode = (evt.which) ? evt.which : evt.keyCode;

            if (charCode > 31 && (charCode < 48 || charCode > 57))
                return false;
            return true;
        }
        
    </script>
</asp:Content>
