<%@ page title="" language="C#" masterpagefile="~/Pages/Common/MasterPages/MainMasterPage_new.master" autoeventwireup="true" inherits="Pages_FeeManagement_GatewayReceiptBookMapping, App_Web_a4mxz0ce" enableEventValidation="false" viewStateEncryptionMode="Never" %>

<%@ Register Src="~/UserControls/Common/ScreenGroup/ScreenGroup.ascx" TagName="ScreenGroupControl"
    TagPrefix="ScreenGroup" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <asp:UpdatePanel ID="SelectReportFormatUpdatePanel" runat="server">
        <ContentTemplate>
            <div id="divContentPage" class="divcontentpagemargin">
                <div class="dashBoardLeftCont">
                    <div class="himssuHeader3WireBox">
                        <table>
                            <tr>
                                <td>
                                    <div class="himsBoxContent">
                                        <div class="leftUlMenu">
                                            <ScreenGroup:ScreenGroupControl EnableViewState="true" ID="ScreenGroupControl" ScreenGroupId="236"
                                                Visible="true" runat="server" />
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="whiteboxpaddingleft row">
                    <div class="himssuHeader1WireBox card card-box">
                        <div class="himsBoxHeader card-head">
                            <div class="leftdiv">
                            </div>
                            <div class="himsBoxTitle">
                                <div class="headerText">
                                    <header>
                                        <asp:Label ID="Label1" runat="server" Text="Select Report Format"></asp:Label>
                                    </header>
                                </div>
                            </div>
                        </div>
                        <div class="himsBoxContent card-body">
                            <div class="contentHolder">
                                <div class="outerBox pTop5 col-md-3">
                                    <div class="controlLabelWidth">
                                        <asp:Label ID="GatewayConfigurationLabel" runat="server" Text="Gateway Configuration" SkinID="MandatoryLabel"></asp:Label>
                                    </div>
                                    <div class="fLeft pRight5">
                                        <asp:DropDownList runat="server" ID="GatewayConfigurationDropDownList" SkinID="CustomWidthDropDownList"
                                            class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                            AutoPostBack="true" OnSelectedIndexChanged="GatewayConfigurationDropDownList_OnSelectedIndexChanged">
                                        </asp:DropDownList>
                                    </div>
                                </div>
                                <div class="cBoth">
                                </div>
                                <br />
                                <div id="Div1" class="himssuHeader6WireBox box-body box-solid gridviewfont" runat="server" visible="false">
                                    <div class="himsBoxHeader" id="GridViewPagerDiv" runat="server">
                                        <div class="leftdiv">
                                        </div>
                                        <div class="himsBoxTitle">
                                            <div class="gridHeaderText">
                                                <asp:Label ID="GridViewLabel" Text="List" runat="server" />
                                            </div>
                                        </div>
                                    </div>
                                    <div class="himsBoxContent table-responsive">
                                        <asp:GridView ID="GatewayProductReceiptBookMappingGridView" runat="server" Width="100%" AutoGenerateColumns="False"
                                            EmptyDataText="No Records Found !!" AllowPaging="false" OnRowDataBound="GatewayProductReceiptBookMappingGridView_RowDataBound" CssClass="table table-striped table-bordered table-hover"
                                            ShowHeader="True" DataKeyNames="ReceiptBookId,GatewayProductId,IsEnabled">
                                            <Columns>
                                                <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="5%" ItemStyle-Width="10%"
                                                    ItemStyle-HorizontalAlign="Center">
                                                    <HeaderTemplate>
                                                        <label class="rt-chkbox rt-chkbox-outline">
                                                            <%--<asp:CheckBox ID="AllCheckBox" runat="server" onclick="selectAll(this);" /><br />--%>
                                                            <%--comment above line because javascript through it enable all inputs (including master page inputs) mantisid - 0031477--%>
                                                            <asp:CheckBox ID="AllCheckBox" runat="server" OnCheckedChanged="AllCheckBox_checked" AutoPostBack="true" /><br />

                                                            <span></span>
                                                        </label>
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <label class="rt-chkbox rt-chkbox-outline">
                                                            <asp:CheckBox ID="IsObsoleteCheckBox" runat="server" onclick="Check(this);" />
                                                            <span></span>
                                                        </label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:BoundField DataField="ReceiptBookName" HeaderText="Receipt Book" ItemStyle-Width="50%"
                                                    HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                <asp:TemplateField HeaderText="Gateway Product" ItemStyle-Width="40%" ItemStyle-HorizontalAlign="Left"
                                                    ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                    <ItemTemplate>
                                                        <asp:DropDownList ID="GatewayProductDownList" runat="server" SkinID="CustomWidthDropDownList" class="form-control" Width="100%">
                                                        </asp:DropDownList>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="InActive" ItemStyle-Width="5%" ItemStyle-HorizontalAlign="Left"
                                                    ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Left">
                                                    <ItemTemplate>
                                                        <label class="rt-chkbox rt-chkbox-outline">
                                                            <asp:CheckBox ID="InActiveCheckBox" runat="server" Checked='<%#Bind("IsObsolete")%>' /><br />
                                                            <span></span>
                                                        </label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                            <PagerSettings Visible="False" />
                                        </asp:GridView>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/assign-organization")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>
    <script type="text/javascript">
        function selectAll(invoker) {
            var inputElements = document.getElementsByTagName('input');
            for (var i = 0; i < inputElements.length; i++) {
                var myElement = inputElements[i];
                if (myElement.type === "checkbox") {
                    myElement.checked = invoker.checked;
                }
            }
        }

        function Check(obj) {
            var chk = false;
            if ($(obj).is(':checked'))
                chk = true;
            else
                chk = false;

            var row = obj.parentNode.parentNode.parentNode.rowIndex + 1;
            if (row < 10)
                row = "0" + row;

            if (chk == true) {
                $('#ctl00_CP_GatewayProductReceiptBookMappingGridView_ctl' + row + '_GatewayProductDownList').removeAttr('disabled');
                $('#ctl00_CP_GatewayProductReceiptBookMappingGridView_ctl' + row + '_InActiveCheckBox').removeAttr('disabled');
            }
            else {
                $('#ctl00_CP_GatewayProductReceiptBookMappingGridView_ctl' + row + '_GatewayProductDownList').attr('disabled', 'disabled');
                $('#ctl00_CP_GatewayProductReceiptBookMappingGridView_ctl' + row + '_InActiveCheckBox').attr('disabled', 'disabled');
            }
        }
    </script>
</asp:Content>
