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

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<%@ Register Src="~/UserControls/GridViewPager/GridViewPager.ascx" TagName="GridViewPager" TagPrefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register Src="~/UserControls/Common/ScreenGroup/ScreenGroup.ascx" TagName="ScreenGroupControl" TagPrefix="ScreenGroup" %>

<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <asp:UpdatePanel ID="OTQueueListingUpdatePanel" runat="server">
        <ContentTemplate>
            <div id="divContentPage" class="divcontentpagemargin">
                <!-- ContentPlaceHolder Box Starts -->

                <div class="dashBoardLeftCont">
                    <div class="himssuHeader3WireBox">
                        <table>
                            <tr>
                                <td>
                                    <div class="himsBoxContent">
                                        <div class="leftUlMenu">
                                            <ScreenGroup:ScreenGroupControl EnableViewState="true" ID="ScreenGroupControl" ScreenGroupId="104"
                                                Visible="true" runat="server" />
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="row whiteboxpaddingleft">
                    <div class="himssuHeader5WireBox card card-box" id="Div1" runat="server" visible="false">
                        <div class="himsBoxHeader card-head">
                            <div class="leftdiv">
                            </div>
                            <div class="himsBoxTitle">
                                <div class="headerText fLeft">
                                    <header>
                                        <i class="fas fa-search"></i>
                                        <asp:Label ID="GridViewLabel" Text="Applicable PayType"
                                            runat="server" />
                                    </header>
                                </div>
                            </div>
                        </div>
                        <div class="himsBoxContent card-body" style="padding-top: 10px; padding-bottom: 10px">
                            <div class="himssuHeader6WireBox col-md-12">
                                <div id="GridViewMessageDiv" class="himsBoxContentMsg" runat="server"
                                    visible="False">
                                </div>
                                <div class="himsBoxHeader card-head inner" style="display: none">
                                    <div class="leftdiv">
                                    </div>
                                    <div class="himsBoxTitle">
                                        <%-- <div class="headerText fLeft">
                                            <header>
                                                List
                                            </header>
                                        </div>--%>
                                    </div>
                                </div>
                                <asp:GridView ID="ApplicablePayTypeGridView" runat="server" AutoGenerateColumns="False"
                                    EmptyDataText="No Records Found !!"
                                    AllowPaging="false" OnRowDataBound="ApplicableAttendanceTypeGridView_RowDataBound"
                                    ShowHeader="true"
                                    DataKeyNames="PayTypeId"
                                    CssClass="table table-striped table-bordered table-hover">
                                    <Columns>
                                        <asp:TemplateField HeaderStyle-HorizontalAlign="Center">
                                            <HeaderTemplate>
                                                <label class="rt-chkbox rt-chkbox-outline">
                                                    <asp:CheckBox ID="HeaderSelectCheckBox" runat="server" onclick="checkAllRows(this);" />
                                                    <span></span>
                                                </label>
                                            </HeaderTemplate>
                                            <ItemStyle HorizontalAlign="Center" />
                                            <ItemTemplate>
                                                <label class="rt-chkbox rt-chkbox-outline">
                                                    <asp:CheckBox ID="SelectCheckBox" runat="server" Checked='<%# Convert.ToBoolean(Eval("IsObsolete")) %>' onClick="checkUncheckHeaderCheckBox(this);" />
                                                    <span></span>
                                                </label>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField DataField="PayType" HeaderText="PayType" ItemStyle-Width="95%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                    </Columns>
                                    <PagerSettings Visible="False" />
                                </asp:GridView>
                            </div>
                        </div>
                    </div>
                    <%--HEDP History Ends Here--%>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%-- <script data-main="../../JavaScript/rjs/encrypt/applicable-attendancetype-encrypt" src="../../JavaScript/rjs/require.js"></script> --%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/applicable-attendancetype")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>
    <script type="text/javascript">

        function checkAllRows(obj) {
            var objGridview = obj.closest('table');
            var list = objGridview.getElementsByTagName("input");
            for (var i = 0; i < list.length; i++) {
                var objRow = list[i].parentNode.parentNode;
                if (list[i].type == "checkbox" && obj != list[i]) {
                    if (obj.checked) {
                        list[i].checked = true;
                    }
                    else {
                        list[i].checked = false;
                    }
                }
            }
        }
        function checkUncheckHeaderCheckBox(obj) {
            var objGridView = obj.closest('table');
            var list = objGridView.getElementsByTagName("input");
            for (var i = 0; i < list.length; i++) {
                var objHeaderChkBox = list[0];
                var checked = true;
                if (list[i].type == "checkbox" && list[i] != objHeaderChkBox) {
                    if (!list[i].checked) {
                        checked = false;
                        break;
                    }
                }
            }
            objHeaderChkBox.checked = checked;
        }

    </script>
</asp:Content>

