<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="FinIQ_Workflow_EntityMapping.aspx.vb" Inherits="FinIQWebApp.FinIQ_WOrkflow_EntityMapping"
    MasterPageFile="~/FiniqAppMasterPage.Master" Title="Workflow Entity Mapping" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>



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

    <asp:ScriptManagerProxy ID="ScriptManagerProxy11" runat="server">
    </asp:ScriptManagerProxy>
    <script src="../FinIQJS/SortFilter_Grid.js"></script>
     <script src="../FinIQJS/FreezeGrid.js"></script>
    <link href="../FinIQJS/FreezeGrid.css" rel="stylesheet" type="text/css"/>
    <style type="text/css">
        .btn, .btnCommon, .btn:hover {
            width: 70px;
            text-align: center !important;
        }

        .ddl {
            width: auto;
        }

        .constantWidth {
            width: 6px;
        }

        .auto-style1 {
            width: 11px;
        }
        table.Grid {
    display: unset !important;
}
    </style>


    <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

        function isNumberKey(evt) {
            var charCode = (evt.which) ? evt.which : evt.keyCode;
            if (charCode > 31 && (charCode < 48 || charCode > 57))
                return false;
            return true;
        }

    </script>



    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table>
                <tr>
                    <td>
                        <asp:Label ID="lblError" runat="server"  CssClass="lblerror"></asp:Label>                        
                         <asp:Label ID="lblInfo" CssClass="lblInfo" runat="server" Text=""></asp:Label>
                          <asp:Label ID="lblSuccess" CssClass="lblSuccess" runat="server" Text=""></asp:Label>
                    </td>
                </tr>
            </table>
            <table style="padding-bottom: 10px; margin: 5px;">





                <tr>


                    <td>
                        <asp:Button ID="BtnAdd" runat="server" Text="Add" CssClass="btn btnCommon" /></td>
                    <td class="constantWidth"></td>
                    <td>
                        <asp:Button ID="BtnSave" runat="server" CssClass="btn btnCommon" Text="Save" />
                    </td>
                    <td class="constantWidth"></td>

                    <td>
                        <asp:Button ID="BtnDelete" runat="server" CssClass="btn btnCommon" OnClientClick="return confirm('Are you sure to delete this record(s) ?');" Text="Delete" />
                    </td>
                    <td class="constantWidth"></td>

                    <td>
                        <asp:Button ID="BtnCancel" runat="server" CssClass="btn btnCommon" Text="Cancel" />
                    </td>
                    <%--Added by Nikhil Mali for Rows Per Page - 999 : START--%>
                    <td>
                        <%--UBPINT-6 changed by Prateek M--%>
                        <asp:Label ID="lblRowsPerPage" runat="server" Text="Row(s) per page" Style="margin-left: 5px;" />
                        <asp:TextBox ID="txtRowsPerPage" runat="server" Text="999" Width="40px" Style="text-align: center;" AutoPostBack="true" MaxLength="3" onkeydown="EnterKeyEvent(event)" onkeypress="return isNumberKey(event)" />
                    </td>
                    <%--Added by Nikhil Mali for Rows Per Page - 999 : END--%>
                </tr>

                <tr>
                    <asp:GridView ID="dgvEntityMapping" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                        BorderStyle="Solid" BorderWidth="1px" CellPadding="3" CssClass="Grid Gridview " AllowPaging="True" PageSize="999" ShowHeaderWhenEmpty="true" HeaderStyle-CssClass="GridHeaderTitle">
                        <SelectedRowStyle CssClass="GridItemSelect" />
                        <RowStyle CssClass="GridItem" />
                        <HeaderStyle CssClass="GridHeader" />
                        <FooterStyle CssClass="GridFooter" />
                        <EmptyDataTemplate>
                            <asp:Label ID="lblEntityMappingGrid" runat="server" Text="No data found..."></asp:Label>
                        </EmptyDataTemplate>

                        <Columns>
                            <asp:TemplateField>
                                <ItemStyle Width="30px" />
                                <HeaderStyle Width="30px" />
                                <ItemTemplate>
                                    <asp:CheckBox ID="CheckboxRow" runat="server" AutoPostBack="false"></asp:CheckBox>
                                </ItemTemplate>
                            </asp:TemplateField>

                            <%--<asp:CommandField ButtonType="Link" ShowEditButton="true" EditText="Edit" UpdateText="" ControlStyle-Width="40">
                                    <HeaderStyle Width="40" />
                                    <ItemStyle Wrap="true" Width="40" HorizontalAlign="center" VerticalAlign="middle" />
                                 </asp:CommandField>--%>


                            <asp:TemplateField HeaderStyle-Wrap="True" Visible="true">
                                <ItemStyle Width="80px" />
                                <HeaderStyle Width="80px" />

                                <EditItemTemplate>
                                    <asp:LinkButton ID="btnUpdateNew" runat="server" CommandName="Update" Width="33px" Text="Update" HorizontalAlign="Left" CssClass="display: inline-block;" />
                                    &nbsp;
                                            <asp:LinkButton ID="btnCancelNew" runat="server" CommandName="Cancel" Width="33px" Text="Cancel" HorizontalAlign="Right" CssClass="display: inline-block;" />
                                </EditItemTemplate>


                                <ItemTemplate>
                                    <asp:LinkButton ID="btnEditNew" runat="server" CommandName="Edit" Text="Edit" />
                                </ItemTemplate>
                            </asp:TemplateField>


                            <asp:TemplateField HeaderStyle-Wrap="True" HeaderText="Serial No" Visible="true">
                                <ItemStyle Width="30px" HorizontalAlign="right" />
                                <HeaderStyle Width="30px" />
                                <ItemTemplate>
                                    <asp:Label ID="lblSer" runat="server" Text='<%#Container.DataItemIndex + 1%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:Label ID="lblSer1" runat="server" Text='<%#Container.DataItemIndex + 1%>' />
                                    <%--<cc1:ColorPickerExtender runat="server" id="" OnClientColorSelectionChanged="name()" />--%>
                                </EditItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderStyle-Wrap="True" HeaderText=" WEM Id" Visible="true">
                                <ItemStyle Width="50px" HorizontalAlign="Right" />
                                <HeaderStyle Width="50px" />
                                <ItemTemplate>
                                    <asp:Label ID="lblID" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WEM_ID").ToString)%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:Label ID="lblID1" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WEM_ID").ToString)%>' />
                                </EditItemTemplate>
                            </asp:TemplateField>



                            <%--------------------------------------------------------------------------------%>
                            <asp:TemplateField HeaderStyle-Wrap="True" HeaderText="Workflow">
                                <HeaderStyle Width="289px" />
                                <ItemStyle Wrap="false" Width="279px" HorizontalAlign="left" />

                                <ItemTemplate>
                                    <asp:Label ID="lblWorkflow" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WTM_Title").ToString)%>'>
                                    </asp:Label>
                                </ItemTemplate>

                                <EditItemTemplate>
                                    <asp:DropDownList ID="ddlWorkflow" runat="server" Width="279px" AutoPostBack="False">
                                    </asp:DropDownList>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <%--------------------------------------------------------------------------------%>

                            <asp:TemplateField HeaderStyle-Wrap="True" HeaderText="WorkflowID" Visible="false">
                                <HeaderStyle Width="289px" />
                                <ItemStyle Wrap="false" Width="279px" HorizontalAlign="left" />


                                <ItemTemplate>
                                    <asp:Label ID="lblWorkflowID" runat="server" Visible="false" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WEM_WTM_ID").ToString)%>'>
                                    </asp:Label>
                                </ItemTemplate>


                            </asp:TemplateField>



                            <asp:TemplateField HeaderStyle-Wrap="False" HeaderText="Entity">
                                <HeaderStyle Width="115px" />
                                <ItemStyle Width="115px" HorizontalAlign="left" />
                                <ItemTemplate>
                                    <asp:Label ID="lblEntity" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.entity_name").ToString)%>'>
                                    </asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:DropDownList ID="ddlEntity" runat="server" AutoPostBack="False" Width="115px">
                                    </asp:DropDownList>
                                </EditItemTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderStyle-Wrap="True" HeaderText="Priority" Visible="true">
                                <ItemStyle Width="66px" HorizontalAlign="Right" />
                                <HeaderStyle Width="66px" />
                                <ItemTemplate>
                                    <asp:Label ID="lblPriority" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WEM_Display_Priority").ToString)%>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtPriority" runat="server" onkeypress="return isNumberKey(event)" HorizontalAlign="Right" Width="66px" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.WEM_Display_Priority").ToString)%>' />
                                </EditItemTemplate>
                            </asp:TemplateField>

                        </Columns>
                    </asp:GridView>
                </tr>

            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
    <script type="text/javascript">
        //Added by Nikhil Mali for Rows per page - 999 Validations : START
        function IsNumber(evt) {

            evt = (evt) ? evt : window.event;
            var char = (evt.which) ? evt.which : evt.keyCode;
            if (char > 31 && (char < 48 || char > 57)) {
                return false;
            }
            return true;
        }


        function EnterKeyEvent(evt) {
            var code = (evt.which) ? evt.which : evt.keyCode;

            if (code == 13) {
                __doPostBack('<%=txtrowsperpage.ClientID%>', 'TextChanged');

            }
        }

        //Added by Nikhil Mali for Rows per page - 999 Validations : END
    </script>
</asp:Content>
