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

<%@ Register Assembly="DevExpress.Web.v14.2" Namespace="DevExpress.Web"
    TagPrefix="dxe" %>
<%@ Register TagPrefix="dxGridview" Namespace="DevExpress.Web" Assembly="DevExpress.Web.v14.2" %>
<asp:Content ContentPlaceHolderID="BodyContentPH" runat="server" ID="con_MonthClosure">
    <div class="content-header">
        <h1 style="background-image: url(../dist/img/month-Close.png); background-repeat: no-repeat;
            padding-left: 35px">
            <asp:Label ID="lbl_Header" runat="server"></asp:Label>
        </h1>
        <asp:SiteMapPath ID="site" runat="server" CssClass="breadcrumb">
            <NodeStyle CssClass="active" />
        </asp:SiteMapPath>
    </div>
    <div class="content">
        <div class="border-table new-space" style="margin-top: 0px">
            <div class="table-responsive" style="padding-bottom: 10px">
                <dxGridview:ASPxGridView ID="grv_MonthClosure" EnableCallBacks="false" runat="server"
                    ClientInstanceName="grv_MonthClosure" AutoGenerateColumns="false" Width="100%"
                    OnHtmlRowCreated="grv_MonthClosure_HtmlRowCreated" DataSourceID="ObjectDataSource1">
                    <Columns>
                        <dxGridview:GridViewDataTextColumn FieldName="ManualTimeEntry_Id" VisibleIndex="0"
                            Visible="false">
                            <DataItemTemplate>
                                <asp:Label ID="lblMonthCloseID" Text='<%# Eval("MonthClosure_Id") %>' runat="server"></asp:Label>
                            </DataItemTemplate>
                            <Settings AllowHeaderFilter="true" />
                            <HeaderStyle HorizontalAlign="center" Wrap="true" CssClass="empheader" />
                        </dxGridview:GridViewDataTextColumn>
                        <dxGridview:GridViewDataTextColumn Caption="Level Name" FieldName="Name" VisibleIndex="1"
                            Width="490px">
                            <DataItemTemplate>
                                <asp:Label ID="lblLevelName" Text='<%# Eval("Name") %>' runat="server">
                                </asp:Label>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="center" Wrap="true" CssClass="empheader" />
                        </dxGridview:GridViewDataTextColumn>
                        <dxGridview:GridViewDataTextColumn FieldName="MonthClosure_StartDate" VisibleIndex="2"
                            Width="134px">
                            <DataItemTemplate>
                                <asp:Label ID="lblStartDate" Text='<%# Eval("MonthClosure_StartDate") %>' runat="server">
                                </asp:Label>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="center" Wrap="true" CssClass="empheader" />
                        </dxGridview:GridViewDataTextColumn>
                        <dxGridview:GridViewDataTextColumn FieldName="MonthClosure_EndDate" VisibleIndex="3"
                            Width="134px">
                            <DataItemTemplate>
                                <asp:Label ID="lblEndDate" Text='<%# Eval("MonthClosure_EndDate") %>' runat="server">
                                </asp:Label>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="center" Wrap="true" CssClass="empheader" />
                        </dxGridview:GridViewDataTextColumn>
                        <dxGridview:GridViewDataTextColumn FieldName="MonthClosure_ClosingDate" VisibleIndex="4"
                            Width="160px">
                            <DataItemTemplate>
                                <asp:Label ID="lblMonthCloseDate" Text='<%# Eval("MonthClosure_ClosingDate") %>'
                                    runat="server"></asp:Label>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="center" Wrap="true" CssClass="empheader" />
                        </dxGridview:GridViewDataTextColumn>
                        <dxGridview:GridViewDataColumn HeaderStyle-VerticalAlign="Middle" HeaderStyle-HorizontalAlign="Center"
                            CellStyle-VerticalAlign="Middle" CellStyle-HorizontalAlign="Center" Width="40px">
                            <Settings AllowAutoFilter="false" />
                            <DataItemTemplate>
                                <a href="TA_UI_Transactions_MonthClosureView.aspx?MonthClose_Id=<%# Eval("MonthClosure_Id") %>">
                                    <span class="btn btn-defalut view-icons"></span></a>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                        </dxGridview:GridViewDataColumn>
                    </Columns>
                   <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>
                </dxGridview:ASPxGridView>
                <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" DeleteMethod="deleteMonthCloseDetails"
                    InsertMethod="InsertMonthClosureDetails" SelectMethod="SelectMonthCloseDetails"
                    TypeName="MonthClosureEventData" UpdateMethod="UpdateMonthClosureDetails">
                    <DeleteParameters>
                        <asp:Parameter Name="MonthCloseID" Type="Int32" />
                    </DeleteParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="MonthClosureID" Type="Int32" />
                        <asp:Parameter Name="companyID" Type="Int32" />
                        <asp:Parameter Name="regionID" Type="Int32" />
                        <asp:Parameter Name="branchID" Type="Int32" />
                        <asp:Parameter Name="Month" Type="String" />
                        <asp:Parameter Name="Year" Type="Int32" />
                        <asp:Parameter Name="startDate" Type="String" />
                        <asp:Parameter Name="EndDate" Type="String" />
                        <asp:Parameter Name="ClosingDate" Type="String" />
                    </UpdateParameters>
                    <InsertParameters>
                        <asp:Parameter Name="companyID" Type="Int32" />
                        <asp:Parameter Name="regionID" Type="Int32" />
                        <asp:Parameter Name="branchID" Type="Int32" />
                        <asp:Parameter Name="Month" Type="String" />
                        <asp:Parameter Name="Year" Type="Int32" />
                        <asp:Parameter Name="startDate" Type="String" />
                        <asp:Parameter Name="EndDate" Type="String" />
                        <asp:Parameter Name="ClosingDate" Type="String" />
                    </InsertParameters>
                </asp:ObjectDataSource>
            </div>
            <div class="clearfix">
            </div>
            <div class="row">
                <div class="col-md-6">
                </div>
                <div class="col-md-6 page-button">
                    <%--Add Cancel button Add button here--%>
                    <asp:LinkButton ID="btn_add" CssClass="btn add-btn fa-plus" runat="server" OnClick="btn_add_Click" />
                </div>
            </div>
        </div>
    </div>

    <script type="text/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);            
        }
    
    </script>

</asp:Content>
