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

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

<%@ Register TagPrefix="dxGridview" Namespace="DevExpress.Web" Assembly="DevExpress.Web.v14.2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPH" runat="Server">
    <div class="content-header">
        <h1 style="background-image: url(../dist/img/swipe-icon.png); background-repeat: no-repeat; padding-left: 35px">
            <asp:Label ID="lblLateEntry" runat="server"></asp:Label>
        </h1>
        <asp:SiteMapPath ID="site" runat="server" CssClass="breadcrumb">
            <NodeStyle CssClass="active" />
        </asp:SiteMapPath>
    </div>
    <div class="content">
        <div class="emp-filter">
            <div class="form-horizontal">
                <div class="row form-group">
                    <div class="col-md-12">
                        <div class="table-responsive" style="padding-bottom: 15px">
                            <dxGridview:ASPxGridView ID="grv_LateIn" EnableCallBacks="False" runat="server" ClientInstanceName="grv_LateIn"
                                AutoGenerateColumns="False" Width="100%" KeyFieldName="Process_Rec_ID" DataSourceID="ObjectDataSource1"
                                OnHtmlRowCreated="grv_LateIn_HtmlRowCreated">
                                <Columns>
                                    <dxGridview:GridViewDataTextColumn FieldName="CardNo" Caption="Emp No" VisibleIndex="0"
                                        Width="70px">
                                        <DataItemTemplate>
                                            <asp:Label ID="lblCardNo" Text='<%# Eval("CardNo") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; width: 80px; word-wrap: break-word; display: inline-block;"></asp:Label>
                                            <asp:HiddenField ID="lblProcess_Rec_ID" Value='<%# Eval("Process_Rec_ID") %>' runat="server" />
                                        </DataItemTemplate>
                                        <EditItemTemplate>
                                            <asp:Label ID="lblCardNo" Text='<%# Eval("CardNo") %>' runat="server"></asp:Label>
                                            <asp:HiddenField ID="lblProcess_Rec_ID" Value='<%# Eval("Process_Rec_ID") %>' runat="server" />
                                        </EditItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" Wrap="True" />
                                    </dxGridview:GridViewDataTextColumn>
                                    <dxGridview:GridViewDataTextColumn Caption="Employee Name" FieldName="Employee Name"
                                        Width="110px" VisibleIndex="1">
                                        <DataItemTemplate>
                                            <asp:Label ID="lblEmployeename" Text='<%# Eval("Employee Name") %>' runat="server"
                                                Style="overflow-y: auto; overflow-x: auto; word-break: break-all; cursor: pointer; word-wrap: break-word; display: inline-block;">
                                            </asp:Label>
                                        </DataItemTemplate>
                                        <EditItemTemplate>
                                            <asp:Label ID="lblEmployeename" Text='<%# Eval("Employee Name") %>' runat="server"
                                                Style="overflow-y: auto; overflow-x: auto; word-break: break-all; cursor: pointer; word-wrap: break-word; display: inline-block;">
                                            </asp:Label>
                                        </EditItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" Wrap="True" />
                                    </dxGridview:GridViewDataTextColumn>
                                    <dxGridview:GridViewDataTextColumn Caption="Level" FieldName="Level Name" VisibleIndex="2"
                                        Width="110px">
                                        <DataItemTemplate>
                                            <asp:Label ID="lblLevelName" Text='<%# Eval("Level Name") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; cursor: pointer; word-wrap: break-word; display: inline-block;"></asp:Label>
                                        </DataItemTemplate>
                                        <EditItemTemplate>
                                            <asp:Label ID="lblLevelName" Text='<%# Eval("Level Name") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; cursor: pointer; word-wrap: break-word; display: inline-block;"></asp:Label>
                                        </EditItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" Wrap="True" />
                                    </dxGridview:GridViewDataTextColumn>
                                    <dxGridview:GridViewDataTextColumn Caption="Designation" FieldName="Designation"
                                        VisibleIndex="3" Width="110px">
                                        <DataItemTemplate>
                                            <asp:Label ID="lblDesignation" Text='<%# Eval("Designation") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; cursor: pointer; word-wrap: break-word; display: inline-block;"></asp:Label>
                                        </DataItemTemplate>
                                        <EditItemTemplate>
                                            <asp:Label ID="lblDesignation" Text='<%# Eval("Designation") %>' runat="server" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; cursor: pointer; word-wrap: break-word; display: inline-block;"></asp:Label>
                                        </EditItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" Wrap="True" />
                                    </dxGridview:GridViewDataTextColumn>
                                    <dxGridview:GridViewDataTextColumn Caption="Gender" FieldName="Gender" VisibleIndex="4"
                                        Width="80px" Visible="False">
                                        <DataItemTemplate>
                                            <asp:Label ID="lblGender" Text='<%# Eval("Gender") %>' runat="server"></asp:Label>
                                        </DataItemTemplate>
                                        <EditItemTemplate>
                                            <asp:Label ID="lblGender" Text='<%# Eval("Gender") %>' runat="server"></asp:Label>
                                        </EditItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" Wrap="True" />
                                    </dxGridview:GridViewDataTextColumn>
                                    <dxGridview:GridViewDataTextColumn Caption="Date" FieldName="Date" VisibleIndex="4"
                                        Width="100px">
                                        <DataItemTemplate>
                                            <asp:Label ID="lblDate" Text='<%# Eval("Date") %>' runat="server"></asp:Label>
                                        </DataItemTemplate>
                                        <EditItemTemplate>
                                            <asp:Label ID="lblDate" Text='<%# Eval("Date") %>' runat="server"></asp:Label>
                                        </EditItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" Wrap="True" />
                                    </dxGridview:GridViewDataTextColumn>
                                    <dxGridview:GridViewDataTextColumn Caption="In Time" FieldName="InTime" VisibleIndex="5"
                                        Width="80px">
                                        <DataItemTemplate>
                                            <asp:Label ID="lblInTime" Text='<%# Eval("InTime") %>' runat="server"></asp:Label>
                                        </DataItemTemplate>
                                        <EditItemTemplate>
                                            <asp:Label ID="lblInTime" Text='<%# Eval("InTime") %>' runat="server"></asp:Label>
                                        </EditItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" Wrap="True" />
                                    </dxGridview:GridViewDataTextColumn>
                                    <dxGridview:GridViewDataTextColumn Caption="Late By" FieldName="LateBy" VisibleIndex="6"
                                        Width="60px">
                                        <DataItemTemplate>
                                            <asp:Label ID="lblLateBy" Text='<%# Eval("LateBy") %>' runat="server"></asp:Label>
                                        </DataItemTemplate>
                                        <EditItemTemplate>
                                            <asp:Label ID="lblLateBy" Text='<%# Eval("LateBy") %>' runat="server"></asp:Label>
                                        </EditItemTemplate>
                                        <HeaderStyle HorizontalAlign="Center" Wrap="True" />
                                    </dxGridview:GridViewDataTextColumn>
                                    <dxGridview:GridViewDataTextColumn Caption="Reason" FieldName="Reason" VisibleIndex="7"
                                        Width="80px">
                                        <EditItemTemplate>
                                            <asp:TextBox onpaste="return true" TextMode="MultiLine" ID="TextBox1" runat="server"
                                                onkeyPress="return acceptChars_MaxLength(event,this,255,MaxLength,MaxLength)"
                                                Text='<%# Bind("Reason") %>' CssClass="form-control" MaxLength="255" Style="overflow-y: auto; overflow-x: auto; word-break: break-all; cursor: pointer; word-wrap: break-word; display: inline-block; width: 70px; height: 22px; resize: none"></asp:TextBox>
                                        </EditItemTemplate>
                                        <DataItemTemplate>
                                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("Reason") %>' 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" />
                                    </dxGridview:GridViewDataTextColumn>
                                    <dxGridview:GridViewCommandColumn VisibleIndex="8" Caption=" " Width="40px">
                                        <EditButton Visible="True">
                                        </EditButton>
                                        <HeaderStyle HorizontalAlign="Center" Wrap="True" />
                                    </dxGridview:GridViewCommandColumn>
                                </Columns>
                                <ClientSideEvents CustomizationWindowCloseUp="function(s, e) { UpdateCustomizationWindowValue(); }" />
                                <SettingsCustomizationWindow Enabled="True" />
                                <SettingsText EmptyDataRow="No Records Found" />
                                <SettingsEditing Mode="Inline" />
                                <Settings ShowFilterRow="True" />
                                <SettingsBehavior SortMode="Value" />
                                <Styles>
                                    <AlternatingRow CssClass="table-bg">
                                    </AlternatingRow>
                                </Styles>
                            </dxGridview:ASPxGridView>
                            <dxe:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="gvData">
                                <PageFooter Right="[Page # of Pages #]">
                                </PageFooter>
                            </dxe:ASPxGridViewExporter>
                        </div>
                    </div>
                </div>
                <div class="row form-group">
                    <div class="col-md-12">
                        <div class="pull-right-button">
                            <asp:LinkButton ID="btn_View" CssClass="btn save-btn fa-eye" runat="server" OnClick="btn_View_Click" />
                            <asp:LinkButton ID="lnktbnexcel" Text="&nbsp;&nbsp;Export To Excel" ToolTip="Excel" CommandName="excel" runat="server" CssClass="btn del-btn fa-file-excel-o" OnClick="btnExport_Click">
                            </asp:LinkButton>
                            <asp:LinkButton ID="lnkbtnpdf" Text="&nbsp;&nbsp;Export To PDF" ToolTip="Pdf" CommandName="pdf" runat="server" CssClass="btn del-btn fa-file-pdf-o" OnClick="btnExport_Click">
                            </asp:LinkButton>
                            <asp:LinkButton ID="btnCustWindow" Visible="false" runat="server" CssClass="btn save-btn fa-folder-open-o"
                                            Text="&nbsp;&nbsp;Show Customization Window" OnClientClick="ShowHideCustomizationWindow();"></asp:LinkButton>

                            <asp:LinkButton ID="btnBack" CssClass="btn save-btn fa-angle-left" runat="server"
                                OnClientClick="location.href='TA_UI_Report_LateInstance.aspx';return false;" />
                            <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="SelectLateInstanceReport"
                                TypeName="GetReports" UpdateMethod="ReasonEntry_LateIn">
                                <UpdateParameters>
                                    <asp:Parameter Name="Process_Rec_ID" Type="Int32" />
                                    <asp:Parameter Name="Reason" Type="String" />
                                </UpdateParameters>
                                <SelectParameters>
                                    <asp:QueryStringParameter Name="Emp_Id" QueryStringField="EmpId" Type="String" />
                                    <asp:SessionParameter Name="levelID" Type="String" SessionField="LateInsLevel" />
                                    <asp:QueryStringParameter Name="dtFromDate" QueryStringField="From" Type="String" />
                                    <asp:QueryStringParameter Name="dtToDate" QueryStringField="To" Type="String" />
                                    <asp:QueryStringParameter Name="empName" QueryStringField="EmpName" Type="String" />
                                    <asp:QueryStringParameter Name="shift" QueryStringField="Shift" Type="Int32" />
                                    <asp:QueryStringParameter Name="employeeCategory" QueryStringField="EmployeeCategory"
                                        Type="Int32" />
                                    <asp:QueryStringParameter Name="employeeType" QueryStringField="EmployeeType" Type="Int32" />
                                    <asp:SessionParameter Name="userGroupName" SessionField="UserGroupName" Type="String" />
                                    <asp:SessionParameter Name="gradeLevel" SessionField="GradeLevel" Type="String" />
                                    <asp:QueryStringParameter Name="strSwipeCard" QueryStringField="SwipeCard" Type="String" />
                                    <asp:QueryStringParameter Name="ParentId" Type="Int32" QueryStringField="ParentLevelId"/>
                                    <asp:QueryStringParameter Name="DesignationId" QueryStringField="Designation" Type="Int32" />
                                    <asp:QueryStringParameter Name="Gender" QueryStringField="Gender" Type="String" />
                                    <asp:QueryStringParameter Name="strEmpAutoId" Type="Int64" QueryStringField="EmpAutoID" />
                                    <asp:QueryStringParameter Name="ExportType" QueryStringField="ExportType" Type="Int32" DefaultValue="1" />
                                    <asp:QueryStringParameter Name="minExceptHrs" QueryStringField="MinExceptHours" Type="String" DefaultValue="" />
                                </SelectParameters>
                            </asp:ObjectDataSource>
                            <asp:HiddenField ID="hidLevels" runat="server" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        var MaxLength = "Maximum length is ";
        function MaxLengthh(maxLength) {
            MaxLength = maxLength;
        }
        function UpdateCustomizationWindowValue() {
            var element = document.getElementById("btnCustWindow");
            if (element == null) return;
            element.value = (grv_LateIn.IsCustomizationWindowVisible() ? "Hide" : "Show") + " Customization Window";
        }
        function ShowHideCustomizationWindow() {
            if (grv_LateIn.IsCustomizationWindowVisible())
                grv_LateIn.HideCustomizationWindow();
            else grv_LateIn.ShowCustomizationWindow();
            UpdateCustomizationWindowValue();
        }
    </script>

</asp:Content>
