<%@ page title="" language="C#" masterpagefile="~/MasterFile/TimeCheck.master" autoeventwireup="true" inherits="Reports_TA_UI_Report_PayrollGridReport, App_Web_ezfgvue4" %>

<%@ Register Src="~/UserControls/TA_uc_OrganizationLevels.ascx" TagName="OrganizationLevel"
    TagPrefix="uc" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<%@ Register Assembly="DevExpress.Web.v14.2" Namespace="DevExpress.Web" TagPrefix="dxw" %>

<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPH" runat="Server">

    <script type="text/javascript" src="../bootstrap/js/1.4.3/jquery.min.js"></script>

    <script src="../bootstrap/js/1.8.5/jquery-ui.min.js" type="text/javascript"></script>

    <script type="text/javascript">

        $(function () {
        
            $("#<%= txtEmployeeId.ClientID %>").autocomplete({
                source: function (request, response) {
                    $.getJSON("../AutoCompleteByEmployeeId.ashx?EmpAutoid=" + '<%= Convert.ToString(Session["EmpAutoID"]) %>', {
                        term: extractLast(request.term)
                    }, response);
                },
                search: function () {
                    // custom minLength
                    var term = extractLast(this.value);
                    if (term.length < 1) {
                        return false;
                    }
                },
                focus: function () {
                    // prevent value inserted on focus
                    return false;
                },
                select: function (event, ui) {

                    var terms = split(this.value);
                    // remove the current input
                    terms.pop();
                    // add the selected item
                    terms.push(ui.item.value);
                    // add placeholder to get the comma-and-space at the end
                    terms.push("");
                    this.value = terms.join(",");
                    return false;
                }
            });

            function split(val) {
                return val.split(/,\s*/);
            }

            function extractLast(term) {
                return split(term).pop();
            }
        });

            $(function () {

                $("#<%= txtEmployeeName.ClientID %>").autocomplete({
                    source: function (request, response) {
                        $.getJSON("../AutoCompleteByName.ashx?EmpAutoid=" + '<%= Convert.ToString(Session["EmpAutoID"]) %>', {
                            term: extractLast(request.term)
                        }, response);
                    },
                    search: function () {
                        // custom minLength
                        var term = extractLast(this.value);
                        if (term.length < 1) {
                            return false;
                        }
                    },
                    focus: function () {
                        // prevent value inserted on focus
                        return false;
                    },
                    select: function (event, ui) {

                        var terms = split(this.value);
                        // remove the current input
                        terms.pop();
                        // add the selected item
                        terms.push(ui.item.value);
                        // add placeholder to get the comma-and-space at the end
                        terms.push("");
                        this.value = terms.join(",");
                        return false;
                    }
                });
                function split(val) {
                    return val.split(/,\s*/);
                }
                function extractLast(term) {
                    return split(term).pop();
                }
            });
                window.onload = function () {
                    PageOnloadDate();
                };

    </script>

    <script>
        function OnlyNumberValuewithzero(e) {
            debugger;
            var charCode;
            if (e.keyCode > 0) {
                charCode = e.which || e.keyCode;
            }
            else if (typeof (e.charCode) != "undefined") {
                charCode = e.which || e.keyCode;
            }
            if (charCode > 31 && (charCode < 48 || charCode > 57)) {
                return false;
            }

            else {

                if (e.keyCode > 0)
                {
                    Alert('welcome');
                }

                return true;

            }
        }

        function LoanValidate()
        {
            debugger;
            var txtCount = document.getElementById("ctl00_BodyContentPH_lbl_NofLoan").value;
            var txtLoanAmount = document.getElementById("ctl00_BodyContentPH_txtLoanDueAmount").value;
            if (txtCount == "" && txtLoanAmount!="")
            {
                alert("Loan Cannot available");
            }
            
        }

        function ChangedValue()
        {
            debugger;
            var txtLoanAmount = document.getElementById("ctl00_BodyContentPH_txtLoanDueAmount").value;
            if (txtLoanAmount!="")
            {

            }
            return true;
        }

    </script>


    <script src="../plugins/datepicker/jquery-1.11.1.min.js"></script>

    <script language="javascript" src="../js/jquery.autocomplete.js" type="text/javascript"></script>

    <script src="../plugins/datepicker/bootstrap-datepicker.js"></script>

    <script>

        $(function () {
            $('#ctl00_BodyContentPH_txtFromDate').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value }
            );
        });
        $(function () {
            $('#ctl00_BodyContentPH_txtToDate').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value }
            );
        });

    </script>

    <div class="content-header" id="conHeader" runat="server">
        <h1 style="background-image: url(../dist/img/swipe-icon.png); background-repeat: no-repeat; padding-left: 35px">
            <asp:Label ID="lblPayrollGridReport" runat="server"></asp:Label>
        </h1>
        <asp:SiteMapPath ID="site" runat="server" CssClass="breadcrumb">
            <NodeStyle CssClass="active" />
        </asp:SiteMapPath>
    </div>
    <div class="content">
        <div class="inr-ftr">
            <div class="row">
                <div class="col-sm-2">
                    <div class="inr-fil-text">
                        <asp:Label ID="lblFilter" runat="server" Text="Filters"></asp:Label>
                        <asp:Label ID="Label1" runat="server" Visible="false"></asp:Label>
                        <input id="Hidden3" type="hidden" value='<% Response.Write(Convert.ToString(Session["IDateFormat"])); %>' />
                    </div>
                </div>
                <div class="clearfix">
                </div>
            </div>
        </div>
        <div id="collapseOne">
            <div class="emp-filter">
                <div class="form-horizontal">
                    <asp:HiddenField ID="hdnReportFilters" runat="server" />
                    <div id="divEmployeeDetails" runat="server">
                        <div class="row  form-group">
                            <div class="col-md-2">
                                <asp:Label ID="lblEmployeeName" runat="server"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox onpaste="return true" ID="txtEmployeeName" runat="server" CssClass="form-control"
                                    Style="resize: none;" TextMode="multiLine"></asp:TextBox>
                            </div>
                            <div class="col-md-1">
                            </div>
                            <div class="col-md-2">
                                <asp:Label ID="lblEmployeeId" runat="server"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox onpaste="return true" ID="txtEmployeeId" runat="server" CssClass="form-control"
                                    Style="resize: none;" TextMode="multiLine">
                                </asp:TextBox>
                            </div>
                        </div>
                        <div class="row  form-group">
                            <div class="col-md-2">
                                <asp:Label ID="lblEmpCategory" runat="server"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:DropDownList ID="ddlEmpCatagory" runat="server" CssClass="form-control select2"
                                    AppendDataBoundItems="true">
                                    <asp:ListItem Value="0" Selected="True" Text="-Select-"></asp:ListItem>
                                </asp:DropDownList>
                            </div>
                            <div class="col-md-1">
                            </div>
                            <div class="col-md-2">
                                <asp:Label ID="lblEmpType" runat="server"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:DropDownList ID="ddlEmpType" runat="server" CssClass="form-control select2"
                                    AppendDataBoundItems="true">
                                    <asp:ListItem Value="0" Selected="True" Text="-Select-"></asp:ListItem>
                                </asp:DropDownList>
                            </div>
                        </div>
                        <div class="row  form-group">
                            <div class="col-md-2">
                                <asp:Label ID="lblDesignation" runat="server" Text="Designation"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:DropDownList ID="ddlDesignation" runat="server" CssClass="form-control select2"
                                    AppendDataBoundItems="true">
                                    <asp:ListItem Value="0" Selected="True" Text="All"></asp:ListItem>
                                </asp:DropDownList>
                            </div>
                            <div class="col-md-1">
                            </div>
                            <div class="col-md-2">
                                <asp:Label ID="lblGender" runat="server" Text="Gender"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:DropDownList ID="ddlGender" runat="server" CssClass="form-control select2">
                                    <asp:ListItem Value="Both" Text="Both"></asp:ListItem>
                                    <asp:ListItem Value="Male" Text="Male"></asp:ListItem>
                                    <asp:ListItem Value="Female" Text="Female"></asp:ListItem>
                                </asp:DropDownList>
                            </div>
                        </div>
                    </div>

                    <div id="divdateTime" runat="server">
                        <div class="clearfix">
                        </div>
                        <div class="row">
                            <div class="row">
                                <div class="line16">
                                </div>
                            </div>
                        </div>
                        <div class="row form-group">
                            <div class="col-md-2">
                                <asp:Label ID="lblDateFilter" runat="server" Text="Date Filter"></asp:Label>
                            </div>
                            <div class="Pad-left-7px">
                                <div class="col-md-2 Session-padLeftrtp">
                                    <asp:RadioButton ID="rbCustom" runat="server" Text="Custom" CssClass="radioLeave radioLeave-primary"
                                        GroupName="rpt" onchange="ajaxGetDate(3);" Checked="true" />
                                </div>


                                <div class="col-md-2">
                                    <asp:RadioButton ID="rbpreviousMonth" runat="server" Text="Previous Month" CssClass="radioLeave radioLeave-primary"
                                        GroupName="rpt" onchange="ajaxGetDate(5);" />
                                </div>
                                <div class="col-md-2">
                                    <asp:RadioButton ID="rbThisMonth" runat="server" Text="This Month" CssClass="radioLeave radioLeave-primary"
                                        GroupName="rpt" onchange="ajaxGetDate(4);" />
                                </div>
                            </div>
                        </div>
                        <div class="row form-group">
                            <div class="col-md-2">
                                <asp:Label ID="lblTimePeriod" runat="server"></asp:Label>
                                -
                                <asp:Label ID="lblFrom" runat="server"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox onpaste="return true" ID="txtFromDate" runat="server" CssClass="form-control"
                                    oncut="return false" ondrop="return false" MaxLength="11"></asp:TextBox>
                                <asp:CustomValidator ID="cus_FromDate" runat="server" Display="None" EnableClientScript="False"
                                    ErrorMessage="Select valid From Date" OnServerValidate="ValidateFromDate"></asp:CustomValidator>
                                <asp:RequiredFieldValidator ID="reqFromDate" runat="server" ControlToValidate="txtFromDate"
                                    Display="None" EnableClientScript="False" ErrorMessage="Please select FromDate"></asp:RequiredFieldValidator>
                            </div>
                            <div class="col-md-1">
                            </div>
                            <div class="col-md-2">
                                <asp:Label ID="lblTo" runat="server"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox onpaste="return true" ID="txtToDate" runat="server" CssClass="form-control"
                                    oncut="return false" ondrop="return false" MaxLength="11"></asp:TextBox>
                                <asp:CustomValidator ID="cus_ToDate" runat="server" Display="None" EnableClientScript="False"
                                    ErrorMessage="Select valid To Date" OnServerValidate="ValidateToDate"></asp:CustomValidator>
                                <asp:CustomValidator ID="cus_ComToDate" runat="server" Display="None" EnableClientScript="False"
                                    ErrorMessage="Select valid date compare with Fromdate" OnServerValidate="CompareDate"></asp:CustomValidator>
                                <asp:RequiredFieldValidator ID="reqToDate" runat="server" ControlToValidate="txtToDate"
                                    Display="None" EnableClientScript="False" ErrorMessage="Please select ToDate"></asp:RequiredFieldValidator>
                            </div>
                        </div>
                    </div>

                    <div class="clearfix">
                    </div>
                    <div class="row">
                        <div class="row">
                            <div class="line16">
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12">
                            <asp:UpdatePanel ID="upOrgLevel" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <asp:PlaceHolder ID="PlaceHolderMonthlyAttendance" runat="server">
                                        <uc:OrganizationLevel ID="ucOrganizationLevel" runat="server" />
                                    </asp:PlaceHolder>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </div>
                    </div>

                    <div class="row" style="padding-top: 10px" id="trView" runat="server">

                        <div class="col-md-5">
                        </div>
                        <div class="col-md-6">
                            <div class="pull-right-button">
                                <asp:HiddenField ID="Hidden1" runat="server" />
                                 <asp:LinkButton ID="lnkbtnGrid" Text="&nbsp;&nbsp;Grid Report" CssClass="btn save-btn fa-eye" runat="server" OnClick="lnkbtnGrid_Click"
                                    OnClientClick="return DateEntryValidation()" />
                                <asp:LinkButton ID="btn_View" CssClass="btn save-btn fa-eye" runat="server" OnClick="btn_View_Click"
                                    OnClientClick="return DateEntryValidation()" />
                              <%--  <asp:LinkButton ID="btn_Export" CssClass="btn save-btn fa-file-excel-o" runat="server"
                                    OnClick="btn_Export_Click" OnClientClick="return DateEntryValidation()" />--%>
                                <asp:ValidationSummary ID="ValidationSummary1" ShowMessageBox="false" ShowSummary="false"
                                    runat="server" />
                            </div>
                        </div>
                    </div>
                     <div class="row">
                        <div class="row">
                            <div class="line16">
                            </div>
                        </div>
                    </div>
                     <div class="row form-group">
                        <div class="col-md-12" style="overflow:auto; width:100%;">
                            <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>

                                    <%--<asp:GridView ID="gdManualEntrySanctionView" runat="server" AutoGenerateColumns="False"
                                    CellPadding="5" CssClass="table das-table1" Width="100%" PageSize="10" AllowPaging="True"
                                    OnRowDataBound="gdManualEntrySanctionView_RowDataBound" OnPageIndexChanging="gdManualEntrySanctionView_PageIndexChanging"
                                    HeaderStyle-HorizontalAlign="center">
                                    <Columns>

                                        <RowStyle Height="30px" CssClass="table-bg" BorderColor="#C5DFFC" />
                                    <PagerStyle Font-Size="Medium" Font-Overline="False" HorizontalAlign="Right"/>
                                        </asp:GridView>--%>


                                     <asp:GridView CssClass="table das-table1" ID="gvData" Width="100%"  runat="server" 
                                                    AllowPaging="True" AutoGenerateColumns="False" PageSize="5" 
                                                       OnPageIndexChanging="gvData_PageIndexChanging"
                                                     Visible="true" ShowHeaderWhenEmpty="true" OnRowCommand="gvData_RowCommand" >


                                                    <Columns>

                                                           <asp:TemplateField HeaderText="Employee Id" HeaderStyle-CssClass="empheader" >
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_EmpId" Text='<%# Eval("Employee_Code_Id") %>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 100px;" 
                                                                    CssClass="pull-left-button"></asp:Label>
                                                            </ItemTemplate>
                                                          
                                                        </asp:TemplateField>

                                                           <asp:TemplateField HeaderText="Employee Name" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_Name" Text='<%# Eval("EmployeeName")%>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 150px;" CssClass="pull-left-button"></asp:Label>
                                                            </ItemTemplate>
                                                          
                                                        </asp:TemplateField>
                                                 
                                                           <asp:TemplateField HeaderText="Designation" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_Designation" Text='<%# Eval("Designation")%>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 120px;" CssClass="pull-left-button"></asp:Label>
                                                            </ItemTemplate>
                                                         
                                                           
                                                        </asp:TemplateField>

                                                           <asp:TemplateField HeaderText="Gender" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_gender" Text='<%# Eval("Gender")%>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 100px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                            
                                                        </asp:TemplateField>

                                                           <asp:TemplateField HeaderText="Calendar Days" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_CalenderDays" Text='<%# Eval("Calender_Days") %>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                          
                                                        </asp:TemplateField>

                                                           <asp:TemplateField HeaderText="Present Days" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_PresentDays" Text='<%# Eval("Present_Days")%>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                          
                                                        </asp:TemplateField>
                                                 
                                                           <asp:TemplateField HeaderText="Absent Days" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_AbsentDays" Text='<%# Eval("Absent_Days")%>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                         
                                                           
                                                        </asp:TemplateField>

                                                           <asp:TemplateField HeaderText="Leaves" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_Leave" Text='<%# Eval("Leave_Days")%>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                            
                                                        </asp:TemplateField>

                                                           <asp:TemplateField HeaderText="Weekly OFF" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_WeeklyOff" Text='<%# Eval("Weekly_OFF_Days") %>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                          
                                                        </asp:TemplateField>

                                                           <asp:TemplateField HeaderText="Holidays" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_Holidays" Text='<%# Eval("Holiday_Days")%>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                          
                                                        </asp:TemplateField>
                                                 
                                                           <asp:TemplateField HeaderText="Loss of Pay" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_BufferType" Text='<%# Eval("LossofPay_Days")%>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                         
                                                           
                                                        </asp:TemplateField>

                                                           <asp:TemplateField HeaderText="Total OT Hours" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_TotalOT" Text='<%# Eval("TotalOTHrs")%>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                            
                                                        </asp:TemplateField>

                                                           <asp:TemplateField HeaderText="Employee CTC" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_CTC" Text='<%# Eval("CostToCompany") %>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                          
                                                        </asp:TemplateField>

                                                           <asp:TemplateField HeaderText="Basic Salary" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_basicSalary" Text='<%# Eval("BasicSalary")%>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                          
                                                        </asp:TemplateField>
                                                 
                                                           <asp:TemplateField HeaderText="Dearness Allowance" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_DA" Text='<%# Eval("Dearness_Allowance")%>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                         
                                                           
                                                        </asp:TemplateField>

                                                           <asp:TemplateField HeaderText="Conveyance Allowance" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_CA" Text='<%# Eval("Conveyance_Allowance")%>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                            
                                                        </asp:TemplateField>

                                                           <asp:TemplateField HeaderText="HRA" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_Hra" Text='<%# Eval("HouseRent_Allowance") %>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                          
                                                        </asp:TemplateField>

                                                           <asp:TemplateField HeaderText="Medical Allowance" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_MA" Text='<%# Eval("Medical_Allowance")%>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                          
                                                        </asp:TemplateField>
                                                 
                                                           <asp:TemplateField HeaderText="CEA" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_CEA" Text='<%# Eval("Children_Education_Allowance")%>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                         
                                                           
                                                        </asp:TemplateField>

                                                           <asp:TemplateField HeaderText="Other Allowance" HeaderStyle-CssClass="empheader ">
                                                            <ItemTemplate>
                                                                <asp:TextBox ID="txtOtherAllowance" runat="server" CssClass="form-control ui-autocomplete-input" Width="80"
                                                                    onkeypress="return OnlyNumberValuewithzero(event,this);" Text='<%# Eval("OA") %>' 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"
                                                                     OnTextChanged="txtOtherAllowance_TextChanged" AutoPostBack="true"></asp:TextBox>

                                                                </ItemTemplate>
                                                   
                                                        </asp:TemplateField>

                                                           <asp:TemplateField HeaderText="Total Addition" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_TotalAddition" Text='<%# Eval("TotalAdditions") %>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                          
                                                        </asp:TemplateField>

                                                           <asp:TemplateField HeaderText="Provident Fund" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_PF" Text='<%# Eval("ProvidentFund")%>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                          
                                                        </asp:TemplateField>
                                                 
                                                        <asp:TemplateField HeaderText="ESI" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_ESI" Text='<%# Eval("ESI")%>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>

                                                        </asp:TemplateField>

                                                        <asp:TemplateField HeaderText="No.Of Loan" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_NofLoan" Text='<%# Eval("LoanCount")%>' runat="server" onblur="return LoanValidate();" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 80px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>

                                                        </asp:TemplateField>

                                                        <asp:TemplateField HeaderText="Loan Amount" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                 <asp:TextBox ID="txtLoanDueAmount" runat="server" CssClass="form-control ui-autocomplete-input" 
                                                                    onkeypress="return OnlyNumberValuewithzero(event,this);" Text='<%# Eval("LoanDueAmount") %>' 
                                                                      Style="word-wrap: break-word; display: inline-block; width: 80px; text-align: center;"
                                                                      OnTextChanged="txtOtherAllowance_TextChanged" AutoPostBack="true"></asp:TextBox>
                                                               
                                                            </ItemTemplate>

                                                        </asp:TemplateField>


                                                        <asp:TemplateField HeaderText="TDS Amount" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_TdsAmount" Text='<%# Eval("TDSAmount")%>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                            
                                                        </asp:TemplateField>
                                                                                                        
                                                        <asp:TemplateField HeaderText="Professional Tax" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_ProfTax" Text='<%# Eval("Professional_Tax")%>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                            
                                                        </asp:TemplateField>

                                                        <asp:TemplateField HeaderText="Total Deduction" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_Totaldeduction" Text='<%# Eval("TotalDeduction")%>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                            
                                                        </asp:TemplateField>

                                                        <asp:TemplateField HeaderText="Net Salary" HeaderStyle-CssClass="empheader">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lbl_Netsalary" Text='<%# Eval("NetSalary")%>' runat="server" 
                                                                    Style="word-wrap: break-word; display: inline-block; width: 70px; text-align: center;"></asp:Label>
                                                            </ItemTemplate>
                                                            
                                                        </asp:TemplateField>

                                                       
                                                    </Columns>
                                                    

                                                    <EmptyDataTemplate>No Record Available</EmptyDataTemplate>
                                                    <EmptyDataRowStyle Width="450px" HorizontalAlign="Center"/>
                                                    <RowStyle Height="30px" CssClass="table-bg" BorderColor="#C5DFFC" />
                                                    <PagerStyle Font-Size="Medium" Font-Overline="False" HorizontalAlign="Right"/>
                                                    <%--<PagerStyle Font-Overline="False" HorizontalAlign="Right" CssClass="GridPager" />--%>
                                                    <PagerSettings FirstPageText="<<" LastPageText=">>" Mode="NumericFirstLast" NextPageText=">"
                                                        PreviousPageText="<" />
                                                    <AlternatingRowStyle BackColor="white" />
                                                </asp:GridView>

                                 <%--   <dxw:ASPxGridView ID="gvData" Visible="false" SettingsBehavior-AllowSort="false" ClientInstanceName="gvData" runat="server"
                                        AutoGenerateColumns="false" Width="100%" Settings-HorizontalScrollBarMode="Auto"  >
                                        <Settings ShowColumnHeaders="True"  />
                                        <Columns>
                                            <dxw:GridViewDataTextColumn Width="90px" FieldName="Employee_Code_Id" Caption="Employee ID" VisibleIndex="0">
                                                <DataItemTemplate>
                                                        
                                                    <asp:Label ID="lblEID" Text='<%# Eval("Employee_Code_Id") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>

                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn FieldName="Name" VisibleIndex="1" Width="150px">
                                                <DataItemTemplate>
                                                    <asp:Label ID="lblName" Text='<%# Eval("Name") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="True" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="2" FieldName="Designation" Width="150px" >
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay1" Text='<%# Eval("Designation") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="3" FieldName="Gender" Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay2" Text='<%# Eval("Gender") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="4" FieldName="Calender Days" Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay3" Text='<%# Eval("Calender_Days") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="5" FieldName="Present Days" Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay4" Text='<%# Eval("Present_Days") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="6" FieldName="Absent Days" Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay5" Text='<%# Eval("Absent_Days") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="7" FieldName="Leave" Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay6" Text='<%# Eval("Leave_Days") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="8" FieldName="Weekly Off" Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay7" Text='<%# Eval("Weekly_OFF_Days") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="9" FieldName="Holidays" Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay8" Text='<%# Eval("Holiday_Days") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="10" FieldName="Loss of Pay" Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay9" Text='<%# Eval("LossofPay_Days") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="11" FieldName="Total OT Hours" Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay10" Text='<%# Eval("TotalOTHrs") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="12" FieldName="CTC" Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay11" Text='<%# Eval("CostToCompany") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="13" FieldName="BasicSalary" Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay12" Text='<%# Eval("BasicSalary") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="14" FieldName="Dearness Allowance " Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay13" Text='<%# Eval("Dearness_Allowance") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="15" FieldName="Conveyance Allowance" Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay14" Text='<%# Eval("Conveyance_Allowance") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="16" FieldName="HRA Allowance" Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay15" Text='<%# Eval("HouseRent_Allowance") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="17" FieldName="Medical Allowance" Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay16" Text='<%# Eval("Medical_Allowance") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="18" FieldName="Children Education Allowance" Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay17" Text='<%# Eval("Children_Education_Allowance") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="19" FieldName="Other Allowance" Width="80">
                                                <DataItemTemplate>
                                                    <asp:TextBox ID="txtOtherAllowance" runat="server" Text='<%# Eval("OA") %>' CssClass="form-control ui-autocomplete-input" Width="80" OnTextChanged="txtOtherAllowance_TextChanged" ></asp:TextBox>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="20" FieldName="Total Addition" Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay17" Text='<%# Eval("TotalAdditions") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                  
                                                    <asp:HiddenField  ID="hdnAddition" runat="server" />
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>


                                            <dxw:GridViewDataTextColumn VisibleIndex="20" FieldName="Provident Fund" Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay19" Text='<%# Eval("ProvidentFund") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="21" FieldName="Education State Insurance" Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay20" Text='<%# Eval("ESI") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="22" FieldName="Tax Deduction Amount" Width="80">
                                                <DataItemTemplate>

                                                    <asp:Label ID="AFDay21" Text='<%# Eval("TDSAmount") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                            </dxw:GridViewDataTextColumn>
                                            <dxw:GridViewDataTextColumn VisibleIndex="23" FieldName="Professional Tax" Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay22" Text='<%# Eval("Professional_Tax") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true"/>
                                            </dxw:GridViewDataTextColumn>

                                             <dxw:GridViewDataTextColumn VisibleIndex="23" FieldName="Number Of Loan" Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay22" Text='<%# Eval("LoanCount") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true"/>
                                            </dxw:GridViewDataTextColumn>

                                             <dxw:GridViewDataTextColumn VisibleIndex="23" FieldName="LoanDueAmount" Width="100">
                                                <DataItemTemplate>
                                                      <asp:TextBox ID="txtLoanAmount" runat="server" Text='<%# Eval("LoanDueAmount") %>' onblur="return ChangedValue();" CssClass="form-control ui-autocomplete-input" Width="100" OnTextChanged="txtOtherAllowance_TextChanged" ></asp:TextBox>
                                                    <%--<asp:Label ID="AFDay22" Text='<%# Eval("LoanDueAmount") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true"/>
                                            </dxw:GridViewDataTextColumn>

                                             <dxw:GridViewDataTextColumn VisibleIndex="23" FieldName="Total Deduction " Width="80">
                                                <DataItemTemplate>
                                                    <asp:Label ID="AFDay22" Text='<%# Eval("TotalDeduction") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true"/>
                                            </dxw:GridViewDataTextColumn>

                                            <dxw:GridViewDataTextColumn VisibleIndex="23" FieldName="Net Salary" Width="80">
                                                <DataItemTemplate>

                                                    <asp:Label ID="AFDay22" Text='<%# Eval("NetSalary") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; word-wrap: break-word; display: inline-block;"></asp:Label>
                                                    <asp:HiddenField  ID="hdnDeduction" runat="server"/>

                                                </DataItemTemplate>
                                                <HeaderStyle HorizontalAlign="center" Wrap="true"/>
                                            </dxw:GridViewDataTextColumn>


                                        </Columns>
                                        <ClientSideEvents CustomizationWindowCloseUp="function(s, e) { UpdateCustomizationWindowValue(); }" />
                                        <SettingsPager PageSize="30">
                                            <PageSizeItemSettings Visible="true" ShowAllItem="true" Items="100,200,500,1000,2000" />
                                        </SettingsPager>
                                        <Settings ShowFilterRow="true" ShowFilterRowMenu="true" HorizontalScrollBarMode="Auto" ShowGroupPanel="true" VerticalScrollBarMode="Hidden" VerticalScrollableHeight="400" ShowTitlePanel="true" />
                                        <SettingsText EmptyDataRow="No Records Found" />
                                        <SettingsSearchPanel Visible="true" HighlightResults="true" ShowApplyButton="true" ShowClearButton="true" />
                                        <SettingsCustomizationWindow Enabled="True" />
                                        <SettingsBehavior AutoExpandAllGroups="True" ColumnResizeMode="Control" />
                                        <SettingsBehavior AllowDragDrop="true" />
                                    </dxw:ASPxGridView>
                                    <dxw:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="gvData">
                                        <PageFooter Right="[Page # of Pages #]">
                                        </PageFooter>
                                    </dxw:ASPxGridViewExporter>--%>

                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </div>
                    </div>
                    <div class="row" id="trSave" runat="server">
                        <div class="col-md-5">
                        </div>
                        <div class="col-md-6">
                            <div class="pull-right-button">
                                <asp:LinkButton ID="btnSave" Text="Save" CssClass="btn save-btn  fa-floppy-o" runat="server"
                                    OnClick="btnSave_Click" />
                                <asp:LinkButton ID="btnBack" Text="Back" CssClass="btn del-btn fa-close" runat="server"
                                    OnClick="btnBack_Click" />
                                <asp:ValidationSummary ID="ValidationSummary2" ShowMessageBox="false" ShowSummary="false"
                                    runat="server" />
                            </div>
                        </div>
                    </div>
                   
                </div>

            </div>
        </div>
    </div>

    <script src="../plugins/datepicker/jquery-1.11.1.min.js"></script>
    <script src="../js/jquery.autocomplete.js" type="text/javascript"></script>
    <script src="../plugins/datepicker/bootstrap-datepicker.js"></script>
    <script type="text/javascript" src="../bootstrap/js/1.4.3/jquery.min.js"></script>
    <script src="../bootstrap/js/1.8.5/jquery-ui.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        function UpdateCustomizationWindowValue() {
            var element = document.getElementById("btnCustWindow");
            if (element == null) return;
            element.value = (gvData.IsCustomizationWindowVisible() ? "Hide" : "Show") + " Customization Window";
        }
        function ShowHideCustomizationWindow() {
            if (gvData.IsCustomizationWindowVisible())
                gvData.HideCustomizationWindow();
            else gvData.ShowCustomizationWindow();
            UpdateCustomizationWindowValue();
        }


    </script>

    <script language="javascript" type="text/javascript">
        //values for check date
        var Monthfourdigit = 'Please enter valid date as month, day, and four digit year : Format MM/dd/yyyy.';
        //Adding this line var Datefourdigit='Please enter valid date with correct format dd/MM/yyyy'; as newly
        var Datefourdigit = 'Please enter valid date with correct format dd/MM/yyyy';
        var Invalidyearentry = 'Invalid year entry';
        var Invalidmonthentry = 'Invalid month entry';
        var Invaliddateentry = 'Invalid date entry';
        var DateformatDDMONYYYY = 'Incorrect date format. Enter as DD-MON-YYYY';
        var Entertime = 'Enter time';
        var Valueforhours = 'Invalid value for hours:';
        var Invalidvalueforminutes = 'Invalid value for minutes:';
        var Invalidtimeformat = 'Invalid time format:';
        var EntervalidDateandTime = 'Please enter valid Date and Time';
        var ValiddatemonthMMDDYYHHMM = 'Please enter valid Date and Time MM/dd/yyyy HH:mm';
        var ValiddatemonthMMDDYYHHMMTT = 'Please enter valid Date and Time MM/dd/yyyy hh:mm tt';
        var EntervalidDateandTime = 'Please enter valid Date and Time';
        var Invalidvalueforhours = 'Invalid value for hours:';
        var Invalidvalueforminites = 'Invalid value for minutes:';
        var MaxLength = "Maximum length is ";

        $(document).ready(function () {
            $("#<%=txtEmployeeId.ClientID%>").autocomplete('../AutoCompleteByEmployeeId.ashx?EmpAutoid=' + '<%= Convert.ToString(Session["EmpAutoID"]) %>', {
                multiple: true,
                multipleSeparator: ",",
                width: 180,
                highlight: false,
                scroll: true,
                scrollHeight: 300,
                delay: 10
            });
        });
        $(document).ready(function () {
            $("#<%=txtEmployeeName.ClientID%>").autocomplete('../AutoCompleteByName.ashx?EmpAutoid=' + '<%= Convert.ToString(Session["EmpAutoID"]) %>', {
                multiple: true,
                multipleSeparator: " ,",
                width: 200,
                highlight: false,
                scroll: true,
                scrollHeight: 300,
                delay: 10
            });
        });


        function MaxLengthh(maxLength) {
            MaxLength = maxLength;
        }
        function SetAlertCheckDate(monthfourdigit, datefourdigit, invalidyearentry, invalidmonthentry, invaliddateentry, dateformatDDMONYYYY, entertime, valueforhours, invalidvalueforminutes, invalidtimeformat, entervalidDateandTime, validdatemonthMMDDYYHHMM, validdatemonthMMDDYYHHMMTT, entervalidDateandTime, invalidvalueforhours, invalidvalueforminites) {
            Monthfourdigit = monthfourdigit;
            Datefourdigit = datefourdigit;
            Invalidyearentry = invalidyearentry;
            Invalidmonthentry = invalidmonthentry;
            Invaliddateentry = invaliddateentry;
            DateformatDDMONYYYY = dateformatDDMONYYYY;
            Entertime = Entertime;
            Valueforhours = valueforhours;
            Invalidvalueforminutes = invalidvalueforminutes;
            Invalidtimeformat = invalidtimeformat;
            EntervalidDateandTime = entervalidDateandTime;
            ValiddatemonthMMDDYYHHMM = validdatemonthMMDDYYHHMM;
            ValiddatemonthMMDDYYHHMMTT = validdatemonthMMDDYYHHMMTT;
            EntervalidDateandTime = entervalidDateandTime;
            Invalidvalueforhours = invalidvalueforhours;
            Invalidvalueforminites = invalidvalueforminites;
        }
        var FromDate = "Enter Valid From Date";
        var ToDate = "Enter Valid To Date";
        function SetAlertMessages(fromdate, enterToDate) {
            FromDate = fromdate;
            ToDate = enterToDate;
        }
        function DateEntryValidation() {
            var rangeDemoFormat = document.getElementById('ctl00_BodyContentPH_Hidden1').value;

            if (document.aspnetForm.ctl00_BodyContentPH_txtFromDate.value != '') {
                var weekDay = document.aspnetForm.ctl00_BodyContentPH_txtFromDate;
                var DateFormat = document.getElementById('ctl00_BodyContentPH_Hidden1').value;
                if (checkDate(weekDay, DateFormat, Monthfourdigit, Datefourdigit, Invalidyearentry, Invalidmonthentry, Invaliddateentry, DateformatDDMONYYYY, Entertime, Valueforhours, Invalidvalueforminutes, Invalidtimeformat, EntervalidDateandTime, ValiddatemonthMMDDYYHHMM, ValiddatemonthMMDDYYHHMMTT, EntervalidDateandTime, Invalidvalueforhours, Invalidvalueforminites)) {
                    if (document.aspnetForm.ctl00_BodyContentPH_txtToDate.value != '') {
                        var weekDay = document.aspnetForm.ctl00_BodyContentPH_txtToDate;
                        var DateFormat = document.getElementById('ctl00_BodyContentPH_Hidden1').value;
                        if (checkDate(weekDay, DateFormat, Monthfourdigit, Datefourdigit, Invalidyearentry, Invalidmonthentry, Invaliddateentry, DateformatDDMONYYYY, Entertime, Valueforhours, Invalidvalueforminutes, Invalidtimeformat, EntervalidDateandTime, ValiddatemonthMMDDYYHHMM, ValiddatemonthMMDDYYHHMMTT, EntervalidDateandTime, Invalidvalueforhours, Invalidvalueforminites)) {
                        }
                        else {
                            return false;
                        }
                    }
                    else {
                        alert(ToDate);
                        return false
                    }
                }
                else {
                    return false;
                }
            }
            else {
                alert(FromDate);
                return false;
            }
        }
    </script>

</asp:Content>
