<%@ Page Language="vb" Title="Config Viewer" AutoEventWireup="true" MasterPageFile="~/FiniqAppMasterPage.Master"
    CodeBehind="ConfigViewer.aspx.vb" Inherits="FinIQWebApp.ConfigViewer" ValidateRequest="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="Server">
    <script src="../FinIQJS/SortFilter_Grid.js"></script>
<script src="../FinIQJS/FreezeGrid.js"></script>
<link href="../FinIQJS/FreezeGrid.css" rel="stylesheet" type="text/css" />
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server">
    </asp:ScriptManagerProxy>
   
    <script>
        function isNumberKey(evt) {
            var charCode = (evt.which) ? evt.which : evt.keyCode;
            if (charCode > 31 && (charCode < 48 || charCode > 57))
                return false;
            return true;
        }

        //Find on Tab/Enter btn click - Added by AshwiniP on 11-Jan-2021
        document.addEventListener("keydown", keyDownTextField, false);
        function keyDownTextField(e) {
            var keyCode = e.keyCode;
            if (keyCode == 13 || keyCode == 09) {
                document.getElementById('<%= btngo.ClientID %>').click();
            }
        }

    </script>
    <script language="javascript" type="text/javascript" src="ConfigViewer.js"></script>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table>
                <tr>
                    <td colspan="3">
                        <asp:Label ID="lblMsgInfo" runat="server" CssClass="lblInfo"></asp:Label>
                        <asp:Label ID="lblError" runat="server" CssClass="lblError"></asp:Label>
                        <%--Jira Number:-ANZDCIUPIN-140 Added By Shubham K on 13-Jul-2020 . Change width of the rowsperpage textbox--%>
                        <asp:Label ID="lblSuccess" runat="server" CssClass="lblSuccess"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <table class="tbl">
                            <tr>
                                <td class="lblBlotterPaddingRight">
                                    <asp:Label ID="lblEntity" runat="server" Text="<%$ Resources:LocalizedText, Entity %>" CssClass="lbl"></asp:Label>
                                </td>
                                <td class="ctlBlotterPaddingRight">
                                    <asp:DropDownList ID="ddlEntity" Style="width: 150px;" runat="server" CssClass="ddl" TabIndex="1" OnSelectedIndexChanged="ddlEntity_SelectedIndexChanged" AutoPostBack="true">
                                    </asp:DropDownList>
                                </td>
                                <td class="ctlBlotterPaddingRight">
                                    <asp:Button ID="btnsave" runat="server" Text="Save" CssClass="btn" TabIndex="6" Width="60px" />
                                </td>
                                <td class="lblBlotterPaddingRight">
                                    <asp:Label ID="lblRowsperpage" runat="server" CssClass="lbl" Text="Record(s) Per Page" />
                                </td>
                                <%--Jira Number:-ANZDCIUPIN-140 Added By Shubham K on 13-Jul-2020 . Change width of the rowsperpage textbox--%>
                                <td class="lblBlotterPaddingRight">
                                    <asp:TextBox ID="txtrowsperpage" runat="server" CssClass="txt" MaxLength="3" Style="text-align: center;" AutoPostBack="true" Width="35px" onkeypress="return isNumberKey(event)" />
                                </td>
                                  <td class="lblBlotterPaddingRight">
                                    <%--<asp:Button ID="btnExport" CssClass="btn" runat="server" Width="115px"  Text="Export To Excel"></asp:Button>--%>
                                       <asp:LinkButton ID="btnExport" runat="server" Visible="true"><img src="../App_Resources/Excel.png" alt="Export To Excel"  
                                        style="max-width:52px !important;" /></asp:LinkButton>
                                </td>
                            </tr>
                            <tr><td></td></tr>
                            <tr>
                                <td class="lblBlotterPaddingRight">
                                    <asp:RadioButton ID="rdoAll" runat="server" Checked="true" GroupName="1" Text="All"
                                        CssClass="RadioBtn" TabIndex="2" AutoPostBack="true" />

                                    <asp:RadioButton ID="rdoSearch" runat="server" GroupName="1" Text="Search" CssClass="RadioBtn"
                                        AutoPostBack="true" TabIndex="3" />
                                </td>
                                <%--Jira Number:-ANZDCIUPIN-140 Added By Shubham K on 13-Jul-2020 . Change width of the serach textbox--%>
                                <td class="ctlBlotterPaddingRight">
                                    <div onclick="change_rdobtn()">
									<%--Added By Shubham K on 06-MAR-2021, Added Enabled=false --%>
                                        <asp:TextBox ID="txtSearch" runat="server" CssClass="txt" TabIndex="4" Style="width: 150px;" Enabled="false"></asp:TextBox>
                                    </div>
                                </td>

                                <td class="ctlBlotterPaddingRight">
                                    <asp:Button ID="btngo" runat="server" Text="Go" CssClass="btn" TabIndex="5" Width="60px" AutoPostBack="true"/>
                                </td>

                                <td class="lblBlotterPaddingRight">
                                    <asp:Label ID="LblRowCountName" runat="server" CssClass="lbl" Text="Total Record(s):"></asp:Label>
                                </td>

                                <td class="ctlBlotterPaddingRight">
                                    <asp:Label ID="LblRowCount" runat="server" CssClass="lbl" Text="Row Count"></asp:Label>
                                </td>
                            </tr>
                            <tr><td colspan="5" style="height:10px;"></td></tr>
                        </table>
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td>
                        <asp:DataGrid ID="dgconfig" runat="server" AllowSorting="True" Style="table-layout:fixed;"
                            CellSpacing="0" AutoGenerateColumns="False" AllowPaging="True"
                            CssClass="Grid">
                            <SelectedItemStyle CssClass="GridItemSelect"></SelectedItemStyle>
                            <ItemStyle CssClass="GridItem" Wrap="true"></ItemStyle>
                            <HeaderStyle CssClass="GridHeader" HorizontalAlign="Center" Wrap="true"></HeaderStyle>
                            <FooterStyle CssClass="GridFooter"></FooterStyle>
                            <PagerStyle CssClass="GridPager" />
                            <Columns>
                                <asp:TemplateColumn>
                                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle"></ItemStyle>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="chkGrid" runat="server"></asp:CheckBox>
                                    </ItemTemplate>
                                </asp:TemplateColumn>
                                <asp:TemplateColumn  HeaderText="Config Setting">
                                    <ItemStyle Wrap="true" HorizontalAlign="Left"></ItemStyle>
                                      <ItemTemplate>
                                        <asp:label ID="lblConfName" runat="server" Width="500px" Text='<%# DataBinder.Eval(Container, "DataItem.Config_Name")%>'>
                                        </asp:label>
                                    </ItemTemplate>
                                </asp:TemplateColumn>
                                <asp:TemplateColumn HeaderText="Value">
                                    <ItemStyle HorizontalAlign="left" Wrap="true"></ItemStyle>
                                    <ItemTemplate>
                                        <asp:TextBox ID="dgtxtvalue" runat="server" Width="350px" Text='<%# DataBinder.Eval(Container, "DataItem.Current_Value")%>'
                                            Disabled="true" CssClass="txt" >
                                        </asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateColumn>
                                <asp:BoundColumn Visible="false" DataField="Entity_Name"></asp:BoundColumn>
                                <asp:BoundColumn Visible="false" DataField="setting_Id"></asp:BoundColumn>
                              </Columns>
                            <PagerStyle CssClass="GridPager" Mode="NumericPages"></PagerStyle>
                        </asp:DataGrid>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="btnExport" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
