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

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
    <style>
        fieldset {
            border: 1px solid #DDDDDD !important;
        }
    </style>

    <script src="../FinIQJS/SortFilter.js" type="text/javascript"></script>

    <script type="text/javascript">

        //Added by AkshayD for checkbox functionality on 11 Jan 2019
        function Check_Click(objRef) {
            //Get the Row based on checkbox
            var row = objRef.parentNode.parentNode;

            //Get the reference of GridView
            var GridView = row.parentNode;

            //Get all input elements in Gridview
            var inputList = GridView.getElementsByTagName("input");

            for (var i = 0; i < inputList.length; i++) {
                //The First element is the Header Checkbox
                var headerCheckBox = inputList[0];
                //Based on all or none checkboxes
                //are checked check/uncheck Header Checkbox
                var checked = true;
                if (inputList[i].type == "checkbox" && inputList[i] != headerCheckBox) {
                    if (!inputList[i].checked) {
                        checked = false;
                        break;
                    }
                }
            }

            headerCheckBox.checked = checked;
        }

        function checkAll(objRef) {

            var GridView = objRef.parentNode.parentNode.parentNode;

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

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

                //Get the Cell To find out ColumnIndex

                var row = inputList[i].parentNode.parentNode;

                if (inputList[i].type == "checkbox" && objRef != inputList[i]) {

                    if (objRef.checked) {

                        //If the header checkbox is checked
                        //check all checkboxes
                        inputList[i].checked = true;
                    }
                    else {
                        //If the header checkbox is checked
                        //uncheck all checkboxes

                        inputList[i].checked = false;
                    }
                }
            }
        }
        //Added by VijayH || 12-May-2022 || To Search on Enter Button Press        
        function EnterEvent(e) {
            e = e || event || window.event;
            keycode = e.which || e.keyCode;
            //alert(e.keyCode)
            if (keycode == 13 || keycode == 9) {
                document.getElementById('<%=btnLoad.ClientID%>').click();
            }
        }
    </script>

    <asp:Label ID="lblError" runat="server" CssClass="lblError" Text="" ForeColor="red" Style="margin-left: 25px"></asp:Label>
    <div id="Controls" style="margin-top: 10px">
        <table>
            <tr>
                <td>
                    <fieldset>
                        <legend>Search</legend>
                        <table style="border-spacing: 5px">
                            <tr>
                                <%--<td>
                                    <asp:label id="lblScheme" runat="server" cssclass="lbl" style="margin-right: 10px">Scheme:</asp:label>
                                </td>
                                <td>
                                    <asp:textbox id="txtscheme" runat="server" width="150px"></asp:textbox>
                                </td>--%>
                                <td>
                                    <asp:Label ID="lblTemplate" runat="server" CssClass="lbl" Style="margin-right: 10px">Template:</asp:Label>
                                    <%--Added by VijayH || 12-May-2022 || To Search on Enter Button Press--%>
                                    <asp:TextBox ID="txtTemplate" runat="server" onfocus="this.select();" onmouseup="return false;" Width="200px" OnTextChanged="txtTemplate_TextChanged"  onkeydown="return EnterEvent(event)"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:Button ID="btnLoad" runat="server" Text="Load" CssClass="btn" Width="150px" Style="margin-left: 25px" />
                                </td>
                                <td>
                                    <asp:Button ID="btnUCPTable" runat="server" Text="UCP Table Scripts" CssClass="btn" Width="150px" />
                                </td>
                            </tr>
                            <tr>
                                <td rowspan="3">
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:CheckBox ID="chkIncludeFunScripts" runat="server" Checked="true" />
                                                <asp:Label ID="lblIncludeFunScripts" runat="server" CssClass="lbl" Style="margin-right: 10px">Functions Scripts in single file</asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>

                                                <asp:CheckBox ID="chkIncludeDocgen" runat="server" />
                                                <asp:Label ID="lblIncludeDocgen" runat="server" CssClass="lbl" Style="margin-right: 10px">Include Docgen</asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:CheckBox ID="chkIncludeSubtemplate" runat="server" />
                                                <asp:Label ID="lblIncludeSubtemplate" runat="server" CssClass="lbl" Style="margin-right: 10px">Include SubTemplate</asp:Label>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:CheckBox ID="chkIncludeTempDocMap" runat="server" />
                                                <asp:Label ID="lblIncludeTempDocMap" runat="server" CssClass="lbl" Style="margin-right: 10px">Include Template DocMap</asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                                <td>
                                    <asp:Button ID="btnExport" runat="server" Text="Export" CssClass="btn" Width="150px" Style="margin-left: 25px" />
                                </td>
                                <td>
                                    <asp:Button ID="btnUDTExport" runat="server" Text="UDT Scripts" CssClass="btn" Width="150px" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Button ID="btnIntersectionMapping" runat="server" Text="Intersection Fields" CssClass="btn" Width="150px" Style="margin-left: 25px" />    <%--Changed by BhagyashriB on 15-June-2021 | changed name from Intersection Mapping to Intersection Field Master, asked by HemlataA --%>
                                </td>
                                <td>
                                    <asp:Button ID="btnSPExport" runat="server" Text="SP Scripts" CssClass="btn" Width="150px" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Button ID="btnStaticAccessMatrix" runat="server" Text="Static Access Matrix" CssClass="btn" Width="150px" Style="margin-left: 25px" />
                                </td>
                                <td>
                                    <asp:Button ID="btnIndex" runat="server" Text="Index Scripts" CssClass="btn" Width="150px" />
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                </td>
                <td>
                    <fieldset>
                        <legend>Save Template As</legend>
                        <table>
                            <tr>
                                <td>
                                    <asp:Label ID="lblModule" runat="server" CssClass="lbl" Style="margin-right: 10px">Module:</asp:Label>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlmodule" Width="180px" runat="server" CssClass="ddl" AutoPostBack="true"></asp:DropDownList>
                                </td>
                                <td>
                                    <asp:Label ID="lblTemplateCode" runat="server" CssClass="lbl" Style="margin-right: 10px; margin-left: 15px; width: 100px">Template Code:</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtTemplateCode" runat="server" onfocus="this.select();" onmouseup="return false;" Width="180px"></asp:TextBox>
                                </td>
                                <td>
                                    <asp:Button ID="btnSaveAs" runat="server" Text="Save As" CssClass="btn" Width="120px" Style="margin-left: 10px" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Label ID="lblSchemeName" runat="server" CssClass="lbl" Style="margin-right: 10px">Scheme:</asp:Label>
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlScheme" Width="180px" runat="server" CssClass="ddl" AutoPostBack="true"></asp:DropDownList>
                                </td>
                                <td>
                                    <asp:Label ID="lblTemplateName" runat="server" CssClass="lbl" Style="margin-right: 10px; margin-left: 10px">Template Name:</asp:Label>
                                </td>
                                <td>
                                    <asp:TextBox ID="txtTemplateName" runat="server" onfocus="this.select();" onmouseup="return false;" Width="180px"></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </fieldset>
                </td>
            </tr>
        </table>
    </div>
    <div id="GridDiv" style="margin-top: 25px">
        <asp:GridView ID="dgvUCPEXP" runat="server" verticalcontentalignment="Center" AutoGenerateColumns="False" CssClass="Grid" AllowSorting="True" ShowHeaderWhenEmpty="True"
            EmptyDataText="No Records Found" rowheaderswidthsizemode="DisableResizing;" SelectedRowStyle-Wrap="true" HeaderStyle-CssClass="GridHeaderTitle">
            <SelectedRowStyle CssClass="GridItemSelect" />
            <RowStyle CssClass="GridItem" />
            <HeaderStyle CssClass="GridHeader" />
            <FooterStyle CssClass="GridFooter" />
            <PagerStyle CssClass="GridPager" />

            <Columns>

                <asp:TemplateField>
                    <HeaderStyle Wrap="true" HorizontalAlign="Center" VerticalAlign="Middle" Width="20px" />
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="false" Width="20px" />
                    <HeaderTemplate>
                        <asp:CheckBox ID="chkAll" runat="server" />
                    </HeaderTemplate>
                    <ItemTemplate>
                        <asp:CheckBox ID="CheckRecord" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Scheme Name" Visible="false">
                    <HeaderStyle Wrap="False" Width="150px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="left" Wrap="false" />
                    <ItemTemplate>
                        <asp:Label ID="lblScheme" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Scheme_Name").ToString)%>' />
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Scheme Alias">
                    <HeaderStyle Wrap="False" Width="120px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="left" Wrap="false" />
                    <ItemTemplate>
                        <asp:Label ID="lblSchemeAlias" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Scheme_Alias").ToString)%>' />
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Template Name">
                    <HeaderStyle Wrap="False" Width="150px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="left" Wrap="false" />
                    <ItemTemplate>
                        <asp:Label ID="lblTemplate" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Template_Name").ToString)%>' />
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Scheme Code">
                    <HeaderStyle Wrap="True" Width="50px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="left" Wrap="false" />
                    <ItemTemplate>
                        <asp:Label ID="lblSchemeCode" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.ST_Scheme_Code").ToString)%>' />
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Template ID">
                    <HeaderStyle Wrap="True" Width="50px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="left" Wrap="false" />
                    <ItemTemplate>
                        <asp:Label ID="lblTemplateID" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.ST_Template_ID").ToString)%>' />
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Template Code">
                    <HeaderStyle Wrap="False" Width="150px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="left" Wrap="false" />
                    <ItemTemplate>
                        <asp:Label ID="lblTemplateCode" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Template_Code").ToString)%>' />
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Created At">
                    <HeaderStyle Wrap="False" Width="180px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="left" Wrap="false" />
                    <ItemTemplate>
                        <asp:Label ID="lblCreatedAt" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Created_At").ToString)%>' />
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Created By">
                    <HeaderStyle Wrap="False" Width="180px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="left" Wrap="false" />
                    <ItemTemplate>
                        <asp:Label ID="lblCreatedBy" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Created_By").ToString)%>' />
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Updated At">
                    <HeaderStyle Wrap="False" Width="180px"></HeaderStyle>
                    <ItemStyle HorizontalAlign="left" Wrap="false" />
                    <ItemTemplate>
                        <asp:Label ID="lblUpdatedAt" runat="server" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.Updated_At").ToString)%>' />
                    </ItemTemplate>
                </asp:TemplateField>

            </Columns>
        </asp:GridView>
    </div>

</asp:Content>
