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

<%@ 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">
                            <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                    <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="120px">
                                                <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="250px" 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"
                                                Visible="False" Width="150px">
                                                <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" Visible="False" Width="150px">
                                                <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="136px">
                                                <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="126px">
                                                <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="92px">
                                                <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="250px">
                                                <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(); }" />
                                        <SettingsPager PageSize="10">
                                            <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" />
                                        <SettingsBehavior AutoExpandAllGroups="false" ColumnResizeMode="Control" />
                                        <SettingsBehavior AllowDragDrop="true" />
                                        <Styles AlternatingRow-CssClass="table-bg">
                                        </Styles>
                                        <GroupSummary>
                                            <dxe:ASPxSummaryItem FieldName="Date" SummaryType="Count" />
                                        </GroupSummary>
                                        <SettingsCustomizationWindow Enabled="True" />
                                        <SettingsBehavior AllowDragDrop="true" />
                                    </dxGridview:ASPxGridView>
                                    <dxe:ASPxGridViewExporter ID="ASPxGridViewExporter1" runat="server" GridViewID="gvData">
                                        <PageFooter Right="[Page # of Pages #]">
                                        </PageFooter>
                                    </dxe:ASPxGridViewExporter>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </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" 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>
                            <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="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>
