<%@ Page Title="OperationHours Page" Language="C#" MasterPageFile="~/SunMaster.Master" AutoEventWireup="true" CodeBehind="OperatingHours.aspx.cs" Inherits="SUNWEB.OperatingHours" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
                            <asp:UpdatePanel runat="server" ID="updatepanel1" UpdateMode="Conditional">
                            <ContentTemplate>
       
                                       <%--<table style="width:100%">
                                       <tr>
                                       <td>
           
                                       </td>
                                       <td align="right" style="padding-bottom:7px;">
         
                                         <label for="validationCustom05">Branch  <asp:Label ID="lblBranchAliasName" runat="server"></asp:Label> </label> 
                                         <asp:DropDownList ID="cmbBranches" CssClass="custom-select" Width="200px" Height="35px"  
                                         runat="server" AutoPostBack="true" 
                                         onselectedindexchanged="cmbBranches_SelectedIndexChanged"></asp:DropDownList>

                                       </td>
                                       </tr>
       
                                      </table>--%>
                                    <div class="container-fluid">
                                        <div class="row mb-3 justify-content-end">
                                            <div class="col-md-6 text-end">
                                                <label for="cmbBranches" class="form-label">
                                                    Branch  <asp:Label ID="lblBranchAliasName" runat="server"></asp:Label>
                                                </label>
                                                <asp:DropDownList ID="cmbBranches" runat="server"
                                                    CssClass="form-select w-25 d-inline-block"
                                                    AutoPostBack="true"
                                                    OnSelectedIndexChanged="cmbBranches_SelectedIndexChanged">
                                                </asp:DropDownList>
                                            </div>
                                        </div>
                                    </div>
 
                                          <%--ShiftType(Ini-63) : Normal Operative Hours --%>
                                           <div class="row" id="Type1" runat="server">
                                           <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                                           <div class="card">
                                           <h5 class="card-header" style="background-color: #4c4c4c; font-size: 14px; color: #F8F9FA">OPERATION HOURS &nbsp;&nbsp;</h5>
                                           <div class="card-body">
                                           <div class="table-responsive">
                                           <table id="example4" class="table table-striped table-bordered">
                                           <tbody>
                                           <caption>
                                           <asp:GridView ID="grdOperatingHours" runat="server" ShowFooter="true" BorderColor="Transparent"
                                            DataKeyNames="id" AutoGenerateColumns="false" Font-Size="14px"
                                            Width="100%" AllowPaging="True" PageSize="20" EmptyDataText="No Record  ! " OnRowDataBound="grdOperatingHours_RowDataBound">
                                            <HeaderStyle CssClass="dataTable" />
                                            <HeaderStyle BackColor="White" ForeColor="Black" />
                                            <FooterStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                                            <RowStyle CssClass="dataTable" />
                                            <Columns>
                                             
                                           <asp:TemplateField>  
                                           <HeaderTemplate>   
                                           <asp:CheckBox ID="chkAllSelect" runat="server" onclick="CheckAll(this);" Visible="false" />  
                                           </HeaderTemplate>  
                                           <ItemTemplate>  
                                           <asp:CheckBox ID="chkSelect" runat="server" Checked="true" Visible="false"/>  
                                           </ItemTemplate>  
                                           </asp:TemplateField>  

                                         <asp:TemplateField HeaderText="SNo">
                                         <ItemTemplate>
                                         <%#Container.DataItemIndex+1 %>
                                         </ItemTemplate>
                                         </asp:TemplateField>
                                         
                                          <asp:TemplateField HeaderText="Id" Visible="false">
                                          <ItemTemplate>
                                          <asp:Label ID="lblid" runat="server" Text='<%#Eval("id") %>'></asp:Label>
                                          </ItemTemplate>
                                          </asp:TemplateField>

                                          <asp:TemplateField HeaderText="Days" >
                                          <ItemTemplate>
                                          <asp:Label ID="lblDays" runat="server" Text='<%#Eval("Days") %>'></asp:Label>
                                          </ItemTemplate>
                                          </asp:TemplateField>

                                         

                                          <asp:TemplateField HeaderText="Start Time" >
                                          <ItemTemplate>
                                          <asp:TextBox ID="txtT1_StTm" runat="server" CssClass="textbox" Text='<%#Eval("StartTm","{0:HH:mm:ss}") %>'   Width="70px"></asp:TextBox>


                                          <asp:MaskedEditExtender ID="MaskedEditExtender3" runat="server" TargetControlID="txtT1_StTm"
                                          Mask="99:99:99" MessageValidatorTip="true" MaskType="Time" InputDirection="RightToLeft"
                                          ErrorTooltipEnabled="True" />
                                          <asp:MaskedEditValidator ID="MaskedEditValidator3" runat="server" ControlExtender="MaskedEditExtender3"
                                          ControlToValidate="txtT1_StTm" IsValidEmpty="false" MaximumValue="23:59:59" MinimumValue="00:00:00"
                                          EmptyValueMessage="Enter Time" MaximumValueMessage="23:59:59" InvalidValueBlurredMessage="Time is Invalid"
                                          MinimumValueMessage="Time must be grater than 00:00:00" EmptyValueBlurredText="Null Time"
                                          ToolTip="Enter time between 00:00:00 to 23:59:59"></asp:MaskedEditValidator>




                                          </ItemTemplate>
                                          </asp:TemplateField>
                            
                                      
                                          <asp:TemplateField HeaderText="End Time">
                                          <ItemTemplate>
                                          <asp:TextBox ID="txtT1_EndTm" runat="server" CssClass="textbox" Text='<%#Eval("EndTm","{0:HH:mm:ss}") %>'   Width="70px"></asp:TextBox>

                                           <asp:MaskedEditExtender ID="MaskedEditExtender4" runat="server" TargetControlID="txtT1_EndTm"
                                          Mask="99:99:99" MessageValidatorTip="true" MaskType="Time" InputDirection="RightToLeft"
                                          ErrorTooltipEnabled="True" />
                                          <asp:MaskedEditValidator ID="MaskedEditValidator4" runat="server" ControlExtender="MaskedEditExtender4"
                                          ControlToValidate="txtT1_EndTm" IsValidEmpty="false" MaximumValue="23:59:59" MinimumValue="00:00:00"
                                          EmptyValueMessage="Enter Time" MaximumValueMessage="23:59:59" InvalidValueBlurredMessage="Time is Invalid"
                                          MinimumValueMessage="Time must be grater than 00:00:00" EmptyValueBlurredText="Null Time"
                                          ToolTip="Enter time between 00:00:00 to 23:59:59"></asp:MaskedEditValidator>
                                          </ItemTemplate>
                                          </asp:TemplateField>


                                          <asp:TemplateField HeaderText="Spl.End Time">
                                          <ItemTemplate>
                                          <asp:TextBox ID="txtSpl_EndTm" runat="server" CssClass="textbox" Text='<%#Eval("Special_EndTm","{0:HH:mm:ss}") %>'   Width="70px"></asp:TextBox>

                                           <asp:MaskedEditExtender ID="MaskedEditExtender5" runat="server" TargetControlID="txtSpl_EndTm"
                                          Mask="99:99:99" MessageValidatorTip="true" MaskType="Time" InputDirection="RightToLeft"
                                          ErrorTooltipEnabled="True" />
                                          <asp:MaskedEditValidator ID="MaskedEditValidator5" runat="server" ControlExtender="MaskedEditExtender5"
                                          ControlToValidate="txtSpl_EndTm" IsValidEmpty="false" MaximumValue="23:59:59" MinimumValue="00:00:00"
                                          EmptyValueMessage="Enter Time" MaximumValueMessage="23:59:59" InvalidValueBlurredMessage="Time is Invalid"
                                          MinimumValueMessage="Time must be grater than 00:00:00" EmptyValueBlurredText="Null Time"
                                          ToolTip="Enter time between 00:00:00 to 23:59:59"></asp:MaskedEditValidator>
                                          </ItemTemplate>
                                          </asp:TemplateField>



                                                
                                          <asp:TemplateField HeaderText="Active">
                                          <ItemTemplate>
                                          
                                          
                                          <asp:CheckBox ID="ChoiceCheckBox" runat="server" Checked='<%# Eval("Active").ToString().Equals("1") %>'/>
                                          </ItemTemplate>
                                          </asp:TemplateField>


                                          <asp:TemplateField HeaderText="Status" >
                                          <ItemTemplate>
                                          <asp:Label ID="lblStatusText" runat="server" Text='<%#Eval("StatusText") %>'></asp:Label>
                                          </ItemTemplate>
                                          </asp:TemplateField>

                                         <asp:TemplateField HeaderText="IsSpl_Hours" >
                                         <ItemTemplate>
                                          <asp:CheckBox  ID="ChoiceCheckBox5" runat="server" Checked='<%# Eval("IsSpecialHours").ToString().Equals("1") %>'/>
                                          </ItemTemplate>
                                          </asp:TemplateField>
                                                

                                          
                                          </Columns>
                                         <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                                         <RowStyle ForeColor="#000066" />
                                         <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                                         <SortedAscendingCellStyle BackColor="#F1F1F1" />
                                         <SortedAscendingHeaderStyle BackColor="#007DBB" />
                                         <SortedDescendingCellStyle BackColor="#CAC9C9" />
                                         <SortedDescendingHeaderStyle BackColor="#00547E" />
                                         </asp:GridView>
                                        <br />
                                        <h7>Note : 1. If EndTime falls within this day .Give the Time value in <span style="color:green"> EndTime</span> ,and the  <span style="color:purple"> IsSpl Hours</span> should be Disable. <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.If EndTime falls today's Time and Tomorrow's Time Give the Time Value in <span style="color:green"> Spl.EndTime</span>. and the <span style="color:purple">IsSpl Hours</span> should Enable </h7>
                                    </caption>
                                </tbody>
                            </table>
                    <br />
                    <div class="form-row">
                    <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                    <asp:Button ID="btnSave" runat="server" Text="Apply" ToolTip="To click to update Operation Hours" onclick="btnSave_Click" CssClass="btn btn-primary" />
                    </div>
                    </div>

                   </div>

                                                 
             </div>
             </div>
                                
                                

            </div>

            </div> 

       <%--ShiftType(Ini-63) : Operative Hours with BreakTime Between CurrentDay's Time and Next Day'S Time --%>
       <div class="row" id="Type2" runat="server">
     
       <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
       <div class="card">
       <h5 class="card-header" style="background-color: #4c4c4c; font-size: 14px; color: #F8F9FA">OPERATION SHIFT HOURS &nbsp;&nbsp;</h5>
                                  
       
       <div class="card-body">
        <div class="table-responsive" style=" width: 100%;">
            
                <table id="example5" class="table table-striped table-bordered" style="width:100%">
                    <tbody>
                       
                        <caption>
                            <asp:GridView ID="grdShiftOperativeHours" runat="server" ShowFooter="true" BorderColor="Transparent"
                                DataKeyNames="id" AutoGenerateColumns="false" Font-Size="14px"
                                Width="100%" AllowPaging="True" PageSize="20" EmptyDataText="No Record  ! " OnRowDataBound="grdShiftOperativeHours_RowDataBound">
                                <HeaderStyle CssClass="dataTable" />
                                <HeaderStyle BackColor="White" ForeColor="Black" />
                                <FooterStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                                <RowStyle CssClass="dataTable" />
                                <Columns>
                               <asp:TemplateField>  
                               <HeaderTemplate>   
                               <asp:CheckBox ID="chkAllSelect" runat="server" onclick="CheckAll(this);" Visible="false" />  
                               </HeaderTemplate>  
                               <ItemTemplate>  
                               <asp:CheckBox ID="chkSelect" runat="server" Checked="true" Visible="false"/>  
                               </ItemTemplate>  
                               </asp:TemplateField>  

                               <asp:TemplateField HeaderText="SNo">
                               <ItemTemplate>
                               <%#Container.DataItemIndex+1 %>
                               </ItemTemplate>
                               </asp:TemplateField>
                               <asp:TemplateField HeaderText="Id" Visible="false">
                               <ItemTemplate>
                               <asp:Label ID="lblid" runat="server" Text='<%#Eval("id") %>'></asp:Label>
                               </ItemTemplate>
                               </asp:TemplateField>

                              <asp:TemplateField HeaderText="Days" >
                              <ItemTemplate>
                              <asp:Label ID="lblDays" runat="server" Text='<%#Eval("Days") %>'></asp:Label>
                              </ItemTemplate>
                              </asp:TemplateField>

                              <asp:TemplateField HeaderText="Shift I">
                              <ItemTemplate>
                              <asp:CheckBox ID="Shift1CheckBox" runat="server" Checked='<%# Eval("Shift1").ToString().Equals("1") %>'/>
                              </ItemTemplate>
                              </asp:TemplateField>
                              <asp:TemplateField HeaderText="Shift-I StartTime" >
                              <ItemTemplate>
                              <asp:TextBox ID="txtTriggerTime_S1" runat="server" CssClass="textbox" Text='<%#Eval("TriggerTime_S1","{0:HH:mm:ss}") %>'   Width="70px"></asp:TextBox>


                              <asp:MaskedEditExtender ID="MaskedEditExtender4" runat="server" TargetControlID="txtTriggerTime_S1"
                              Mask="99:99:99" MessageValidatorTip="true" MaskType="Time" InputDirection="RightToLeft"
                              ErrorTooltipEnabled="True" />
                              <asp:MaskedEditValidator ID="MaskedEditValidator4" runat="server" ControlExtender="MaskedEditExtender4"
                              ControlToValidate="txtTriggerTime_S1" IsValidEmpty="false" MaximumValue="23:59:59" MinimumValue="00:00:00"
                              EmptyValueMessage="Enter Time" MaximumValueMessage="23:59:59" InvalidValueBlurredMessage="Time is Invalid"
                              MinimumValueMessage="Time must be grater than 00:00:00" EmptyValueBlurredText="Null Time"
                              ToolTip="Enter time between 00:00:00 to 23:59:59"></asp:MaskedEditValidator>
                              </ItemTemplate>
                              </asp:TemplateField>
                              <asp:TemplateField HeaderText="Shift-I End Time">
                              <ItemTemplate>
                              <asp:TextBox ID="txtTriggerTime_E1" runat="server" CssClass="textbox" Text='<%#Eval("TriggerTime_E1","{0:HH:mm:ss}") %>'   Width="70px"></asp:TextBox>
                             <asp:MaskedEditExtender ID="MaskedEditExtender5" runat="server" TargetControlID="txtTriggerTime_E1"
                              Mask="99:99:99" MessageValidatorTip="true" MaskType="Time" InputDirection="RightToLeft"
                              ErrorTooltipEnabled="True" />
                              <asp:MaskedEditValidator ID="MaskedEditValidator5" runat="server" ControlExtender="MaskedEditExtender5"
                              ControlToValidate="txtTriggerTime_E1" IsValidEmpty="false" MaximumValue="23:59:59" MinimumValue="00:00:00"
                              EmptyValueMessage="Enter Time" MaximumValueMessage="23:59:59" InvalidValueBlurredMessage="Time is Invalid"
                              MinimumValueMessage="Time must be grater than 00:00:00" EmptyValueBlurredText="Null Time"
                              ToolTip="Enter time between 00:00:00 to 23:59:59"></asp:MaskedEditValidator>
                              </ItemTemplate>
                              </asp:TemplateField>

                            <asp:TemplateField HeaderText="Shift II">
                            <ItemTemplate>
                            <asp:CheckBox ID="Shift2CheckBox" runat="server" Checked='<%# Eval("Shift2").ToString().Equals("1") %>'/>
                            </ItemTemplate>
                            </asp:TemplateField>
                               
                          <asp:TemplateField HeaderText="Shift-II StartTime" >
                          <ItemTemplate>
                          <asp:TextBox ID="txtTriggerTime_S2" runat="server" CssClass="textbox" Text='<%#Eval("TriggerTime_S2","{0:HH:mm:ss}") %>'   Width="70px"></asp:TextBox>


                             <asp:MaskedEditExtender ID="MaskedEditExtender6" runat="server" TargetControlID="txtTriggerTime_S2"
                              Mask="99:99:99" MessageValidatorTip="true" MaskType="Time" InputDirection="RightToLeft"
                              ErrorTooltipEnabled="True" />
                              <asp:MaskedEditValidator ID="MaskedEditValidator6" runat="server" ControlExtender="MaskedEditExtender6"
                              ControlToValidate="txtTriggerTime_S2" IsValidEmpty="false" MaximumValue="23:59:59" MinimumValue="00:00:00"
                              EmptyValueMessage="Enter Time" MaximumValueMessage="23:59:59" InvalidValueBlurredMessage="Time is Invalid"
                              MinimumValueMessage="Time must be grater than 00:00:00" EmptyValueBlurredText="Null Time"
                              ToolTip="Enter time between 00:00:00 to 23:59:59"></asp:MaskedEditValidator>
                              </ItemTemplate>
                              </asp:TemplateField>
                              <asp:TemplateField HeaderText="Shift-II End Time">
                              <ItemTemplate>
                              <asp:TextBox ID="txtTriggerTime_E2" runat="server" CssClass="textbox" Text='<%#Eval("TriggerTime_E2","{0:HH:mm:ss}") %>'   Width="70px"></asp:TextBox>
                             <asp:MaskedEditExtender ID="MaskedEditExtender7" runat="server" TargetControlID="txtTriggerTime_E2"
                              Mask="99:99:99" MessageValidatorTip="true" MaskType="Time" InputDirection="RightToLeft"
                              ErrorTooltipEnabled="True" />
                              <asp:MaskedEditValidator ID="MaskedEditValidator7" runat="server" ControlExtender="MaskedEditExtender7"
                              ControlToValidate="txtTriggerTime_E2" IsValidEmpty="false" MaximumValue="23:59:59" MinimumValue="00:00:00"
                              EmptyValueMessage="Enter Time" MaximumValueMessage="23:59:59" InvalidValueBlurredMessage="Time is Invalid"
                              MinimumValueMessage="Time must be grater than 00:00:00" EmptyValueBlurredText="Null Time"
                              ToolTip="Enter time between 00:00:00 to 23:59:59"></asp:MaskedEditValidator>
                              </ItemTemplate>
                              </asp:TemplateField>
                             </Columns>
                             <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                             <RowStyle ForeColor="#000066" />
                             <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                             <SortedAscendingCellStyle BackColor="#F1F1F1" />
                             <SortedAscendingHeaderStyle BackColor="#007DBB" />
                             <SortedDescendingCellStyle BackColor="#CAC9C9" />
                             <SortedDescendingHeaderStyle BackColor="#00547E" />
                             </asp:GridView>
                            <br />
                            <asp:Label ID="lblShiftOperativeHrs" runat="server" ForeColor="Green"></asp:Label>

                           <%--  <h5>Note : 1. If EndTime falls within this day .Give the Time value in <span style="color:green"> EndTime</span> ,and the  <span style="color:purple"> IsSpl Hours</span> should be Disable. <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.If EndTime falls today's Time and Tomorrow's Time Give the Time Value in <span style="color:green"> Spl.EndTime</span>. and the <span style="color:purple">IsSpl Hours</span> should Enable </h5>--%>
                        </caption>
                    </tbody>
                </table>
                
           

         <br />
        <div class="form-row">
        <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
        <asp:Button ID="btnSave2" runat="server" Text="Apply" ToolTip="To click to update Shift Operation Hours" onclick="btnSave2_Click" CssClass="btn btn-primary" />
        </div>
        </div>

       </div>

                                     
    </div>
    </div>
                    
                    

       </div>

</div>
           




     </ContentTemplate>
     </asp:UpdatePanel>

<script src="https://code.jquery.com/jquery-3.7.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css?v=1.1" rel="stylesheet" />
<!-- Bootstrap 5 -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" />
<!-- Optional Bootstrap Icons -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css" rel="stylesheet" />


</asp:Content>
