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

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <style>
        .txtTable {
            width: 50px;
            height: 25px;
            text-align: center !important;
        }

        .btnTable {
            width: 50px;
            height: 24px;
            color: #000000 !important;
            cursor: pointer !important;
            text-align: center !important;
            font: normal 11px verdana !important;
            background-color: buttonface;
        }

         /*RameshwariD || 26-09-19 || For Backgrounf color to header style*/
         .GridHeader {
            color: black !important;
            border: solid 1px #dddddd;
            background-color: #ededed !important;
            padding-left: 6px;
        }
         /*RameshwariD || 26-09-19 || For Backgrounf color to header style*/
    </style>

    <script type="text/javascript">
        function getenter() {
            
            if (event.keyCode == 13 || event.keyCode == 9)// Enter
            {
                
                document.getElementById('<%=BtnEnter.ClientID%>').click();
            }
        }

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

            if (charCode > 31 && (charCode < 48 || charCode > 57))
                return false;

            return true;
        }

        function KeysAllowedForNotional() {
            try {
                //
                var e = window.event;

                var key = window.event.keyCode;

                var obj;

                if (e.target) { obj = e.target; }

                else if (e.srcElement) { obj = e.srcElement; }



                if (key != 8) {

                    //if ((Len(obj.value) > 0) && (!(isNumeric(Right(obj.value, 1)))))

                    if ((Len(obj.value) > 0) && (Right(obj.value, 1) != "." && (!(isNumeric(Right(obj.value, 1)))))) {
                        return false;
                    }

                    else {
                        var character = String.fromCharCode(key);
                        var s = obj.value;
                        if ((s.indexOf(".") != -1) && (character == ".")) window.event.returnValue = false;
                        else
                            if (key > 47 && key < 58) return;
                            else {
                                // var character = String.fromCharCode(key);
                                if (character == "K" || character == "M" || character == "B" || character == "T" || character == "L" || character == "P" || character == "k" || character == "m" || character == "b" || character == "t" || character == "l" || character == "p" || character == ".")
                                    return true;
                                else
                                    return false;
                            }

                    }

                }
            }
            catch (error) {

            }
            finally {

            }
        }

        function ConfirmDeleteSegPer() {
            
            var count = document.getElementById("<%=hdnCheckedCount.ClientID%>").value;
                    if (count == 0) {

                        FinIQ_Notify('Please select record(s) to delete', 'alert')
                        return false;
                    }
                    else {
                        return confirm("Do you want to delete " + count + " record(s)?");
                    }
                }
    </script>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <table>
                <tr>
                    <td>
                        <table>
                            <tr>
                                <td>
                                    <table>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblError" runat="server" CssClass="lblError"></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        <td>
                            <table>
                                <tr>
                                    <td>
                                        <table>
                                            <tr>
                                                <td>
                                                    <asp:Label ID="lblSearch" runat="server" Text="Search" />
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtSearch" runat="server" TabIndex="1"  AutoPostBack="true" OnTextChanged="txtSearch_TextChanged" />  <%--Priya D || 28-OCt-20||INT1FINFXC -38--%>
                                                </td>
                                                <td>
                                                    <!--Modified tab indices to fix tab sequence-->
                                                    <asp:Button ID="btnSearch" runat="server" CssClass="btn" TabIndex="2" Text="Search" Width="70px" />
                                                </td>
                                                <td id="tdbtnload" runat="server">
                                                    <asp:Button ID="btnload" runat="server" CssClass="btn" TabIndex="3" Text="Refresh" Width="70px" />
                                                </td>

                                                <td id="tdbtnSave" runat="server">
                                                    <asp:Button ID="btnSave" runat="server" CssClass="btn" TabIndex="4" Text="Save" Width="70px" />
                                                </td>
                                                <!--Rajeshree K | 17-Sep-2019 | Added Delete functionality for UOBICXCLI-563 -->
                                                <td id="tdbtnDelete" runat="server">
                                                    <asp:HiddenField ID="hdnCheckedCount" runat="server" />
                                                    <asp:Button ID="btnDelete" runat="server" CssClass="btn" TabIndex="5" Text="Delete" Width="70px" OnClientClick="return ConfirmDeleteSegPer();"/>
                                                </td>

                                                <td id="tdbtnCancel" runat="server">
                                                    <asp:Button ID="btnCancel" runat="server" CssClass="btn" TabIndex="6" Text="Cancel" Width="70px" Style="margin-left: -2px" />
                                                </td>

                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </td>
                </tr>
                <tr>
                    <td>
                        <table>
                            <tr>
                                <td>
                                    <asp:GridView ID="gvUserRFQLimit" runat="server" CellPadding="3" EmptyDataText="No data found." AutoGenerateColumns="False"
                                        ShowHeaderWhenEmpty="true" AllowSorting="true"  BorderColor="White" GridLines="Both">
                                        <SelectedRowStyle CssClass="GridItemSelect" />
                                        <AlternatingRowStyle CssClass="AlternatItemStyle"></AlternatingRowStyle>
                                        <RowStyle CssClass="GridItem" />
                                        <HeaderStyle CssClass="GridHeader" />
                                        <FooterStyle CssClass="GridFooter" />
                                        <PagerStyle CssClass="GridPager" />
                                        <PagerSettings FirstPageText="First" LastPageText="Last" Mode="NumericFirstLast" Position="Bottom" />
                                        <Columns>
                                            <asp:TemplateField HeaderText="" >
                                                <HeaderStyle Wrap="true"></HeaderStyle>
                                                <HeaderTemplate>
                                                    <asp:CheckBox ID="chkAll" runat="server" AutoPostBack="true" OnCheckedChanged="chkAll_CheckedChanged" TabIndex="7"/>
                                                </HeaderTemplate>
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chkSingle" runat="server" AutoPostBack="true" Style="margin-left: 4px" OnCheckedChanged="chkSingle_CheckedChanged" TabIndex="8"></asp:CheckBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Login ID">
                                                <ItemStyle Width="150px" Wrap="true" />
                                                <ItemTemplate>
                                                    <div style="word-break: break-all">
                                                        <asp:Label ID="lblLoginID" runat="server" Width="150px" Text='<%# Eval("L_Id")%>' />
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <%--                                            <asp:TemplateField headerText="User Name">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblUserName" runat="server" text="" />
                                                </ItemTemplate>
                                            </asp:TemplateField>--%>
                                            <asp:TemplateField HeaderText="Email">
                                                <ItemStyle Width="180px" Wrap="true" />
                                                <ItemTemplate>
                                                    <div style="word-break: break-all">
                                                        <asp:Label ID="lblEmail" runat="server" Width="180px" Text='<%# Eval("email")%>' />
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <%--                                            <asp:TemplateField headerText="CTO/Dealer Code">
                                                <ItemTemplate>
                                                    <asp:Label ID="lblCTOCode" runat="server" Text='<%# Eval("CTOCode")%>' />
                                                </ItemTemplate>
                                            </asp:TemplateField>--%>
                                            <asp:TemplateField HeaderText="RFQ Reply Limit">
                                                <ItemStyle Width="120px"/>
                                                <ItemTemplate>
                                                    <div style="text-align: right">
                                                        <asp:Label ID="lblRFQReplyLimit" runat="server" Width="120px" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.RFQReplylimit").ToString)%>'  />
                                                        <!--Added autopostback=true. By Rajeshree K on 6th August 2019-->
                                                        <asp:TextBox ID="txtRFQReplyLimit" autopostback="true" runat="server" Style="text-align: right" Width="120px" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.RFQReplylimit").ToString)%>' Visible="false" onkeypress="return KeysAllowedForNotional();" OnTextChanged="txtRFQReplyLimit_TextChanged" MaxLength="12"/>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Limit Ccy">
                                                <ItemStyle Width="70px" Wrap="true" />
                                                <ItemTemplate>
                                                    <div style="text-align: center">
                                                        <asp:Label ID="lblLimitCcy" runat="server" Width="70px" Text='<%# Eval("LimitCcy")%>' />
                                                        <asp:DropDownList ID="ddlLimitCcy" Width="62px" runat="server" CssClass="ddl" AutoPostBack="true" Visible="false" />
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                    </asp:GridView>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:Button ID="btnPrev" runat="server" CssClass="btnTable" Text="Prev" tabindex="9"/>
                                    <%--     <asp:TextBox ID="txtpageno" runat="server" Height="25PX" MaxLength="6" onkeypress="return isNumberKey(event)" onkeyup="getenterWF()" Style="text-align: center; float: left;" Text="1" Width="50px"></asp:TextBox>--%>
                                    <asp:TextBox ID="txtPageNo" runat="server" TabIndex="10" onkeypress="return isNumberKey(event)" onkeydown="getenter()" CssClass="txtTable" Text="1" MaxLength="6"></asp:TextBox>
                                    <asp:Button ID="BtnEnter" runat="server" Style="display: none" />
                                    <asp:Button ID="btnNext" runat="server" CssClass="btnTable" Text="Next" tabindex="11"/>
                                    &nbsp;&nbsp;
                                           <asp:Label ID="lblrowswft" runat="server" Text="Rows Per Page:" />
                                    <asp:TextBox ID="txtrowsPerPage" runat="server" MaxLength="6" TabIndex="12" onkeydown="getenter()" Text="15" CssClass="txtTable" value="Enter rows here" onkeypress="return isNumberKey(event)"></asp:TextBox>
                                    &nbsp;&nbsp;
                                    <%--<RameshwariD || 18Feb2020 || UOBICXINT-302>--%>
                                     <asp:Label ID="lblRecords" runat="server" Text="Total Record(s) :" CssClass="lbl"></asp:Label>
                                                <asp:Label ID="lblTotalRecords" runat="server" Text="" Style="padding-left: 10px" CssClass="lbl"></asp:Label>
                                    &nbsp;&nbsp;
                                    <%--<RameshwariD || 18Feb2020 || UOBICXINT-302>--%>
                                            <asp:HiddenField ID="hdn_pagenumber" runat="server" />
                                    <asp:HiddenField ID="hdn_pagenochanged" runat="server" />
                                    <asp:HiddenField ID="hdn_filterschanged" runat="server" />

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

            <%-- </table>--%>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>