<%@ Page Language="C#" MasterPageFile="~/MasterFile/TimeCheck.master" AutoEventWireup="true"
    CodeFile="TA_UI_Master_ShiftDetails.aspx.cs" Inherits="Masters_TA_UI_MasterShiftDetails" %>

<%@ Register TagPrefix="dxGridview" Namespace="DevExpress.Web" Assembly="DevExpress.Web.v14.2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPH" runat="Server">
    <script type="text/javascript">
        function navi(loc) {
            document.getElementById('ctl00_BodyContentPH_iframePopup').src = loc;
            return false;
        }
        function Delete_Conf() {
            //Alert_AreyousuretoDelete
            return confirm('Are you sure, to delete?');
        }
        function UpdateCustomizationWindowValue() {
            var element = document.getElementById("btnCustWindow");
            if (element == null) return;
            element.value = (GridView1.IsCustomizationWindowVisible() ? "Hide" : "Show") + " Customization Window";
        }
        function ShowHideCustomizationWindow() {
            if (GridView1.IsCustomizationWindowVisible())
                GridView1.HideCustomizationWindow();
            else GridView1.ShowCustomizationWindow();
            UpdateCustomizationWindowValue();
        }
    </script>
    <div class="content-header">
        <h1 style="background-image: url('../dist/img/shifticon.png'); background-repeat: no-repeat; padding-left: 35px">
            <asp:Label ID="lbl_HeaderShift" runat="server"></asp:Label>
        </h1>
        <asp:SiteMapPath ID="site" runat="server" CssClass="breadcrumb">
            <NodeStyle CssClass="active" />
        </asp:SiteMapPath>
    </div>
    <div class="content">
        <div id="myModal" class="modal modal-default fade" role="dialog">
            <div class="modal-dialog" style="width: 90%;">
                <!-- Modal content-->
                <div class="modal-content" style="margin-top: 50px">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" style="border-radius: 50px;">
                            &times;</button>
                        <h4 class="modal-title">
                            <asp:Label ID="lblDataView" runat="server"></asp:Label>
                        </h4>
                    </div>
                    <div class="modal-body">
                        <iframe id="iframePopup" runat="server" scrolling="auto" width="100%" height="700px"
                            style="border-style: none"></iframe>
                    </div>
                    <div class="modal-footer" style="display: none">
                        <button type="button" class="btn btn-primary pull-right" data-dismiss="modal">
                            Close</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="border-table new-space" style="margin-top: 0px">
            <div class="row">
                <div class="col-md-12" style="overflow: auto">
                    <div class="form-horizontal">
                        <div style="display: none">
                            <div class="row">
                                <div class="col-md-12">
                                    <asp:Label ID="lbl_Error" runat="server" ForeColor="Red"></asp:Label>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-12">
                                    <asp:Label ID="lblSearchCompany" runat="server"></asp:Label>:
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-12">
                                    <asp:DropDownList ID="ddlCompany" runat="server" AppendDataBoundItems="true" AutoPostBack="true"
                                        OnSelectedIndexChanged="ddlCompany_SelectedIndexChanged">
                                        <asp:ListItem Value="0" Text="-Select-"></asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-12">
                                    <asp:Label ID="lblSearchShift" runat="server"></asp:Label>:
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-12">
                                    <asp:DropDownList ID="ddlShift" runat="server" AppendDataBoundItems="true" AutoPostBack="true"
                                        OnSelectedIndexChanged="ddlShift_SelectedIndexChanged">
                                        <asp:ListItem Value="0" Text="-Select-"></asp:ListItem>
                                    </asp:DropDownList>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-12">
                                    <asp:Label ID="lblShortName" runat="server"></asp:Label>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-12">
                                    <asp:TextBox onpaste="return true" ID="txtSearchShort" runat="server"></asp:TextBox>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-md-12">
                                    <asp:Button ID="btnSearch" CssClass="but" runat="server" OnClick="btnSearch_Click" />
                                    <asp:Button ID="btn_Clear" CssClass="but" runat="server" OnClick="btn_Clear_Click" />
                                </div>
                            </div>
                        </div>
                        <div class="row form-group">
                            <div class="col-md-12">
                                <asp:HiddenField ID="hdnSelectRow" runat="server" />
                                <asp:HiddenField ID="hdnGetAllid" runat="server" />
                                <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                                    <ContentTemplate>
                                        <dxGridview:ASPxGridView ID="GridView1" runat="server" AutoGenerateColumns="False"
                                            EnableCallBacks="false" ClientInstanceName="GridView1" DataSourceID="ObjectDataSource1"
                                            OnHtmlRowCreated="GridView1_HtmlRowCreated" KeyFieldName="Shift_Id" Width="100%" Settings-HorizontalScrollBarMode="Auto" ViewStateMode="Enabled">
                                            <Columns>
                                                <dxGridview:GridViewDataColumn VisibleIndex="0" Width="30px" HeaderStyle-VerticalAlign="Middle"
                                                    HeaderStyle-HorizontalAlign="Center" CellStyle-VerticalAlign="Middle" CellStyle-HorizontalAlign="Center">
                                                    <HeaderTemplate>
                                                        <input id="chkSelectAll" runat="server" type="checkbox" onclick="SelectAllOnThisPage(this)" />
                                                    </HeaderTemplate>
                                                    <DataItemTemplate>
                                                        <input id="chkSelect" runat="server" type="checkbox" onclick="SelectOnRow(this)"
                                                            accesskey='<%# Eval("Shift_Id") %>' />
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataColumn>
                                                <dxGridview:GridViewDataTextColumn FieldName="name" VisibleIndex="1" Width="240px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblCompanyName" runat="server" Text='<%# Bind("name") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn Caption="Shift Name" FieldName="Shift_Name" VisibleIndex="2"
                                                    Width="150px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lbl_ShiftName" Text='<%# Eval("Shift_Name") %>' runat="server"></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn FieldName="ShiftTime" VisibleIndex="3" Width="147px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lbl_ShiftTime" Text='<%# Eval("ShiftTime") %>' runat="server"></asp:Label>
                                                        <asp:Label ID="start" Visible="false" Text='<%# Eval("shiftstart") %>' runat="server"></asp:Label>
                                                        <asp:Label ID="end" Visible="false" Text='<%# Eval("shiftend") %>' runat="server"></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn FieldName="Shift_ShortName" VisibleIndex="4" Width="120px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblShortName" runat="server" Text='<%# Bind("Shift_ShortName") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn FieldName="ShiftType" VisibleIndex="5" Width="86px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblShiftType" runat="server" Text='<%# Bind("ShiftType") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn FieldName="24HrsShift" VisibleIndex="6" Width="80px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lbl24HrsShift" runat="server" Text='<%# Bind("24HrsShift") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataColumn HeaderStyle-VerticalAlign="Middle" HeaderStyle-HorizontalAlign="Center" VisibleIndex="7"
                                                    CellStyle-VerticalAlign="Middle" CellStyle-HorizontalAlign="Center" Width="35px">
                                                    <Settings AllowAutoFilter="false" />
                                                    <DataItemTemplate>
                                                        <a data-toggle="modal" title='<%# Session["View"] %>' data-placement="top" data-target="#myModal" onclick="return navi('TA_UI_Master_ShiftView.aspx?ShiftId=<%# Eval("Shift_Id") %>')"
                                                            href="#"><span class="btn btn-defalut view-icons"></span></a>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataColumn>
                                                <dxGridview:GridViewDataColumn HeaderStyle-VerticalAlign="Middle" HeaderStyle-HorizontalAlign="Center" VisibleIndex="8"
                                                    CellStyle-VerticalAlign="Middle" CellStyle-HorizontalAlign="Center" Width="35px">
                                                    <Settings AllowAutoFilter="false" />
                                                    <DataItemTemplate>
                                                        <asp:LinkButton ID="btnEdit" runat="server" ToolTip='<%# Session["Edit"] %>' data-toggle="tooltip"
                                                            OnClick="EditLinkButton_Click" CommandName='<%# Eval("Shift_Id") %>' data-placement="top"
                                                            CssClass="btn btn-defalut edit-icons" Style="color: #3C8DBC"></asp:LinkButton>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataColumn>
                                                <dxGridview:GridViewDataColumn HeaderStyle-VerticalAlign="Middle" HeaderStyle-HorizontalAlign="Center"
                                                    CellStyle-VerticalAlign="Middle" CellStyle-HorizontalAlign="Center" Width="35px" VisibleIndex="9">
                                                    <Settings AllowAutoFilter="false" />
                                                    <DataItemTemplate>
                                                        <asp:LinkButton ID="btnDelete" runat="server" ToolTip='<%# Session["Delete"] %>' data-toggle="tooltip"
                                                            OnClick="btn_delete_Click_1" CommandName='<%# Eval("Shift_Id") %>' data-placement="top"
                                                            CssClass="btn btn-defalut del-icons" Style="color: Red" OnClientClick="return Delete_Conf();"></asp:LinkButton>
                                                    </DataItemTemplate>
                                                </dxGridview:GridViewDataColumn>

                                                <dxGridview:GridViewDataTextColumn Visible="false" FieldName="Shift_GraceInTime" VisibleIndex="10" Width="150px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblShift_GraceInTime" runat="server" Text='<%# Bind("Shift_GraceInTime") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn Visible="false" FieldName="Shift_GraceOutTime" VisibleIndex="11" Width="160px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblShift_GraceOutTime" runat="server" Text='<%# Bind("Shift_GraceOutTime") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>

                                                <dxGridview:GridViewDataTextColumn Visible="false" FieldName="Shift_MinTimeOT" VisibleIndex="12" Width="240px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblShift_MinTimeOT" runat="server" Text='<%# Bind("Shift_MinTimeOT") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn Visible="false" FieldName="Shift_MaxTimeOT" VisibleIndex="13" Width="240px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblShift_MaxTimeOT" runat="server" Text='<%# Bind("Shift_MaxTimeOT") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>

                                                <dxGridview:GridViewDataTextColumn Visible="false" FieldName="Shift_WorkingDay_OverTime" VisibleIndex="14" Width="182px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblShift_WorkingDay_OverTime" runat="server" Text='<%# Bind("Shift_WorkingDay_OverTime") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn Visible="false" FieldName="Shift_FirstHalf_StartTime" VisibleIndex="15" Width="136px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblShift_FirstHalf_StartTime" runat="server" Text='<%# Bind("Shift_FirstHalf_StartTime") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn Visible="false" FieldName="Shift_FirstHalf_EndTime" VisibleIndex="16" Width="140px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblShift_FirstHalf_EndTime" runat="server" Text='<%# Bind("Shift_FirstHalf_EndTime") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn Visible="false" FieldName="Shift_SecondHalf_StartTime" VisibleIndex="17" Width="148px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblShift_SecondHalf_StartTime" runat="server" Text='<%# Bind("Shift_SecondHalf_StartTime") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn Visible="false" FieldName="Shift_SecondHalf_EndTime" VisibleIndex="18" Width="140px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblShift_SecondHalf_EndTime" runat="server" Text='<%# Bind("Shift_SecondHalf_EndTime") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn Visible="false" FieldName="Shift_BreakStartTime1" VisibleIndex="19" Width="120px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblShift_BreakStartTime1" runat="server" Text='<%# Bind("Shift_BreakStartTime1") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn Visible="false" FieldName="Shift_BreakEndTime1" VisibleIndex="20" Width="120px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblShift_BreakEndTime1" runat="server" Text='<%# Bind("Shift_BreakEndTime1") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn Visible="false" FieldName="Shift_BreakStartTime2" VisibleIndex="21" Width="120px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblShift_BreakStartTime2" runat="server" Text='<%# Bind("Shift_BreakStartTime2") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn Visible="false" FieldName="Shift_BreakEndTime2" VisibleIndex="22" Width="120px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblShift_BreakEndTime2" runat="server" Text='<%# Bind("Shift_BreakEndTime2") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn Visible="false" FieldName="Shift_BreakStartTime3" VisibleIndex="23" Width="120px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblShift_BreakStartTime3" runat="server" Text='<%# Bind("Shift_BreakStartTime3") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn Visible="false" FieldName="Shift_BreakEndTime3" VisibleIndex="24" Width="120px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblShift_BreakEndTime3" runat="server" Text='<%# Bind("Shift_BreakEndTime3") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn Visible="false" FieldName="DefaultShift" VisibleIndex="25" Width="90px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblDefaultShift" runat="server" Text='<%# Bind("DefaultShift") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn Visible="false" FieldName="CreatedDate" VisibleIndex="26" Width="150px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblCreatedDate" runat="server" Text='<%# Bind("CreatedDate") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn Visible="false" FieldName="ModifiedDate" VisibleIndex="27" Width="150px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblModifiedDate" runat="server" Text='<%# Bind("ModifiedDate") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                                <dxGridview:GridViewDataTextColumn Visible="false" FieldName="MaxShiftWorkHours" VisibleIndex="28" Width="150px">
                                                    <DataItemTemplate>
                                                        <asp:Label ID="lblMaxShiftWorkHours" runat="server" Text='<%# Bind("MaxShiftWorkHours") %>'></asp:Label>
                                                    </DataItemTemplate>
                                                    <HeaderStyle HorizontalAlign="center" Wrap="true" />
                                                </dxGridview:GridViewDataTextColumn>
                                            </Columns>
                                            <ClientSideEvents CustomizationWindowCloseUp="function(s, e) { UpdateCustomizationWindowValue(); }" />
                                            <SettingsPager PageSize="20">
                                                <PageSizeItemSettings Visible="true" ShowAllItem="true" Items="10,20,50,100,200" />
                                            </SettingsPager>
                                            <Settings ShowFilterRow="true" ShowFilterRowMenu="true" HorizontalScrollBarMode="Auto" ShowGroupPanel="true" VerticalScrollBarMode="Hidden" VerticalScrollableHeight="400" />
                                            <SettingsText EmptyDataRow="No Records Found" />
                                            <SettingsCustomizationWindow Enabled="True" />
                                            <SettingsBehavior AutoExpandAllGroups="True" ColumnResizeMode="Control" />
                                            <SettingsBehavior AllowDragDrop="true" />
                                        </dxGridview:ASPxGridView>
                                        <dxGridview:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="GridView1">
                                            <PageFooter Right="[Page # of Pages #]">
                                            </PageFooter>
                                        </dxGridview:ASPxGridViewExporter>
                                    </ContentTemplate>
                                </asp:UpdatePanel>
                                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="SelectShiftDetails"
                                    TypeName="ShiftEvenData">
                                    <SelectParameters>
                                        <asp:SessionParameter Name="UserGroupName" SessionField="UserGroupName" Type="string" />
                                        <asp:SessionParameter Name="UserLevels" SessionField="LevelRights" Type="string" />
                                        <asp:ControlParameter ControlID="ddlCompany" Name="ParentId" DefaultValue="0" Type="Int32" />
                                    </SelectParameters>
                                </asp:ObjectDataSource>
                            </div>
                        </div>
                        <div class="row form-group">
                            <div class="col-md-12">
                                <div class="pull-right-button">
                                    <asp:LinkButton ID="btn_Add" CssClass="btn add-btn fa-plus" runat="server" OnClick="btn_Add_Click" />
                                    <asp:LinkButton ID="btn_Delete" CssClass="btn btn-primary fa fa-trash-o" runat="server"
                                        CausesValidation="False" OnClick="btn_Delete_Click" OnClientClick="return confirmdelete(this.form);" />
                                    <asp:Button ID="btn_Restore" runat="server" CausesValidation="true" CssClass="but"
                                        OnClick="btn_Restore_Click" OnClientClick="return RestoreData();" />
                                    <asp:HiddenField ID="hdnDeletedData" runat="server" />
                                    <asp:LinkButton ID="btn_PermanentDelete" runat="server" CausesValidation="true" CssClass="btn save-btn fa-trash-o"
                                        OnClick="btn_PermanentDelete_Click" OnClientClick="return Permanentconfirmdelete(this.form);" />
                                    <asp:LinkButton ID="btnCustWindow" runat="server" CssClass="btn save-btn fa-folder-open-o"
                                        Text="&nbsp;&nbsp;Field Lists" OnClientClick="ShowHideCustomizationWindow();"></asp:LinkButton>
                                    <asp:LinkButton ID="lnktbnexcel" ToolTip="Excel" CommandName="excel" runat="server" CssClass="btn del-btn fa-file-excel-o" OnClick="btnExport_Click">
                                    </asp:LinkButton>
                                    <asp:LinkButton ID="lnkbtnpdf" ToolTip="Pdf" CommandName="pdf" runat="server" CssClass="btn del-btn fa-file-pdf-o" OnClick="btnExport_Click">
                                    </asp:LinkButton>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript" language="javascript">
        function OnInit(s, e) {
            AdjustSize();
        }
        function OnEndCallback(s, e) {
            AdjustSize();
        }
        function AdjustSize() {
            var height = Math.max(0, document.documentElement.clientHeight);
            var width = Math.max(0, document.documentElement.clientWidth);
            grid.SetHeight(height);
        }
        function SelectAllOnThisPage(chkSelectAll) {
            var hdnSelectRow = document.getElementById('<%= hdnSelectRow.ClientID %>');
            var hdnSelectAll = document.getElementById('<%= hdnGetAllid.ClientID %>');
            if (chkSelectAll.checked == true) {
                for (var i = 0; i < GridView1.pageRowCount; i++) {
                    if (document.getElementById('ctl00_BodyContentPH_GridView1_cell' + (i + GridView1.visibleStartIndex) + '_0_chkSelect').disabled == false) {
                        document.getElementById('ctl00_BodyContentPH_GridView1_cell' + (i + GridView1.visibleStartIndex) + '_0_chkSelect').checked = true;
                        var hdnUserId = document.getElementById('ctl00_BodyContentPH_GridView1_cell' + (i + GridView1.visibleStartIndex) + '_0_chkSelect').accessKey;
                        var hdnSelectRow = document.getElementById('<%= hdnSelectRow.ClientID %>');
                        var removeId = hdnSelectRow.value.split(",");
                        if (hdnUserId != "" && !Array.contains(removeId, hdnUserId)) {
                            if (hdnSelectRow.value != "")
                                hdnSelectRow.value += ",";
                            hdnSelectRow.value += hdnUserId;
                        }
                    }
                }
            }
            else {
                for (var i = 0; i < GridView1.pageRowCount; i++) {
                    document.getElementById('ctl00_BodyContentPH_GridView1_cell' + (i + GridView1.visibleStartIndex) + '_0_chkSelect').checked = false;
                }
                hdnSelectRow.value = '';
            }
        }
        function SelectOnRow(chkOnSelect) {
            var hdnUserId = chkOnSelect.accessKey;
            var hdnSelectRow = document.getElementById('<%= hdnSelectRow.ClientID %>');
            var removeId = hdnSelectRow.value.split(",");
            if (chkOnSelect.checked) {
                if (hdnUserId != "" && !Array.contains(removeId, hdnUserId)) {
                    if (hdnSelectRow.value != "")
                        hdnSelectRow.value += ",";
                    hdnSelectRow.value += hdnUserId;
                }
                var varTotalCheckedCount = 0; var varTotalEnabled = 0;
                for (var i = 0; i < GridView1.pageRowCount; i++) {
                    if (document.getElementById('ctl00_BodyContentPH_GridView1_cell' + (i + GridView1.visibleStartIndex) + '_0_chkSelect').disabled == false) {
                        varTotalEnabled = varTotalEnabled + 1;
                    }
                    if (document.getElementById('ctl00_BodyContentPH_GridView1_cell' + (i + GridView1.visibleStartIndex) + '_0_chkSelect').checked)
                        varTotalCheckedCount = varTotalCheckedCount + 1;
                }
                if (varTotalCheckedCount == varTotalEnabled)
                    document.getElementById('ctl00_BodyContentPH_GridView1_header0_chkSelectAll').checked = true;
                else
                    document.getElementById('ctl00_BodyContentPH_GridView1_header0_chkSelectAll').checked = false;
            }
            else {
                if (Array.contains(removeId, hdnUserId)) {
                    Array.remove(removeId, hdnUserId);
                }
                hdnSelectRow.value = removeId;
                document.getElementById('ctl00_BodyContentPH_GridView1_header0_chkSelectAll').checked = false;
            }
        }
        var Norecordsavailable = "No records available ";
        var AreyousuretoRestore = "Are you sure to Restore? ";
        var Selecteddataisnotindeletedstatus = "Selected data is not in deleted status ";
        var Selectdatatorestore = "Select data to restore ";
        var Nodeletedrecordsavailable = "No deleted records available ";
        function RestoreAlert(norecordsavailable, areyousuretoRestore, selecteddataisnotindeletedstatus, selectdatatorestore, nodeletedrecordsavailable) {
            Norecordsavailable = norecordsavailable;
            AreyousuretoRestore = areyousuretoRestore;
            Selecteddataisnotindeletedstatus = selecteddataisnotindeletedstatus;
            Selectdatatorestore = selectdatatorestore;
            Nodeletedrecordsavailable = nodeletedrecordsavailable;
        }
        function RestoreData() {
            var rowscount = GridView1.pageRowCount;
            if (rowscount == 0) {
                alert(Norecordsavailable);
                return false;
            }
            var hdnSelectRow = document.getElementById('<%= hdnSelectRow.ClientID %>');
            var DeleteDataRow = document.getElementById('<%= hdnDeletedData.ClientID %>');
            if (DeleteDataRow.value != '') {
                if (hdnSelectRow.value != '') {
                    var selectedRow = new Array();
                    selectedRow = hdnSelectRow.value.split(",");
                    var deletedRow = new Array();
                    deletedRow = DeleteDataRow.value.split(",");
                    var Status = false;
                    for (var i = 0; i < selectedRow.length; i++) {
                        //alert(selectedRow[i]);
                        if (Array.contains(deletedRow, selectedRow[i])) {
                            Status = true;
                        }
                    }
                    if (Status == true) {
                        return confirm(AreyousuretoRestore);
                    }
                    else {
                        alert(Selecteddataisnotindeletedstatus);
                        return false;
                    }
                }
                else {
                    alert(Selectdatatorestore);
                    return false;
                }
            }
            else {
                if (hdnSelectRow.value == '') {
                    alert(Nodeletedrecordsavailable);
                    return false;
                }
                else {
                    alert(Selecteddataisnotindeletedstatus);
                    return false;
                }
            }
        }
    </script>
</asp:Content>
