<%@ page title="Employee Batch Import" language="C#" masterpagefile="~/Pages/Common/MasterPages/MainMasterPage_new.master" autoeventwireup="true" inherits="Pages_Hrm_Employee_EmployeeBatchImport, App_Web_a0ih5yyi" uiculture="auto" meta:resourcekey="PageResource1" enableEventValidation="false" viewStateEncryptionMode="Never" %>

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

<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
    <script type="text/javascript">
        function checkAll(objRef) {
            var GridView = objRef.parentNode.parentNode.parentNode.parentNode;
            var inputList = GridView.getElementsByTagName("input");
            for (var i = 0; i < inputList.length; i++) {
                //Get the Cell To find out ColumnIndex
                var row = inputList[i].parentNode.parentNode;
                if (inputList[i].type == "checkbox" && objRef != inputList[i]) {
                    if (objRef.checked) {
                        //If the header checkbox is checked
                        //check all checkboxes
                        inputList[i].checked = true;
                    }
                    else {
                        //If the header checkbox is checked

                        //uncheck all checkboxes
                        inputList[i].checked = false;
                    }
                }
            }
        }

        function Check_Click(objRef) {
            //Get the Row based on checkbox
            var row = objRef.parentNode.parentNode.parentNode;
            //Get the reference of GridView
            var GridView = row.parentNode;
            //Get all input elements in Gridview
            var inputList = GridView.getElementsByTagName("input");
            for (var i = 0; i < inputList.length; i++) {
                //The First element is the Header Checkbox
                var headerCheckBox = inputList[0];
                //Based on all or none checkboxes
                //are checked check/uncheck Header Checkbox
                var checked = true;
                if (inputList[i].type == "checkbox" && inputList[i] != headerCheckBox) {
                    if (!inputList[i].checked) {
                        checked = false;
                        break;
                    }
                }
            }
            headerCheckBox.checked = checked;
        }
    </script>
    <asp:UpdatePanel ID="HREmployeeMasterSearchUpdatePanel" runat="server">
        <ContentTemplate>
            <Common:CommonSearchUserControl ID="CommonSearchControl" runat="server" Visible="false" />
            <div id="divContentPage" class="divcontentpagemargin">

                <div class="dashBoardLeftCont" valign="top">
                    <div class="himssuHeader3WireBox">
                        <table>
                            <tr>
                                <td>
                                    <div class="himsBoxContent">
                                        <div class="leftUlMenu">
                                            <ScreenGroup:ScreenGroupControl EnableViewState="true" ID="ScreenGroupControl" ScreenGroupId="167"
                                                Visible="true" runat="server" />
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div class="whiteboxpaddingleft row">
                    <div class="himssuHeader5WireBox card card-box">
                        <div class="himsBoxHeader card-head">
                            <asp:Panel ID="SearchHeaderPanel" runat="server" meta:resourcekey="SearchHeaderPanelResource1">
                                <div class="leftdiv">
                                </div>
                                <div class="himsBoxTitle">
                                    <div class="headerText">
                                        <header>
                                            <i class="fas fa-search"></i>
                                            <asp:Label ID="SearchHeaderLabel" runat="server" Text="Search"></asp:Label>
                                        </header>
                                    </div>
                                </div>
                            </asp:Panel>
                        </div>
                        <asp:Panel ID="SearchDetailPanel" runat="server" meta:resourcekey="SearchDetailPanelResource1">
                            <div class="himsBoxContent card-body">
                                <div class="contentHolder">
                                    <div class=" ">
                                    </div>
                                    <div class="outerBox pTop5 col-md-3">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="OrganizationLabel" runat="server" Text="Organization" SkinID="MandatoryLabel"></asp:Label>
                                        </div>
                                        <div class="fLeft pRight5">
                                            <asp:DropDownList runat="server" ID="OrganizationDropDownList" SkinID="CustomWidthDropDownList"
                                                CssClass="form-control" onmouseleave="showHideTooltip()" AutoPostBack="true" onmouseenter="showHideTooltip()"
                                                OnSelectedIndexChanged="OrganizationDropDownList_SelectedIndexChanged">
                                            </asp:DropDownList>
                                        </div>
                                    </div>
                                    <div class="outerBox11 col-md-3 pTop5">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="DepartmentSearchLabel" runat="server" Text="Department"></asp:Label>
                                        </div>
                                        <div class="fLeft pRight5">
                                            <asp:DropDownList runat="server" ID="DepartmentDropDownList" SkinID="CustomWidthDropDownList"
                                                CssClass="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                            </asp:DropDownList>
                                        </div>
                                    </div>
                                    <div class="outerBox pTop5 col-md-3">
                                        <div class="controlLabelWidth">
                                            <asp:Label ID="ToBatchLabel" runat="server" Text="To Batch" SkinID="MandatoryLabel"></asp:Label>
                                        </div>
                                        <div class="fLeft pRight5">
                                            <asp:DropDownList runat="server" ID="ToBatchDropDownList" SkinID="CustomWidthDropDownList"
                                                CssClass="form-control" onmouseleave="showHideTooltip()" onmouseenter="showHideTooltip()">
                                            </asp:DropDownList>
                                        </div>
                                    </div>
                                    <div class="cBoth">
                                    </div>
                                    <div class="text-center col-md-12 pTop15 pBottom-5">
                                        <asp:Button ID="SearchButton" runat="server" Text="&#xf002; Search" OnClick="SearchButton_Click"
                                            SkinID="0" CssClass="fa btn btn-search" />
                                        <asp:Button ID="ImportButton" runat="server" SkinID="0" OnClick="ImportButton_Click" Text="&#xf093; Export To New Batch" CssClass="btn btn-examcommon fas" />
                                        <asp:Button SkinID="0" ID="ClearButton" runat="server" Text="&#xf0e2; Reset" class="fa btn btn-reset" OnClick="ClearSearchControls_Click"
                                            meta:resourcekey="ClearButtonResource1" />
                                    </div>
                                    <div class="cBoth">
                                    </div>
                                    <br />
                                    <div id="HREmployeeMasterGridDiv" runat="server">

                                        <div class="himssuHeader7WireBox pTop15 col-md-12">
                                            <div class="himsBoxHeader" id="HREmployeeMasterGridViewPagerDiv" runat="server" visible="False">
                                                <div class="leftdiv">
                                                </div>
                                                <div class="himsBoxTitle">
                                                    <div class="gridHeaderText">
                                                        <asp:Label ID="GridViewLabel" Text="" runat="server" Font-Bold="True" meta:resourcekey="GridViewLabelResource1"
                                                            ForeColor="White" />
                                                    </div>

                                                    <%--<div class="col-md-12 pb5">

                                                        <div class="col-md-3">
                                                            <asp:Label ID="RecordsPerPage" Text="Records per Page : " runat="server" />
                                                            <asp:DropDownList ID="AddRowsToGridDropDownList" SkinID="CustomWidthDropDownList" Width="60px" runat="server"
                                                                AutoPostBack="true" OnSelectedIndexChanged="AddRowsToGridDropDownList_SelectedIndexChanged">
                                                                <asp:ListItem Text="10" Value="10" Selected="True"></asp:ListItem>
                                                                <asp:ListItem Text="20" Value="20"></asp:ListItem>
                                                                <asp:ListItem Text="50" Value="50"></asp:ListItem>
                                                                <asp:ListItem Text="100" Value="100"></asp:ListItem>
                                                            </asp:DropDownList>
                                                        </div>
                                                        <div class="col-md-9">
                                                            <div class="fRight">
                                                                <uc1:GridViewPager ID="HREmployeeMasterGridViewPager" ParentGridView="HREmployeeMasterGridView"
                                                                    runat="server" OnFirstRecordClick="HREmployeeMasterGridViewPager_FirstRecordClick"
                                                                    OnLastRecordClick="HREmployeeMasterGridViewPager_LastRecordClick" OnNextRecordClick="HREmployeeMasterGridViewPager_NextRecordClick"
                                                                    OnPrevRecordClick="HREmployeeMasterGridViewPager_PrevRecordClick" OnTextBoxValueChange="HREmployeeMasterGridViewPager_TextBoxValueChange" />
                                                            </div>
                                                        </div>
                                                    </div>
                                                        AllowPaging="True" PageSize="10"
                                                        DataKeyNames="EmployeeId,Code,Name,OrganizationDepartmentId,OrganizationDepartment,EmployeeTypeId,EmployeeType,StatusId,Status"                                                    
                                                        --%>


                                                </div>
                                            </div>
                                            <div class="himsBoxContent width-100">
                                                <div id="HREmployeeMasterGridViewMessageDiv" class="himsBoxContentMsg" runat="server" visible="False">
                                                </div>
                                                <asp:GridView runat="server" ID="HREmployeeMasterGridView" Width="100%" AutoGenerateColumns="False"
                                                    EmptyDataText="No records available for the seacrh criteria!"                                                    
                                                    ShowHeader="True" meta:resourcekey="HREmployeeMasterGridViewResource1"
                                                    CssClass="table table-striped table-bordered table-hover">
                                                    <Columns>
                                                        <%--<asp:TemplateField HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="10%">
                                                            <HeaderTemplate>
                                                                <asp:CheckBox ID="ActiveOrInactiveCheckBox" runat="server" />
                                                            </HeaderTemplate>
                                                            <ItemStyle HorizontalAlign="Center" />
                                                            <ItemTemplate>
                                                                <asp:CheckBox ID="StatusActiveOrInactiveCheckBox" runat="server" />
                                                            </ItemTemplate>
                                                        </asp:TemplateField>--%>
                                                        <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Active/InActive" ItemStyle-Width="10%">
                                                            <HeaderTemplate>
                                                                <label class="rt-chkbox rt-chkbox-outline">
                                                                    <asp:CheckBox ID="ActiveOrInactiveCheckBox" runat="server" onclick = "checkAll(this);" />
                                                                    <span></span>
                                                                </label>
                                                            </HeaderTemplate>
                                                            <ItemStyle HorizontalAlign="Center" />
                                                            <ItemTemplate>
                                                                <label class="rt-chkbox rt-chkbox-outline">
                                                                    <asp:CheckBox ID="StatusActiveOrInactiveCheckBox" runat="server" onclick = "Check_Click(this)" />
                                                                    <span></span>
                                                                </label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:BoundField DataField="EmployeeId" HeaderText="EmployeeId" ItemStyle-CssClass="hidden" HeaderStyle-CssClass="hidden"/>
                                                        <asp:BoundField DataField="Code" HeaderText="Code" ItemStyle-Width="10%" />
                                                        <asp:BoundField DataField="Name" HeaderText="Name" ItemStyle-Width="24%" />
                                                        <asp:BoundField DataField="EmployeeType" HeaderText="Employee Type" ItemStyle-Width="15%" />
                                                        <asp:BoundField DataField="OrganizationDepartment" HeaderText="Organization Department"
                                                            ItemStyle-Width="20%" />
                                                        <asp:TemplateField HeaderText="Status" ItemStyle-Width="10%" HeaderStyle-HorizontalAlign="Center"
                                                            ItemStyle-HorizontalAlign="Center" ItemStyle-Wrap="true">
                                                            <ItemTemplate>
                                                                <asp:Label ID="StatLabel" Text='<%#((Sapphire.Ohu.BusinessEntity.Business.Hrm.EmployeeBE.EmployeeSearchResultData)Container.DataItem).Status %>' runat="server" Font-Bold="True" />
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                    </Columns>
                                                    <PagerSettings Visible="False" />
                                                </asp:GridView>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </asp:Panel>
                    </div>

                </div>

            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <%--<script data-main="../../../JavaScript/rjs/encrypt/assign-organization-encrypt" src="../../../JavaScript/rjs/require.js"></script>--%>
    <script data-main='<%=ResolveUrl("~/JavaScript/rjs/assign-organization")%>' src='<%=ResolveUrl("~/JavaScript/rjs/require.js")%>'></script>
</asp:Content>
