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

<%@ Register TagPrefix="dxGridview" Namespace="DevExpress.Web" Assembly="DevExpress.Web.v14.2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPH" runat="Server">
    <!--[if gt IE 5.5]>
	<link rel="stylesheet" type="text/css" href="../css/anytimeIE.css" />
 <![endif]-->

    <script src="../plugins/datepicker/jquery-1.11.1.min.js"></script>

    <script language="javascript" src="../js/jquery.autocomplete.js" type="text/javascript"></script>

    <script src="../plugins/datepicker/bootstrap-datepicker.js"></script>

    <script language="javascript" src="../js/jquery.autocomplete.js" type="text/javascript"></script>

    <script language="javascript" src="../js/DateTimeValidation.js" type="text/javascript"></script>

    <script>

        $(function () {
            $('#ctl00_BodyContentPH_txtStartDate').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value }
            );
        });
        $(function () {
            $('#ctl00_BodyContentPH_txtEndDate').datetimepicker({ format: document.getElementById('ctl00_BodyContentPH_Hidden1').value }
            );
        });
    </script>

    <script language="javascript" type="text/javascript">

        //values for check date
        var Monthfourdigit = 'Please enter valid date as month, day, and four digit year : Format MM/dd/yyyy.';
        //Adding this line var Datefourdigit='Please enter valid date with correct format dd/MM/yyyy'; as newly
        var Datefourdigit = 'Please enter valid date with correct format dd/MM/yyyy';
        var Invalidyearentry = 'Invalid year entry';
        var Invalidmonthentry = 'Invalid month entry';
        var Invaliddateentry = 'Invalid date entry';
        var DateformatDDMONYYYY = 'Incorrect date format. Enter as DD-MON-YYYY';
        var Entertime = 'Enter time';
        var Valueforhours = 'Invalid value for hours:';
        var Invalidvalueforminutes = 'Invalid value for minutes:';
        var Invalidtimeformat = 'Invalid time format:';
        var EntervalidDateandTime = 'Please enter valid Date and Time';
        var ValiddatemonthMMDDYYHHMM = 'Please enter valid Date and Time MM/dd/yyyy HH:mm';
        var ValiddatemonthMMDDYYHHMMTT = 'Please enter valid Date and Time MM/dd/yyyy hh:mm tt';
        var EntervalidDateandTime = 'Please enter valid Date and Time';
        var Invalidvalueforhours = 'Invalid value for hours:';
        var Invalidvalueforminites = 'Invalid value for minutes:';




        function SetAlertCheckDate(monthfourdigit, datefourdigit, invalidyearentry, invalidmonthentry, invaliddateentry, dateformatDDMONYYYY, entertime, valueforhours, invalidvalueforminutes, invalidtimeformat, entervalidDateandTime, validdatemonthMMDDYYHHMM, validdatemonthMMDDYYHHMMTT, entervalidDateandTime, invalidvalueforhours, invalidvalueforminites) {
            Monthfourdigit = monthfourdigit;
            Datefourdigit = datefourdigit;
            Invalidyearentry = invalidyearentry;
            Invalidmonthentry = invalidmonthentry;
            Invaliddateentry = invaliddateentry;
            DateformatDDMONYYYY = dateformatDDMONYYYY;
            Entertime = Entertime;
            Valueforhours = valueforhours;
            Invalidvalueforminutes = invalidvalueforminutes;
            Invalidtimeformat = invalidtimeformat;
            EntervalidDateandTime = entervalidDateandTime;
            ValiddatemonthMMDDYYHHMM = validdatemonthMMDDYYHHMM;
            ValiddatemonthMMDDYYHHMMTT = validdatemonthMMDDYYHHMMTT;
            EntervalidDateandTime = entervalidDateandTime;
            Invalidvalueforhours = invalidvalueforhours;
            Invalidvalueforminites = invalidvalueforminites;
        }
        function DateEntryValidation() {
            if (document.aspnetForm.ctl00_BodyContentPH_txtStartDate.value != '') {


                var weekDay = document.aspnetForm.ctl00_BodyContentPH_txtStartDate;
                var DateFormat = document.getElementById('ctl00_BodyContentPH_Hidden1').value;

                if (checkDate(weekDay, DateFormat, Monthfourdigit, Datefourdigit, Invalidyearentry, Invalidmonthentry, Invaliddateentry, DateformatDDMONYYYY, Entertime, Valueforhours, Invalidvalueforminutes, Invalidtimeformat, EntervalidDateandTime, ValiddatemonthMMDDYYHHMM, ValiddatemonthMMDDYYHHMMTT, EntervalidDateandTime, Invalidvalueforhours, Invalidvalueforminites)

         ) {
                }
                else {
                    return false;
                }
            }

            if (document.aspnetForm.ctl00_BodyContentPH_txtEndDate.value != '') {

                var weekDay = document.aspnetForm.ctl00_BodyContentPH_txtEndDate;
                var DateFormat = document.getElementById('ctl00_BodyContentPH_Hidden1').value;

                if (checkDate(weekDay, DateFormat, Monthfourdigit, Datefourdigit, Invalidyearentry, Invalidmonthentry, Invaliddateentry, DateformatDDMONYYYY, Entertime, Valueforhours, Invalidvalueforminutes, Invalidtimeformat, EntervalidDateandTime, ValiddatemonthMMDDYYHHMM, ValiddatemonthMMDDYYHHMMTT, EntervalidDateandTime, Invalidvalueforhours, Invalidvalueforminites)

         ) {
                }
                else {
                    return false;
                }
            }
        }

    </script>

    <div class="content-header">
        <h1 style="background-image: url('../dist/img/shift-exe.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">
        <!--FILTERS-->
        <div class="inr-ftr">
            <div class="row">
                <div class="col-sm-2">
                    <div class="inr-fil-text">
                        <asp:Label ID="lblFilter" runat="server" Text="Filter"></asp:Label>
                    </div>
                </div>

            </div>
        </div>
        <!--FILTERS-->
        <div class="emp-filter">
            <div class="row">
                <div class="form-horizontal">
                    <div class="col-md-12">
                        <div class="row form-group">
                            <div class="col-md-3">
                                <asp:HiddenField ID="Hidden1" runat="server" />
                                <asp:Label ID="lblTimePeriod" runat="server"></asp:Label>
                                -
                                <asp:Label ID="lblStartDate" runat="server"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox onpaste="return true" ID="txtStartDate" runat="server" CssClass="form-control"
                                    EnableViewState="False" onCut="return false" onDrop="return false"></asp:TextBox>
                            </div>
                            <div class="col-md-3">
                                <asp:Label ID="lblEndDate" runat="server"></asp:Label>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox onpaste="return true" ID="txtEndDate" runat="server" CssClass="form-control"
                                    EnableViewState="False" onCut="return false" onDrop="return false"></asp:TextBox>
                            </div>
                        </div>
                        <%--Add Search text box and other search control here--%>
                        <div class="row">
                            <div class="col-md-6">
                            </div>
                            <div class="col-md-6">
                                <div class="pull-right-button">
                                    <%--Add serach button here--%>
                                    <asp:Label ID="lbl_Error" runat="server" ForeColor="Red"></asp:Label>
                                    <asp:LinkButton ID="btn_Search" CssClass="btn save-btn fa-search" runat="server"
                                        OnClick="btn_Search_Click" OnClientClick="return DateEntryValidation()" />
                                    <asp:LinkButton ID="btn_Clear" CssClass="btn save-btn fa-refresh" runat="server"
                                        OnClick="btn_Clear_Click" />
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--RES TABLE-->
        <div class="border-table new-space">
            <div class="table-responsive" style="padding-bottom: 10px">
                <%--Grid Add Here--%>
                <dxGridview:ASPxGridView ID="grvShiftExchange" runat="server" ClientInstanceName="grvShiftExchange"
                    EnableCallBacks="false" AutoGenerateColumns="false" Width="100%" OnHtmlRowCreated="grvShiftExchange_HtmlRowCreated">
                    <Columns>
                        <dxGridview:GridViewDataTextColumn FieldName="LevelName" VisibleIndex="0" Width="150px">
                            <DataItemTemplate>
                                <asp:Label ID="lblCompany" runat="server" Text='<%# Eval("LevelName") %>' Style="overflow-y: auto; overflow-x: auto; word-break: break-all; width: 140px; word-wrap: break-word; display: inline-block;"></asp:Label>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                        </dxGridview:GridViewDataTextColumn>
                        <dxGridview:GridViewDataTextColumn FieldName="date" VisibleIndex="1" Width="90px">
                            <DataItemTemplate>
                                <asp:Label ID="lblShiftExchangeDate" runat="server" Text='<%# Eval("date") %>'></asp:Label>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                        </dxGridview:GridViewDataTextColumn>
                        <dxGridview:GridViewDataTextColumn FieldName="Employee1Name" VisibleIndex="2" Width="150px">
                            <DataItemTemplate>
                                <asp:Label ID="lblEmployeeCode1" runat="server" Text='<%# Eval("Employee1Name") %>'
                                    Style="overflow-y: auto; overflow-x: auto; word-break: break-all; width: 100px; word-wrap: break-word; display: inline-block;"></asp:Label>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                        </dxGridview:GridViewDataTextColumn>
                        <dxGridview:GridViewDataTextColumn Caption="Shift Name" FieldName="ShiftName1" Width="80px"
                            VisibleIndex="3">
                            <DataItemTemplate>
                                <asp:Label ID="lblEmp1Shift" runat="server" Text='<%# Eval("ShiftName1") %>'></asp:Label>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                        </dxGridview:GridViewDataTextColumn>
                        <dxGridview:GridViewDataTextColumn FieldName="Employee2Name" VisibleIndex="4" Width="150px">
                            <DataItemTemplate>
                                <asp:Label ID="lblEmployeeCode2" runat="server" Text='<%# Eval("Employee2Name") %>'
                                    Style="overflow-y: auto; overflow-x: auto; word-break: break-all; width: 120px; word-wrap: break-word; display: inline-block;"></asp:Label>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                        </dxGridview:GridViewDataTextColumn>
                        <dxGridview:GridViewDataTextColumn FieldName="ShiftName2" VisibleIndex="5" Width="80px">
                            <DataItemTemplate>
                                <asp:Label ID="lblEmp2Shift" runat="server" Text='<%# Eval("ShiftName2") %>'></asp:Label>
                            </DataItemTemplate>
                            <HeaderStyle HorizontalAlign="center" Wrap="true" />
                        </dxGridview:GridViewDataTextColumn>
                    </Columns>
                    <SettingsPager PageSize="10">
                    </SettingsPager>
                    <SettingsText EmptyDataRow="No Records Found" />
                    <Settings ShowFilterRow="true" />
                    <SettingsBehavior SortMode="Value" AllowSort="true" AllowDragDrop="false" />
                    <Styles AlternatingRow-CssClass="table-bg">
                    </Styles>
                </dxGridview:ASPxGridView>
            </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 save-btn fa-plus" runat="server" OnClick="btn_Add_Click" />
                </div>
            </div>
        </div>
        <!--RES TABLE-->
    </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>
