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

<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">

    <%--<link type="text/css" rel="stylesheet" href="../App_Themes/Style1.css" />--%> <%-- Commented by Pratik S || 29-Sept-2021 || Black Theme Changes --%>
    <link type="text/css" rel="stylesheet" href="../OrderEntryPrecMetals/OrderEntryPrecMetals.css" />
    <script src="../FinIQJS/SortFilter_Grid.js" type="text/javascript"></script>

    <script type="text/javascript">

        Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function (evt, args) {
            try {
                SetSorting_Filter1();

                $(document).on("click", function () {

                    $('.lblError1:not(:empty)').empty();
                });
            } catch (e) {
                throw (e);
            }
        });

        function Search() {
            try {
                if ((event.which == 13) || (event.keyCode == 13) || (event.keyCode == 9) || (event.which == 9)) {
                    if ($('#ctl00_MainContent_txtRowsPerPage').val() == "" || $('#ctl00_MainContent_txtRowsPerPage').val() == "0")
                        $('#ctl00_MainContent_txtRowsPerPage').val('999')
                    document.getElementById('ctl00_MainContent_btnLoad').click();
                    return false;
                }
                else {
                    return true
                };
            } catch (e) {
                throw (e);
            }
        }

        function checkAll(objRef) {
            var GridView = objRef.parentNode.parentNode.parentNode;

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

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

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

                    if (objRef.checked) {
                        inputList[i].checked = true;
                        $('#ctl00_MainContent_blnChkAll').val('true');
                        document.getElementById('ctl00_MainContent_btnChkUnchkAll').click();
                    }
                    else {
                        inputList[i].checked = false;
                        $('#ctl00_MainContent_blnChkAll').val('false');
                        document.getElementById('ctl00_MainContent_btnChkUnchkAll').click();
                    }
                }
            }
        }
        function getenterload() {                      //Added by Nikhil Mali on 08/09/2020
            if (event.keyCode == 13)// Enter
            {
                document.getElementById('ctl00_MainContent_btnLoad').click();
            }
        }

        function allowAlphaSpace(e) {                          // Added By Nikhil Mali on 08/09/2020
            var code = ('charCode' in e) ? e.charCode : e.keyCode;
            if (!(code == 32) &&               // space
              !(code == 45) &&                 // '-' symbol
              !(code > 64 && code < 91) &&     // upper alpha (A-Z)
              !(code > 96 && code < 123)) {    // lower alpha (a-z)
                //!(code > 47 && code < 58) && // numeric (0-9)
                e.preventDefault();
            }
        }
    </script>

    <asp:UpdatePanel runat="server" ID="updPanel" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:HiddenField ID="blnChkAll" runat="server" />
            <asp:Button runat="server" Style="display: none" ID="btnChkUnchkAll" />
            <table>
                <tr>
                    <td>
                        <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="updPanel"
                            DisplayAfter="0">
                            <ProgressTemplate>
                                <div class="divLoading1">
                                    <img alt="Loading" src="../App_Resources/loading.gif" /><span class="lbl">Loading...&nbsp;&nbsp;
                                    </span>
                                </div>
                            </ProgressTemplate>
                        </asp:UpdateProgress>
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Label runat="server" ID="lblError" CssClass="lblError lblError1"></asp:Label>
                    </td>
                </tr>
            </table>

            <table>
                <tr>
                    <td>
                        <asp:Button runat="server" ID="btnLoad" Text="Load" CssClass="btn width80" />
                    </td>
                    <td class="Width90" style="padding-left:8px;">  <%--Modified by Nikhil Mali on 08-09-2020--%>
                        <asp:Button runat="server" ID="btnExport" Text="Export" CssClass="btn width80" AutoPostBack="true" />
                    </td>
                    <td>
                        <asp:Label runat="server" Text="Blotter Name:"></asp:Label>   <%--Added by Nikhil Mali on 08-09-2020--%>
                    </td>
                     <td>
                        <asp:textbox runat="server" ID="txtBlotterName" onKeyUp="getenterload();" onkeypress="allowAlphaSpace(event)"></asp:textbox>  <%--Added by Nikhil Mali on 08-09-2020--%>
                    </td>
                    <td class="width90 paddingTopTen paddingLeftFive" style="padding-left:8px;">  <%--Modified by Nikhil Mali on 08-09-2020--%>
                        <asp:Label runat="server" Text="Rows per page"></asp:Label>
                    </td>
                    <td class="paddingTopTen" ">
                        <asp:TextBox runat="server" ID="txtRowsPerPage" OnKeyPress="AllowOnlyNumeric();" onkeydown="Search();" CssClass="Width35 alignRight" AutoPostBack="true"></asp:TextBox>
                    </td>
                    
                </tr>
            </table>

            <table class="paddingTopTen">
                <tr>
                    <td>
                        <asp:GridView runat="server" ID="gvData" CssClass="Grid" AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true" ShowHeaderWhenEmpty="true" EmptyDataText="No Records Found">
                            <HeaderStyle CssClass="GridHeader" />
                            <RowStyle CssClass="GridItem" />
                            <FooterStyle CssClass="GridFooter" />
                            <PagerStyle CssClass="GridPager" />
                            <SelectedRowStyle CssClass="GridItemSelect" />
                            <AlternatingRowStyle CssClass="GridItem" />
                            <Columns>

                                <asp:TemplateField ControlStyle-CssClass="widthTwenty" HeaderStyle-CssClass="widthTwenty" ItemStyle-CssClass="widthTwenty">
                                    <HeaderTemplate>
                                        <asp:CheckBox ID="chkAll" runat="server" Visible="false" OnClick="checkAll(this);" AutoPostBack="false" />
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:CheckBox ID="chkRecord" runat="server" AutoPostBack="false" />
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="BPLM Id" ControlStyle-CssClass="widthFifty" HeaderStyle-CssClass="widthFifty" ItemStyle-CssClass="widthFifty" ItemStyle-HorizontalAlign="Center" Visible="false">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblBPLMId" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.BPLM_Id").ToString)%>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Code" ControlStyle-CssClass="widthFifty" HeaderStyle-CssClass="widthFifty" ItemStyle-CssClass="widthFifty" ItemStyle-HorizontalAlign="Left">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblBPLMCode" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.BPLM_Code").ToString)%>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Blotter Name" ControlStyle-CssClass="widthOneNinetyFive" HeaderStyle-CssClass="widthOneNinetyFive" ItemStyle-CssClass="widthOneNinetyFive" ItemStyle-HorizontalAlign="Left" ItemStyle-Wrap="true">
                                    <ItemTemplate>
                                        <%--<asp:Label runat="server" ID="lblBPLMLongName" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.BPLM_Long_Name").ToString)%>'></asp:Label>--%>
                                         <asp:Label runat="server" ID="lblBPLMLongName" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.BCM_Long_Name").ToString)%>'></asp:Label> <%--Changed by Jyoti K on 22-09-2021 JIRA UCP227--%>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Created At" ControlStyle-CssClass="widthOneFifty" HeaderStyle-CssClass="widthOneFifty" ItemStyle-CssClass="widthOneFifty" ItemStyle-HorizontalAlign="Center">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblBPLMCreatedAt" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.BPLM_Created_At").ToString)%>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Created By" ControlStyle-CssClass="widthSixtySeven" HeaderStyle-CssClass="widthSixtySeven" ItemStyle-CssClass="widthSixtySeven" ItemStyle-HorizontalAlign="Left">
                                    <ItemTemplate>
                                        <asp:Label runat="server" ID="lblBPLMCreatedBy" Text='<%# Microsoft.Security.Application.Encoder.HtmlEncode(DataBinder.Eval(Container, "DataItem.BPLM_Created_By").ToString)%>'></asp:Label>
                                    </ItemTemplate>
                                </asp:TemplateField>

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

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

                            </Columns>
                        </asp:GridView>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger ControlID="btnExport" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
