<%@ page title="" language="C#" masterpagefile="~/Pages/Common/MasterPages/MainMasterPage_new.master" autoeventwireup="true" inherits="Pages_FeeManagement_FeeRefundBulk, App_Web_sjrkubcy" 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" %>
<%@ Register Src="~/UserControls/DatePicker/DatePickerAutoPostBackControl.ascx" TagName="DatePickerControl" TagPrefix="Date" %>
<%@ Register Src="~/UserControls/DatePicker/DatePickerControl.ascx" TagName="DatePickerControl" TagPrefix="HIM" %>
<%@ Register Src="~/UserControls/Common/StudentSearch/StudentSearch.ascx" TagName="StudentSearch"
    TagPrefix="Std" %>
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <asp:UpdatePanel ID="IncidentLogUpdatePanel" runat="server" UpdateMode="Always">
        <ContentTemplate>
            <Std:StudentSearch ID="StudentSearch" Visible="false" runat="server" />
            <div id="divContentPage" class="divcontentpagemargin">
                <div class="dashBoardLeftCont">
                    <div class="himssuHeader3WireBox">
                        <table>
                            <ScreenGroup:ScreenGroupControl EnableViewState="true" ID="ScreenGroupControl" ScreenGroupId="104"
                                Visible="true" runat="server" />
                        </table>
                    </div>
                </div>
                <div class="whiteboxpaddingleft row">
                    <div class="himssuHeader5WireBox card card-box">
                        <div class="himsBoxHeader card-head">
                            <asp:Panel ID="Panel1" runat="server">
                                <div class="leftdiv">
                                </div>
                                <div class="himsBoxTitle">
                                    <div class="headerText">
                                        <header>
                                            <i class="fas fa-search"></i>
                                            <asp:Label ID="SearchLabel" runat="server" Text="Search"></asp:Label>
                                        </header>
                                    </div>
                                </div>
                            </asp:Panel>
                        </div>
                        <div class="himsBoxContent card-body">
                            <asp:Panel ID="SearchCriteriaPanel" runat="Server">
                                <div class="contentHolder">
                                    <asp:Panel ID="SearchPanel" runat="Server">
                                        <div class="contentHolder">
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="OrganizationGroupBatchLabel" runat="server" Text="Group Batch" SkinID="MandatoryLabel"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="OrganizationGroupBatchDropDownList" SkinID="CustomWidthDropDownList"
                                                        AutoPostBack="true" class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        OnSelectedIndexChanged="OrganizationGroupBatchDropDownList_OnSelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="OrganizationLabel" Text="Organization" runat="server" SkinID="MandatoryLabel"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList ID="OrganizationDropDownList" runat="server" onmouseleave="showHideTooltip()"
                                                        onmouseenter="showHideTooltip()" AutoPostBack="true" SkinID="CustomWidthDropDownList"
                                                        class="form-control" OnSelectedIndexChanged="OrganizationDropDownList_OnSelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="BatchLable" Text="Batch" runat="server" SkinID="MandatoryLabel"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList ID="BatchDropDownList" runat="server" onmouseleave="showHideTooltip()"
                                                        onmouseenter="showHideTooltip()" SkinID="CustomWidthDropDownList" class="form-control"
                                                        AutoPostBack="true" OnSelectedIndexChanged="BatchDropDownList_OnSelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>

                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="AdmissionCategoryLabel" runat="server" Text="Fees Category"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="AdmissionCategoryDropDownList" SkinID="CustomWidthDropDownList"
                                                        onmouseleave="showHideTooltip()" class="form-control" onmouseenter="showHideTooltip()">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div id="SUIdDiv" class="outerBox pTop5 col-md-3" runat="server" visible="false">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="SUIdLabel" runat="server" Text="SU Id"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="SUIdTextBox" runat="server" SkinID="CustomWidthTextBox" OnTextChanged="SUIdTextBox_TextChanged"
                                                        MaxLength="50" AutoPostBack="true"></asp:TextBox>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="IdNoLabel" runat="server" Text="ID No"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="IdNoTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        SkinID="CustomWidthTextBox" runat="server" MaxLength="200" AutoPostBack="true" OnTextChanged="IdNoTextBox_TextChanged">
                                                    </asp:TextBox>
                                                </div>
                                            </div>

                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="FirstNameLabel" runat="server" Text="First Name"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="FirstNameTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        SkinID="CustomWidthTextBox" runat="server" AutoPostBack="true" MaxLength="200" OnTextChanged="FirstNameTextBox_TextChanged"> </asp:TextBox>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="LastNameLabel" runat="server" Text="Last Name"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="LastNameTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        SkinID="CustomWidthTextBox" AutoPostBack="true" runat="server" MaxLength="200" OnTextChanged="LastNameTextBox_TextChanged"> </asp:TextBox>
                                                </div>
                                            </div>

                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="DepartmentLabel" runat="server" Text="Department"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="DepartmentDropDownList" SkinID="CustomWidthDropDownList"
                                                        AutoPostBack="true" onmouseleave="showHideTooltip()" class="form-control" onmouseenter="showHideTooltip()"
                                                        OnSelectedIndexChanged="DepartmentDropDownList_SelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="ClassLabel" runat="server" Text="Class" SkinID="MandatoryLabel"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="ClassDropDownList" SkinID="CustomWidthDropDownList"
                                                        class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        AutoPostBack="true" OnSelectedIndexChanged="ClassDropDownList_OnSelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="DivisionLabel" runat="server" Text="Division" SkinID="MandatoryLabel"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="DivisionDropDownList" SkinID="CustomWidthDropDownList" AutoPostBack="true"
                                                        class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()" OnSelectedIndexChanged="DivisionDropDownList_SelectedIndexChanged">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>

                                            <div class="outerBox pTop5 col-md-3" runat="server" visible="false">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="SourceTypeLabel" runat="server" Text="Source Type"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="SourceTypeDropDownList" SkinID="CustomWidthDropDownList"
                                                        class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                                        <asp:ListItem Text="- ALL -" Value="0" Selected="True"></asp:ListItem>
                                                        <asp:ListItem Text="Student" Value="2001"></asp:ListItem>
                                                        <asp:ListItem Text="Employee" Value="95"></asp:ListItem>
                                                    </asp:DropDownList>
                                                </div>
                                            </div>

                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="ReceiptBookLabel" runat="server" Text="Receipt Book" meta:resourcekey="ReceiptBookLabelResource1"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="ReceiptBookDropDownList" SkinID="CustomWidthDropDownList" OnTextChanged="ReceiptBookDropDownList_TextChanged"
                                                        class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()"
                                                        AutoPostBack="true">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="FromReceiptNoLabel" runat="server" Text="From Receipt No"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="FromReceiptNoTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()" OnTextChanged="FromReceiptNoTextBox_TextChanged"
                                                        SkinID="CustomWidthTextBox" runat="server" MaxLength="200" AutoPostBack="true"> </asp:TextBox>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="ToReceiptNoLabel" runat="server" Text="To Receipt No"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="ToReceiptNoTextBox" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()" OnTextChanged="ToReceiptNoTextBox_TextChanged"
                                                        SkinID="CustomWidthTextBox" runat="server" MaxLength="200" AutoPostBack="true"> </asp:TextBox>
                                                </div>
                                            </div>

                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="PayTypeLabel" runat="server" Text="Pay Type" meta:resourcekey="PayTypeLabelResource1"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:DropDownList runat="server" ID="PayTypeDropDownList" SkinID="CustomWidthDropDownList" OnSelectedIndexChanged="PayTypeDropDownList_SelectedIndexChanged"
                                                        class="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()" AutoPostBack="true">
                                                    </asp:DropDownList>
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="ChequeNoLabel" runat="server" Text="Cheque / Reference No"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <asp:TextBox ID="ChequeNoTextBox" SkinID="CustomWidthTextBox" runat="server" OnTextChanged="ChequeNoTextBox_TextChanged" AutoPostBack="true"
                                                        MaxLength="20">
                                                    </asp:TextBox>
                                                </div>
                                            </div>

                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="FromDateLabel" runat="server" Text="From Date" Visible="True"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <Date:DatePickerControl DisplayDatePicker="true" ID="FromDatePickerControl" Visible="True" OnTextChanged="FromDatePickerControl_TextChanged"
                                                        runat="server" onkeyup="FormatIt(this);" autopostback="true" onchange="isValidDatepicker(this);" placeholder="dd/mm/yyyy" />
                                                </div>
                                            </div>
                                            <div class="outerBox pTop5 col-md-3">
                                                <div class="controlLabelWidth">
                                                    <asp:Label ID="ToDateLabel" runat="server" Text="To Date" Visible="True"></asp:Label>
                                                </div>
                                                <div class="fLeft pRight5">
                                                    <Date:DatePickerControl DisplayDatePicker="True" ID="ToDatePickerControl" Visible="True" OnTextChanged="ToDatePickerControl_TextChanged"
                                                        runat="server" onkeyup="FormatIt(this);" autopostback="true" onchange="isValidDatepicker(this);" placeholder="dd/mm/yyyy" />
                                                </div>
                                            </div>
                                            <div class="outerBox pTop15 col-md-3">
                                                <asp:CheckBox ID="FeeWiseCheckBox" runat="server" AutoPostBack="true" OnCheckedChanged="FeeWiseCheckBox_CheckedChanged" />
                                                <asp:Label runat="server" AssociatedControlID="FeeWiseCheckBox" ID="FeewiseLabel">
                                                   Fee Wise
                                                </asp:Label>
                                            </div>

                                        </div>
                                    </asp:Panel>
                                    <div id="Div5" class="himssuHeader7WireBox col-md-12" runat="server">
                                        <div id="ReceiptDetailDiv" visible="false" runat="server">
                                            <div class="himsBoxHeader" id="Div2" runat="server" visible="false">
                                                <div class="himsBoxTitle">
                                                    <div class="pull-right col-md-6 display-flex">
                                                       
                                                    <asp:DropDownList ID="ApplyDropDownList" runat="server" SkinID="CustomWidthDropDownList" CssClass="form-control mt-10">
                                                        <asp:ListItem Text="- Select -" Value="-1" Selected="True"></asp:ListItem>
                                                        <asp:ListItem Text="Refund Date" Value="1"></asp:ListItem>
                                                        <asp:ListItem Text="Remark" Value="2"></asp:ListItem>
                                                        <asp:ListItem Text="Refund Amount" Value="3"></asp:ListItem>
                                                    </asp:DropDownList>
                                                        &nbsp;&nbsp;&nbsp;&nbsp;
                                                            <asp:TextBox ID="ApplyAllTextBox" runat="server" ClientIDMode="Static"
                                                                SkinID="CustomWidthTextBox" CssClass="pTop5"></asp:TextBox>&nbsp;&nbsp;&nbsp;&nbsp;
                                                              <asp:Button ID="ApplyButton" runat="server" Text="Apply All" OnClick="ApplyButton_Click" SkinID="0" CssClass="btn-apply btn fas" />
                                                    </div>
                                                    <div class="cBoth"></div>
                                                    <div class="gridHeaderText">
                                                        <asp:Label ID="GridHeaderLabel" Text="" runat="server" />
                                                    </div>
                                                    <div class="col-md-12 pTop5">
                                                        <div class="col-md-2">
                                                            <asp:Label ID="RecordsPerPage" Text="Records per Page : " runat="server" />
                                                        </div>
                                                        <div class="col-md-3">
                                                            <asp:DropDownList ID="AddRowsToGridDropDownList" SkinID="CustomWidthDropDownList" Width="60px" runat="server"
                                                                AutoPostBack="true" OnSelectedIndexChanged="AddRowsToGridDropDownList_SelectedIndexChanged" class="form-control">
                                                                <asp:ListItem Text="10" Value="10" Selected="True"></asp:ListItem>
                                                                <asp:ListItem Text="20" Value="20"></asp:ListItem>
                                                                <asp:ListItem Text="50" Value="50"></asp:ListItem>
                                                                <asp:ListItem Text="100" Value="100"></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </div>
                                                        <div class="col-md-7">
                                                            <uc1:GridViewPager ID="FeeReceiptListGridView_GridViewPager" runat="server" OnFirstRecordClick="FeeReceiptListGridView_GridViewPager_FirstRecordClick"
                                                                OnLastRecordClick="FeeReceiptListGridView_GridViewPager_LastRecordClick" OnNextRecordClick="FeeReceiptListGridView_GridViewPager_NextRecordClick"
                                                                OnPrevRecordClick="FeeReceiptListGridView_GridViewPager_PrevRecordClick" OnTextBoxValueChange="FeeReceiptListGridView_GridViewPager_TextBoxValueChange"
                                                                ParentGridView="FeeReceiptListGridView" />
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="himsBoxContent pTop5 width-100">
                                                <div id="Div3" runat="server" visible="true" class="table-responsive">
                                                    <div id="Div4" class="himsBoxContentMsg" runat="server" visible="False">
                                                    </div>
                                                    <asp:GridView ID="FeeReceiptListGridView" runat="server" AutoGenerateColumns="False"
                                                        EmptyDataText="No Records Found !!" AllowPaging="true" ShowHeader="true" DataKeyNames="ReceiptId,SourceId,ReceiptBookId,FeeSetupId,RefundId"
                                                        OnRowDataBound="FeeReceiptListGridView_RowDataBound" PageSize="10" OnPageIndexChanging="FeeReceiptListGridView_PageIndexChanging"
                                                        CssClass="table table-striped table-bordered table-hover">
                                                        <Columns>

                                                            <asp:TemplateField HeaderText="ID No" ItemStyle-Width="3%">
                                                                <ItemTemplate>
                                                                    <asp:Label ID="IDNoCodeLabel" runat="server" Text='<%#Eval("Code") %>'></asp:Label>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>

                                                            <asp:BoundField DataField="Name" HeaderText="Name" ItemStyle-Width="5%" HeaderStyle-HorizontalAlign="Left"></asp:BoundField>

                                                            <asp:BoundField DataField="ReceiptNumber" HeaderText="Receipt No" ItemStyle-Width="5%"
                                                                HeaderStyle-HorizontalAlign="Left"></asp:BoundField>
                                                           
                                                            <asp:TemplateField HeaderText="Receipt Amount">
                                                                <ItemTemplate>
                                                                    <asp:Label ID="ReceiptAmountLabel" runat="server" Text='<%#Eval("ReceiptAmount") %>'></asp:Label>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" />
                                                                <ItemStyle Width="5%" Wrap="True" />
                                                            </asp:TemplateField>

                                                            <asp:BoundField DataField="ReceiptBook" HeaderText="Receipt Book" ItemStyle-Width="4%"
                                                                HeaderStyle-HorizontalAlign="Left"></asp:BoundField>

                                                            <asp:TemplateField HeaderText="Pay Type">
                                                                <ItemTemplate>
                                                                    <asp:DropDownList runat="server" ID="PayTypeDropDownList" SkinID="CustomWidthDropDownList"
                                                                        onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()" class="form-control clsPayTypeDropDownList">
                                                                    </asp:DropDownList>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" />
                                                                <ItemStyle Width="12%" Wrap="True" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Cheque Number">
                                                                <ItemTemplate>
                                                                    <asp:TextBox ID="ChequeNumberTextBox" CssClass="clsChequeNumberTextBox" runat="server" MaxLength="20" Width="100%"></asp:TextBox>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" />
                                                                <ItemStyle Width="5%" Wrap="True" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Cheque Date">
                                                                <ItemTemplate>
                                                                    <HIM:DatePickerControl DisplayDatePicker="true" ID="ChequeDatePickerControl" Visible="True"
                                                                        runat="Server"></HIM:DatePickerControl>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" />
                                                                <ItemStyle Width="15%" Wrap="True" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Bank Name">
                                                                <ItemTemplate>
                                                                    <asp:TextBox ID="BankNameTextBox" runat="server" MaxLength="20" Width="100%" CssClass="clsBankNameTextBox"></asp:TextBox>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" />
                                                                <ItemStyle Width="8%" Wrap="True" />
                                                            </asp:TemplateField>

                                                            <asp:TemplateField HeaderText="Refund Date">
                                                                <ItemTemplate>
                                                                    <HIM:DatePickerControl DisplayDatePicker="true" ID="RefundDatePickerControl" Visible="True"
                                                                        runat="Server"></HIM:DatePickerControl>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" />
                                                                <ItemStyle Width="15%" Wrap="True" />
                                                            </asp:TemplateField>

                                                            <asp:TemplateField HeaderText="Remark">
                                                                <ItemTemplate>
                                                                    <asp:TextBox ID="RemarkTextBox" runat="server" SkinID="CustomWidthTextBox" Width="100%"
                                                                        MaxLength="200"></asp:TextBox>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" />
                                                                <ItemStyle Width="10%" Wrap="True" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Fee">
                                                                <ItemTemplate>
                                                                    <asp:Label ID="FeeLabel" runat="server" Text='<%#Eval("FeeName") %>'></asp:Label>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" />
                                                                <ItemStyle Width="5%" Wrap="True" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Fee Amount">
                                                                <ItemTemplate>
                                                                    <asp:Label ID="FeeAmountLabel" runat="server" Text='<%#Eval("FeeAmount") %>'></asp:Label>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" />
                                                                <ItemStyle Width="5%" Wrap="True" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField HeaderText="Refund Amount">
                                                                <ItemTemplate>
                                                                    <asp:TextBox ID="RefundTextBox" runat="server" SkinID="CustomWidthTextBox" Width="100%"
                                                                        MaxLength="200"></asp:TextBox>
                                                                </ItemTemplate>
                                                                <HeaderStyle HorizontalAlign="Left" />
                                                                <ItemStyle Width="8%" Wrap="True" />
                                                            </asp:TemplateField>
                                                            <asp:TemplateField ItemStyle-Wrap="true">
                                                                <HeaderTemplate>
                                                                    <label class="rt-chkbox rt-chkbox-outline">
                                                                        <asp:CheckBox ID="HeaderCheckBox" runat="server" onClick="checkAllRows(this);" Text="" />
                                                                        <span></span>
                                                                    </label>
                                                                </HeaderTemplate>
                                                                <ItemStyle HorizontalAlign="Center" />
                                                                <ItemTemplate>
                                                                    <label class="rt-chkbox rt-chkbox-outline">
                                                                        <asp:CheckBox ID="IsCheckBox" runat="server" onClick="checkUncheckHeaderCheckBox(this);" />
                                                                        <span></span>
                                                                    </label>
                                                                </ItemTemplate>
                                                            </asp:TemplateField>
                                                        </Columns>
                                                        <PagerSettings Visible="False" />
                                                    </asp:GridView>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="alignCenter col-md-12 pTop15 pb5">
                                        <asp:Button ID="SaveButton" runat="server" Text="Fee Refund Bulk" SkinID="0" OnClick="SaveButton_Click" CssClass="btn-save btn fas" />
                                    </div>
                                </div>
                            </asp:Panel>
                        </div>
                    </div>
                </div>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%--  <script data-main="../../JavaScript/rjs/encrypt/feereceipt-search-encrypt" src="../../JavaScript/rjs/require.js"></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/feereceipt-search")%>' 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;
        }
        function BindControlEvents() {
            $('.clsPayTypeDropDownList').change(function (e) {
                //debugger;

                if ($(this).find("option:selected").text().toLowerCase() == 'cash' || $(this).find("option:selected").text().toLowerCase() == '- select -') {
                    $(this).closest('tr').find(".clsChequeNumberTextBox").attr('disabled', 'disabled');
                    $(this).closest('tr').find(".inputBoxDisabled").attr('readonly', 'readonly');
                    //$(this).closest('tr').find(".iconpopup").attr('disabled', 'disabled');
                    $(this).closest('tr').find(".clsBankNameTextBox").attr('disabled', 'disabled');

                }
                else {
                    $(this).closest('tr').find(".clsChequeNumberTextBox").removeAttr("disabled");
                    $(this).closest('tr').find(".inputBoxDisabled").removeAttr("readonly");
                    //$(this).closest('tr').find(".iconpopup").removeAttr("disabled");
                    $(this).closest('tr').find(".clsBankNameTextBox").removeAttr('disabled', 'disabled');
                }
            });
        }
        function SetAll() {
            $("#<%=FeeReceiptListGridView.ClientID %> tr").each(function () {
                var CText = $(this).find("option:selected").text().toLowerCase();
                //if (CText == 'cheque') {
                //    $(this).closest('tr').find(".clsChequeNumberTextBox").attr('disabled', 'disabled');
                //    $(this).closest('tr').find(".inputBoxDisabled").attr('readonly', 'readonly');
                //    $(this).closest('tr').find(".iconpopup").attr('disabled', 'disabled');
                //    $(this).closest('tr').find(".clsBankNameTextBox").attr('disabled', 'disabled');
                //}
                //else {
                //    $(this).closest('tr').find(".clsChequeNumberTextBox").removeAttr("disabled");
                //    $(this).closest('tr').find(".inputBoxDisabled").removeAttr("readonly");
                //    $(this).closest('tr').find(".iconpopup").removeAttr("disabled");
                //    $(this).closest('tr').find(".clsBankNameTextBox").removeAttr('disabled', 'disabled');
                //}

                if (CText == 'cash') {
                    $(this).closest('tr').find(".clsChequeNumberTextBox").attr('disabled', 'disabled');
                    $(this).closest('tr').find(".inputBoxDisabled").attr('readonly', 'readonly');
                    //$(this).closest('tr').find(".iconpopup").attr('disabled', 'disabled');
                    $(this).closest('tr').find(".clsBankNameTextBox").attr('disabled', 'disabled');


                }
                else {

                    $(this).closest('tr').find(".clsChequeNumberTextBox").removeAttr("disabled");
                    $(this).closest('tr').find(".inputBoxDisabled").removeAttr("readonly");
                    //$(this).closest('tr').find(".iconpopup").removeAttr("disabled");
                    $(this).closest('tr').find(".clsBankNameTextBox").removeAttr('disabled', 'disabled');

                }
            });
        }
        $(document).ready(function () {
            SetAll();
            BindControlEvents();
        });

        //Re-bind for callbacks
        var prm = Sys.WebForms.PageRequestManager.getInstance();

        prm.add_endRequest(function () {
            SetAll();
            BindControlEvents();
        });

    </script>

</asp:Content>

