<%@ Page Title="Price Switch" Language="C#" MasterPageFile="~/SunMaster.Master" AutoEventWireup="true" CodeBehind="PriceSwitch.aspx.cs" Inherits="SUNWEB.PriceSwitch" %>
<%@ Register Assembly="AjaxControlToolkit" TagPrefix="asp" Namespace="AjaxControlToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
  <link rel="Start" href="../css/GridPager.css" type="text/css"/>


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

         $(document).ready(function () {
        
         var ChkValue = localStorage.getItem("Cvalue");
         if (ChkValue == "C") {
             ShowGroupModal();
         }
        
        });

     </script>


    <script language="javascript" type="text/javascript">
        function show() {
            document.write("<head></head>");
        }
    </script>

      <script type="text/javascript">

          //Search Condiment
          function CloseModal()
          {
              var modal = document.getElementById("ModaInventoruList");
              modal.style.display = "none";
          }
          function ShowModalInventoryList()
          {
              var modal = document.getElementById("ModaInventoruList");
              modal.style.display = "block";
          }

          function CloseGroupModal() {
              var modal = document.getElementById("ModalGroup");
              modal.style.display = "none";
          }
          function ShowGroupModal() {
              var modal = document.getElementById("ModalGroup");
              modal.style.display = "block";
              localStorage.removeItem("Cvalue");
          }



          function ShowCreatePriceswitchModal() {
              var modal = document.getElementById("ModalCreatePriceSwitch");
              modal.style.display = "block";
              
          }

          function CloseCreatePriceSwitchModal() {
              var modal = document.getElementById("ModalCreatePriceSwitch");
              modal.style.display = "none";
          }

          
          function Alermsg()
          {
              console.log("My Message..");
              alert("Alert called ...");
          }
          



          function validate5()
          {
              if (document.getElementById("<%=txtGroupName.ClientID %>").value == "")
              {

                  alert("Enter the GroupName");
                  document.getElementById("<%=txtGroupName.ClientID %>").focus();
                  return false;
              }

          }

          function refershingpage()
          {
              localStorage.setItem("Cvalue", "C");
              location.href = 'PriceSwitch.aspx';
              
          }

         

      </script>

     <style type="text/css">
     @media only screen and (max-width: 600px) 
     {
      table, th, td
      {
      font-size: 10px;
      font-weight: bold;
      }

     .modalPopup 
     {
      background-color: #FFFFFF;
      border-width: 3px;
      border-style: solid;
      border-color: black;
      padding-top: 10px;
      padding-left: 10px;
      width: 320px;
      height: 300px;
      }
     }
 </style>
 <style type="text/css">
     /*Popup Control*/ .popupControl {
         background-color: White;
         position: absolute;
         visibility: hidden;
     }

     .closeLabel {
         background-color: #666666;
         color: #FFFFFF;
         text-align: center;
         font-weight: bold;
         text-decoration: none;
         border: outset thin #FFFFFF;
         padding: 5px;
         cursor: pointer;
     }
 </style>
 <style type="text/css">
     @media only screen and (max-width: 600px) {
         div {
             text-align: left;
         }
     }

     #container {
         width: 98%; /*border-radius: 25px;*/
         border: 0px solid white;
         padding: 0px 0px 0px 0px;
         margin: 0px 0px 0px 0px;
         background: #FFFFFF;
         overflow: visible; /* box-shadow: 5px 5px 2px #888888;*/
         position: relative;
     }

     .mdalbuttonX {
         position: absolute;
         background: white;
         color: black;
         border: none;
         top: -10px;
         right: -5px;
         font-size: 20px;
         font-weight: 900;
     }

     .modX {
         position: absolute;
         background: #4c4c4c;
         color: white;
         border: none;
         top: 10px;
         right: 15px;
         font-size: 20px;
         font-weight: 900;
     }
 </style>

 <%--Newly added css on 22-05-21 --%>
 <style type="text/css">
     /*Popup Control*/ .popupControl {
         background-color: White;
         position: absolute;
         visibility: hidden;
     }

     .closeLabel {
         background-color: #666666;
         color: #FFFFFF;
         text-align: center;
         font-weight: bold;
         text-decoration: none;
         border: outset thin #FFFFFF;
         padding: 5px;
         cursor: pointer;
     }
 </style>
 <style type="text/css">
     body {
         font-family: Arial;
         font-size: 10pt;
     }

     .modalBackground {
         background-color: #F7F7F7;
         filter: alpha(opacity=90);
         opacity: 0.8;
     }

     .modalPopup {
         background-color: white;
         border: 3px solid #ccc;
         padding: 10px;
         width: 720px;
         height: 450px;
     }



     .modalPopup1 {
         background-color: white;
         border: 3px solid #ccc;
         padding: 10px;
         width: 1000px;
         height: 850px;
         bottom: 20px;
     }

     .modalPopup2 {
         background-color: white;
         border: 3px solid #ccc;
         padding: 10px;
         width: 690px;
         height: 410px;
     }

     .modalPopup3 {
         background-color: white;
         border: 3px solid #ccc;
         padding: 10px;
         width: 600px;
         height: 390px;
     }



     .modalPopupsmall {
         background-color: white;
         border: 3px solid #ccc;
         padding: 10px;
         width: 550px;
         height: 230px;
     }
 </style>

 <style>
     @media only screen and (min-device-width : 320px) and (max-device-width : 428px) {

         .ButtonExcel {
             font-size: 13px;
             border: medium;
             font-family: Circular Std Book;
             border: none;
             color: white;
             background-color: Green;
             text-align: center;
             border-radius: 0px;
         }

         .ButtonSearch {
             font-size: 18px;
             border: medium;
             font-family: Circular Std Book;
             border: none;
             color: white;
             background-color: #1874CD;
             text-align: center;
             border-radius: 0px;
             border: 3px solid black;
             width: 35%;
             margin-bottom: 7px;
         }

         .LableTitle {
             font-size: 20px;
             font-weight: 500;
         }

         .modalCss {
             display: none; /* Hidden by default */
             position: fixed; /* Stay in place */
             z-index: 1; /* Sit on top */
             padding-top: 80px; /* Location of the box */
             left: 0;
             top: 0;
             width: 80%; /* Full width */
             height: 80%; /* Full height */
             overflow: auto; /* Enable scroll if needed */
             background-color: rgb(0,0,0); /* Fallback color */
             background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
         }



         .modal-dialogCss {
         }

         /* Modal Content */
         .modal-contentCss {
             background-color: #fefefe;
             margin: auto;
             /*padding: 20px;*/
             /*border: 1px solid #888;*/
             width: 500px;
             height: 6+0px;
             border-radius: 3px;
         }


         /* Create two equal columns that floats next to each other */
         .column {
             float: left;
             width: 40%;
             padding: 1px;
             height: auto; /* Should be removed. Only for demonstration */
         }

         /* Clear floats after the columns */
         .row:after {
             content: "";
             display: table;
             clear: both;
         }
     }

     @media screen and (min-width: 1200px) {

         .ButtonExcel {
             font-size: 14px;
             border: medium;
             font-family: Circular Std Book;
             border: none;
             color: white;
             font-weight: lighter;
             background-color: Green;
             text-align: center;
             border-radius: 2px;
         }

         .ButtonSearch {
             background: #ffc108;
             margin: 0;
             font-family: Circular Std Book;
             font-size: 14px;
             line-height: inherit;
             border-width: thin;
             border-color: #212529;
             border-radius: 2px;
             color: #212529;
         }

         .LableTitle {
             font-size: 28px;
             font-weight: 500;
         }



         .modalCss {
             display: none; /* Hidden by default */
             position: fixed; /* Stay in place */
             z-index: 1; /* Sit on top */
             padding-top: 80px; /* Location of the box */
             left: 0;
             top: 0;
             width: 100%; /* Full width */
             height: 100%; /* Full height */
             overflow: auto; /* Enable scroll if needed */
             background-color: rgb(0,0,0); /* Fallback color */
             background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
         }



         .modal-dialogCss {
         }

         /* Modal Content */
         .modal-contentCss {
             background-color: #fefefe;
             margin: auto;
             /*padding: 20px;*/
             /*border: 1px solid #888;*/
             width: 1200px;
             height: 850px;
             border-radius: 3px;
         }


         /* Create two equal columns that floats next to each other */
         .column {
             float: left;
             width: 40%;
             padding: 1px;
             height: auto; /* Should be removed. Only for demonstration */
         }

         /* Clear floats after the columns */
         .row:after {
             content: "";
             display: table;
             clear: both;
         }
     }
 </style>


 <style type="text/css">
     .modalCss {
         display: none; /* Hidden by default */
         position: fixed; /* Stay in place */
         z-index: 1; /* Sit on top */
         padding-top: 80px; /* Location of the box */
         left: 0;
         top: 0;
         width: 100%; /* Full width */
         height: 100%; /* Full height */
         overflow: auto; /* Enable scroll if needed */
         background-color: rgb(0,0,0); /* Fallback color */
         background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
     }



     .modal-dialogCss {
     }

     /* Modal Content */
     .modal-contentCss {
         background-color: #fefefe;
         margin: auto;
         /*padding: 20px;*/
         /*border: 1px solid #888;*/
         width: 1200px;
         height: 820px;
         border-radius: 3px;
     }


     /* Create two equal columns that floats next to each other */
     .column {
         float: left;
         width: 40%;
         padding: 2px;
         margin-left: 7px;
         height: auto; /* Should be removed. Only for demonstration */
     }

     /* Clear floats after the columns */
     .row:after {
         content: "";
         display: table;
         clear: both;
     }

     .ButtonSearch {
         background: #ffc108;
         margin: 0;
         font-family: Circular Std Book;
         font-size: 14px;
         line-height: inherit;
         border-width: thin;
         border-color: #212529;
         border-radius: 2px;
         color: #212529;
     }

     /*Model Css for Import And Export  */


     .modalCss1 {
         display: none; /* Hidden by default */
         position: fixed; /* Stay in place */
         z-index: 1; /* Sit on top */
         padding-top: 80px; /* Location of the box */
         left: 0;
         top: 0;
         width: 100%; /* Full width */
         height: 100%; /* Full height */
         overflow: auto; /* Enable scroll if needed */
         background-color: rgb(0,0,0); /* Fallback color */
         background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
     }



     .modal-dialogCss1 {
     }

     /* Modal Content */
     .modal-contentCss1 {
         background-color: #fefefe;
         margin: auto;
         /*padding: 20px;*/
         /*border: 1px solid #888;*/
         width: 800px;
         height: 300px;
         border-radius: 3px;
     }


     /* Create two equal columns that floats next to each other */
     .column1 {
         float: left;
         width: 40%;
         padding: 2px;
         margin-left: 7px;
         height: auto; /* Should be removed. Only for demonstration */
     }

     /* Clear floats after the columns */
     .row:after {
         content: "";
         display: table;
         clear: both;
     }

     .ButtonSearch {
         background: #ffc108;
         margin: 0;
         font-family: Circular Std Book;
         font-size: 14px;
         line-height: inherit;
         border-width: thin;
         border-color: #212529;
         border-radius: 2px;
         color: #212529;
     }

     .Excelcss {
         background: green;
         margin: 0;
         font-family: Circular Std Book;
         font-size: 12px;
         line-height: inherit;
         border-width: thin;
         border-color: #212529;
         border-radius: 2px;
         color: white;
         height: 28px;
         display:inline-block;
     }

     .Heading {
         /*
       font-family: Circular Std Book;
       font-size: 25px;
       color:Black;
       padding:20px;
       padding-bottom:10px;
       */
         font-family: arial;
         font-size: 20px;
         font-weight: 600;
         color: Black;
         padding: 20px;
         padding-bottom: 10px;
     }

     .Para {
         /*
       font-family: Circular Std Book;
       font-size: 12px;
       color:Black;
       padding:20px;
       padding-bottom:0px;
       */
         font-family: arial;
         color: Black;
         padding: 20px;
         padding-bottom: 10px;
         line-height: 1.2;
     }

     .Para5 {
         font-family: arial;
         color: red;
         padding: 20px;
         padding-bottom: 10px;
         line-height: 0.5;
     }

     .Parax {
         font-family: arial;
         color: darkred;
         padding: 20px;
         padding-bottom: 5px;
         line-height: 1.2;
         width: 100%;
     }


     .Para2 {
         /*
       font-family: Circular Std Book;
       font-size: 12px;
       color:Black;
       padding:20px;
       padding-bottom:0px;
       */
         font-family: arial;
         color: Black;
         padding: 20px;
         padding-bottom: 0px;
         line-height: 1.2;
     }


     .ExcelContend {
         font-family: Circular Std Book;
         padding: 15px;
         margin-top: -22px;
     }

     .UploadFileBTN {
         background: red;
         font-family: Circular Std Book;
         font-size: 12px;
         color: white;
         height: 28px;
     }

     .UploadFile {
         padding: 20px;
     }


     .Continue {
         background: #CD3700;
         margin: 0;
         font-family: Circular Std Book;
         font-size: 13px;
         line-height: inherit;
         border-width: thin;
         border-color: #212529;
         border-radius: 5px;
         color: white;
         height: 35px;
         width: 10%;
     }
 </style>


  <%--Grid Pager style :--%>
 <style type="text/css">
    .overlay {
        position: fixed;
        top: 0px;
        left: 0px;
        z-index: 0;
        height: 100%;
        width: 100%;
        top: 0;
        background-color: White;
        filter: alpha(opacity=60);
        opacity: 0.9;
        _smoz-opacity: 1;
    }

    .LoadingDivCss {
        margin: 0;
        position: absolute;
        top:70%;
        left: 50%;
        margin-right: -50%;
        transform: translate(-50%, -50%);
    }

    .LoadingImgCss {
        height: 100px;
        width: 100px;
    }

    .label5{
          display: inline-block;
          vertical-align: middle;
          margin: 10px 0;
         }
</style>

    

<style>
        .GridPager a,
        .GridPager span {
            display: inline-block;
            padding: 0px 9px;
            margin-right: 4px;
            border-radius: 3px;
            border: solid 1px #c0c0c0;
            background: #e9e9e9;
            box-shadow: inset 0px 1px 0px rgba(255,255,255, .8), 0px 1px 3px rgba(0,0,0, .1);
            font-size: .875em;
            font-weight: bold;
            text-decoration: none;
            color: #717171;
            text-shadow: 0px 1px 0px rgba(255,255,255, 1);
        }

        .GridPager a {
            background-color: #f5f5f5;
            color: #969696;
            border: 1px solid #969696;
        }

        .GridPager span {

            background: #616161;
            box-shadow: inset 0px 0px 8px rgba(0,0,0, .5), 0px 1px 0px rgba(255,255,255, .8);
            color: #f0f0f0;
            text-shadow: 0px 0px 3px rgba(0,0,0, .5);
            border: 1px solid #3AC0F2;
        }

    </style>

   
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    
<asp:UpdatePanel runat="server" ID="updatepanel1" UpdateMode="Conditional">
  <ContentTemplate>
      
       <%--<div class="row">
                 
                <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
               <div class="card">

                   <div class="card-body">


                       <div class="form-row">
                           <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                               <caption>
                                   <label for="validationCustom03">
                                       FROM DATE
                                   </label>
                                   <asp:TextBox ID="txtStartDt" class="form-control" runat="server"></asp:TextBox>
                                   <asp:CalendarExtender ID="calFirstDueDate" Format="yyyy-MM-dd" runat="server" TargetControlID="txtStartDt" PopupPosition="BottomLeft" FirstDayOfWeek="Sunday"></asp:CalendarExtender>

                               </caption>



                           </div>
                           <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                               <label for="validationCustom03">
                                   TO DATE
                               </label>

                               <asp:TextBox ID="txtEndDt" class="form-control" runat="server"></asp:TextBox>
                               <asp:CalendarExtender ID="CalendarExtender1" Format="yyyy-MM-dd" runat="server" TargetControlID="txtEndDt" PopupPosition="BottomLeft" FirstDayOfWeek="Sunday"></asp:CalendarExtender>



                           </div>
                           <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                               <label for="validationCustom03">
                                   <asp:Label ID="lblBranchAliasName" ForeColor="Gray" runat="server" Text="Branch Name"></asp:Label></label>
                               <asp:DropDownList ID="cmbBranches" CssClass="custom-select"
                                   runat="server" AutoPostBack="true"
                                   OnSelectedIndexChanged="cmbBranches_SelectedIndexChanged">
                               </asp:DropDownList>
                           </div>

                           <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">

                               <asp:Button ID="btnGetReports" runat="server" Text="Apply"
                                   CssClass="btn btn-primary" OnClick="btnGetReports_Click" OnClientClick="return validate()" />

                           </div>
                       </div>

                   </div>

               </div>
           </div>
       </div>--%>


      <div class="container-fluid">
    <div class="row mb-3 align-items-center">
        <!-- Left side: Heading -->
        <div class="col-md-6 col-12">
        <%--    <h7 class="mb-0"> PRICE SWITCH</h7>--%>
        </div>

        <!-- Right side: Branch Dropdown aligned to right -->
        <div class="col-md-6 col-12">
            <div class="d-flex justify-content-md-end justify-content-start align-items-center mt-2 mt-md-0">
                <label for="cmbBranches" class="form-label me-2 mb-0">
                    Branch <asp:Label ID="lblBranchAliasName" runat="server"></asp:Label>
                </label>
                <asp:DropDownList ID="cmbBranches"
                    runat="server"
                    CssClass="form-select"
                    Style="width: 200px;"
                    AutoPostBack="true"
                    OnSelectedIndexChanged="cmbBranches_SelectedIndexChanged">
                </asp:DropDownList>
            </div>
        </div>
    </div>
</div>


     


      <div class="row"  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">PRICE SWITCH &nbsp;&nbsp;
           <button type="button" onclick="ShowModalInventoryList()" class="btn btn-warning">Search</button>
           <button type="button" onclick="ShowGroupModal()" class="btn btn-warning">Price Group</button>
           </h5>
              
  


           <div class="card-body">
           <div class="table-responsive">


               <!-- Select All button aligned to right -->
               <div style="text-align: right; margin-bottom: 10px;">
                   <asp:Button ID="btnToggle" runat="server"
                       Text="Select All" CssClass="btn btn-primary"
                       OnClick="btnToggle_Click" />
               </div>

           <table id="example4" class="table table-striped table-bordered">
                               <tbody>
                               <caption>
                             
                                
                               <asp:GridView ID="grdPriceSwitch" runat="server" ShowFooter="true" BorderColor="Transparent"
                                DataKeyNames="Inventoryid" AutoGenerateColumns="false" Font-Size="14px" OnRowDataBound="grdPriceSwitch_RowDataBound"
                                OnRowCommand="grdPriceSwitch_RowCommand" OnPageIndexChanging="grdPriceSwitch_PageIndexChanging"
                                Width="90%" AllowPaging="True" PageSize="1000" EmptyDataText="No Record  ! " >
                                <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="PriceGroup" Visible="true" HeaderStyle-VerticalAlign="Middle">
                              <ItemTemplate>
                              <asp:Label ID="lblGroupName" runat="server" Text='<%#Eval("GroupName") %>'></asp:Label>
                              </ItemTemplate>
                              </asp:TemplateField>

                              <asp:TemplateField HeaderText="Inventoryid" Visible="false" HeaderStyle-Width="40px" ItemStyle-VerticalAlign="Middle" ItemStyle-HorizontalAlign="Center">
                              <ItemTemplate>
                              <asp:Label ID="lblInventoryid" Width="40px"  runat="server" Text='<%#Eval("Inventoryid") %>'></asp:Label>
                              </ItemTemplate>
                              </asp:TemplateField>
                             <asp:TemplateField HeaderText="Barcode" >
                              <ItemTemplate>
                              <asp:Label ID="lblBarcode" runat="server" Text='<%#Eval("Barcode") %>'></asp:Label>
                              </ItemTemplate>
                              </asp:TemplateField>
                             <asp:TemplateField HeaderText="InventoryName" >
                             <ItemTemplate>
                             <asp:Label ID="lblInventoryName" runat="server" Text='<%#Eval("InventoryName") %>'></asp:Label>
                             </ItemTemplate>
                             </asp:TemplateField>

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

                              <asp:TemplateField HeaderText="SwitchPrice"  HeaderStyle-Width="70px">
                             <ItemTemplate>
                             <asp:Label ID="lblSwitchPrice" runat="server" Text='<%#Eval("SwitchPrice") %>'></asp:Label>
                             <asp:DropDownList ID="cmbPriceswitch" Width="100px" CssClass="custom-select" runat="server" AutoPostBack="true">
                             </asp:DropDownList>
                             </ItemTemplate>
                             </asp:TemplateField>

                              <asp:TemplateField HeaderText="Start Time"   HeaderStyle-Width="40px">
                              <ItemTemplate>
                              <asp:TextBox ID="txtT1_StTm" runat="server" CssClass="textbox" Text='<%#Eval("Start_Tm","{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"  HeaderStyle-Width="40px">
                             <ItemTemplate>
                             <asp:TextBox ID="txtT1_EndTm" runat="server" CssClass="textbox" Text='<%#Eval("End_Tm","{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="Active" ItemStyle-HorizontalAlign="Center"  HeaderStyle-Width="40px">
                              <ItemTemplate>
                              
                               <asp:CheckBox ID="ChoiceCheckBox" runat="server" Checked='<%# Eval("IsEnable").ToString().Equals("1") %>'/>
                              <%-- <asp:Label ID="lblIsEnable" runat="server" Text='<%#Eval("IsEnable") %>'></asp:Label>--%>
                              </ItemTemplate>
                              </asp:TemplateField>

                             <asp:TemplateField ItemStyle-Width="50px">
                             <ItemTemplate>
                             <asp:Button ID="btnSelect"  CommandArgument="<%# ((GridViewRow) Container).RowIndex %>"  
                              runat="server" Width="60" CssClass="btn btn-success" Text="Edit"
                              CommandName="Select"  />
                             </ItemTemplate>
                             </asp:TemplateField>


                             <asp:TemplateField ItemStyle-Width="50px">
                             <ItemTemplate>
                             <asp:Button ID="btnDelete" runat="server" CssClass="btn btn-danger" Text="Delete"
                             CommandName="Delete" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>" 
                             OnClientClick="return confirm('Are you sure you want to delete this item?');" />
                             </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 />
                            
                        </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 save PriceSwitch" onclick="btnSave_Click" CssClass="btn btn-primary" />
           </div>
           </div>

           </div>

                                     
           </div>
           </div>
                    
                    

           </div>

     </div>





  <div class="modalCss" id="ModaInventoruList">
    <div class="modal-dialogCss">
        <div class="modal-contentCss" style="width:92%;">
            <%--    <div class="modal-header">
            </div>--%>
            <div class="modal-body" style="padding: 0px;">


                <div class="card" >
                    <h7 class="card-header" style="background-color: #4c4c4c; color: White;">SEARCH INVENTORY  
                        <button type="button" class="close" style="color: White; opacity: 1;" onclick="CloseModal()" data-dismiss="modal">
                         &times;</button></h7>
                    <div class="card-body">
                        <div class="row">
                            <div class="column">
                                <label for="validationCustom03">
                                    Search Type
                                </label>
                                <asp:DropDownList ID="cmbSearch" CssClass="form-select w-25" OnSelectedIndexChanged="cmbSearch_SelectedIndexChanged" 
                                    runat="server" AutoPostBack="true">
                                    <asp:ListItem Value="0" Text="Select"></asp:ListItem>
                                    <asp:ListItem Value="1" Text="Inventory Id"></asp:ListItem>
                                    <asp:ListItem Value="2" Text="Barcode"></asp:ListItem>
                                    <asp:ListItem Value="3" Text="Inventory Name"></asp:ListItem>
                                    <asp:ListItem Value="4" Text="Description"></asp:ListItem>
                                    <asp:ListItem Value="5" Text="Price"></asp:ListItem>
                                    <asp:ListItem Value="6" Text="Category Type"></asp:ListItem>
                                    <asp:ListItem Value="7" Text="Master Barcode"></asp:ListItem>
                                    <asp:ListItem Value="8" Text="Group1"></asp:ListItem>
                                    <asp:ListItem Value="9" Text="Group2"></asp:ListItem>
                                    <asp:ListItem Value="10" Text="Group3"></asp:ListItem>
                                    <asp:ListItem Value="11" Text="Group4"></asp:ListItem>
                                    <asp:ListItem Value="12" Text="Group5"></asp:ListItem>
                                    <asp:ListItem Value="13" Text="Promo Items"></asp:ListItem>
                                    <asp:ListItem Value="14" Text="TakeAway"></asp:ListItem>
                                    <asp:ListItem Value="15" Text="StockCode"></asp:ListItem>
                                </asp:DropDownList>

                            </div>

                            <div class="column">
                                <label for="validationCustom03">
                                    Enter Description
                                </label>
                                <asp:TextBox ID="txtSearchVal" class="form-control w-25" runat="server" OnTextChanged="txtSearchVal_TextChanged"></asp:TextBox>


                            </div>


                        </div>
                        <div class="row">
                            <div class="column">
                                <asp:CheckBox ID="chkActiveonly" runat="server" Checked="true" />
                                <span>Active Only</span>
                            </div>

                        </div>


                        <div class="row">
                            <div class="column">
                                <asp:Button ID="btnSearch" runat="server" Text="Apply" CssClass="btn btn-primary" OnClick="btnSearch_Click" />
                            </div>
                        </div>
                    </div>


                </div>
                <div>
                    <div class="table-responsive" style="padding: 0px 20px 0px 20px;">
                        <label for="validationCustom03">
                            Search Result:
                        </label>
                     <table id="Table3" class="table table-striped table-bordered second">
                            <tbody>
                                <caption>

                                    <asp:Panel ID="Panel8" runat="server" BackColor="white" Height="480px" ScrollBars="Auto"
                                        Width="1650px">
                                        <asp:GridView ID="grdInventoryView" runat="server" AutoGenerateColumns="False" EmptyDataRowStyle-CssClass="alert-dark"
                                            Font-Size="11px" HeaderStyle-BackColor="RoyalBlue" EmptyDataText="No Record Found ! "
                                            DataKeyNames="InventoryID" FooterStyle-BackColor="Green" FooterStyle-ForeColor="white"
                                            Width="1500px" AllowPaging="true" PageSize="20"
                                            BackColor="White" AllowSorting="false" OnSorting="OnSorting" BorderColor="#CCCCCC"
                                            BorderStyle="None" BorderWidth="1px" CellPadding="3" 
                                             OnSelectedIndexChanged="OnSelectedIndexChanged" OnPageIndexChanging="grdInventoryView_PageIndexChanging">
                                            <Columns>
                                            <%--<asp:TemplateField HeaderText="SNo">
                                            <ItemTemplate>
                                            <%#Container.DataItemIndex+1 %>
                                            </ItemTemplate>
                                            </asp:TemplateField>--%>
                                            
                                            
                                            <asp:TemplateField HeaderText="InvenID" SortExpression="InventoryId" ItemStyle-HorizontalAlign="Center">
                                            <ItemTemplate>
                                            <asp:Label ID="lblInventoryID" runat="server" Text='<%#Eval("InventoryID") %>'></asp:Label>
                                            </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Barcode" ItemStyle-Width="80px" SortExpression="BarCode">
                                            <ItemTemplate>
                                            <asp:Label ID="lblBarCode" runat="server" Text='<%#Eval("BarCode") %>'></asp:Label>
                                            </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Inv.Name" ItemStyle-Width="180px" SortExpression="InventoryName"
                                            ItemStyle-HorizontalAlign="Left">
                                            <ItemTemplate>
                                            <asp:Label ID="lblInventoryName" runat="server" Text='<%#Eval("InventoryName") %>'></asp:Label>
                                            </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Description" ItemStyle-Width="180px" SortExpression="Description">
                                            <ItemTemplate>
                                            <asp:Label ID="lblDescription" runat="server" Text='<%#Eval("Description") %>'></asp:Label>
                                            </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="CategoryName" ItemStyle-Width="180px" SortExpression="CategoryName">
                                            <ItemTemplate>
                                            <asp:Label ID="lblCategoryName" runat="server" Text='<%#Eval("CategoryName") %>'></asp:Label>
                                            </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Price" SortExpression="Price" HeaderStyle-HorizontalAlign="Right"
                                            ItemStyle-HorizontalAlign="Right">
                                            <ItemTemplate>
                                            <asp:Label ID="lblPrice" runat="server" Text='<%#Eval("Price" ,"{0:F2}") %>'></asp:Label>
                                            </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Price2" SortExpression="Price2" HeaderStyle-HorizontalAlign="Right"
                                            ItemStyle-HorizontalAlign="Right">
                                            <ItemTemplate>
                                            <asp:Label ID="lblPrice2" runat="server" Text='<%#Eval("Price2" ,"{0:F2}") %>'></asp:Label>
                                            </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Price3" SortExpression="Price3" HeaderStyle-HorizontalAlign="Right"
                                            ItemStyle-HorizontalAlign="Right">
                                            <ItemTemplate>
                                            <asp:Label ID="lblPrice3" runat="server" Text='<%#Eval("Price3" ,"{0:F2}") %>'></asp:Label>
                                            </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Price4" SortExpression="Price4" HeaderStyle-HorizontalAlign="Right"
                                            ItemStyle-HorizontalAlign="Right">
                                            <ItemTemplate>
                                            <asp:Label ID="lblPrice4" runat="server" Text='<%#Eval("Price4" ,"{0:F2}") %>'></asp:Label>
                                            </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="StockCode" ItemStyle-Width="180px">
                                            <ItemTemplate>
                                            <asp:Label ID="lblGStockCodes" runat="server" Text='<%#Eval("Stockcode") %>'></asp:Label>
                                            </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Add To PriceSwitch">
                                            <ItemTemplate >
                                            <asp:LinkButton ID="imgbtn1" runat="server" Font-Underline="true" ForeColor="Blue"
                                            CommandName="Select" CommandArgument="<%# Container.DataItemIndex %>" CausesValidation="false">ADD</asp:LinkButton>
                                            </ItemTemplate>
                                            </asp:TemplateField>
                                           
                                                
                                            <asp:ButtonField Text="Select" CommandName="Select" ItemStyle-Width="150" Visible="false"/>
                                            </Columns>
                                            
                                            <FooterStyle BackColor="#006699" ForeColor="White"></FooterStyle>
                                            <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black"></HeaderStyle>
                                            <PagerStyle HorizontalAlign="Left" CssClass="GridPager" />
                                            <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>
                                        <%--Newly Added Grid--%>
                                        <asp:GridView ID="GridView1" runat="server" AllowPaging="true" Visible="false">
                                        </asp:GridView>
                                    </asp:Panel>
                                    <asp:HiddenField ID="hidRInventoryid" runat="server"  ClientIDMode="Static"/> 
                                    <asp:HiddenField ID="hidBarcode" runat="server" ClientIDMode="Static" />
                                </caption>
                            </tbody>
                       </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
 </div>

  <div class="modalCss" id="ModalGroup">
   <div class="modal-dialogCss">
       <div class="modal-contentCss" style="width:90%;">
         
           <div class="modal-body" style="padding: 0px;">


               <div class="card" >
                   <h5 class="card-header" style="background-color: #4c4c4c; color: White;">Search Price Group
                       <button type="button" class="close" style="color: White; opacity: 1;" onclick="CloseGroupModal()" data-dismiss="modal">
                        &times;</button></h5>

                   <div class="card-body">
                       <div class="row">

                           <div class="column">
                               <label for="validationCustom03">
                                 Price GroupName 
                               </label>
                               <asp:TextBox ID="txtGroupName" class="form-control" runat="server"></asp:TextBox>
                           </div>
                       </div>
                       <div class="row">
                           <div class="column">
                               <asp:Button ID="btnSaveGroup" runat="server" Text="Save" OnClientClick="validate5()" CssClass="btn btn-primary" OnClick="btnSaveGroup_Click" />
                               <asp:Button ID="btnUpdateGroup" runat="server" Text="Update" OnClientClick="validate5()" CssClass="btn btn-primary" OnClick="btnUpdateGroup_Click" />
                               <asp:Button ID="btnGroupClear" runat="server" Text="Clear" OnClientClick="refershingpage()" CssClass="btn btn-primary" />
                               <asp:HiddenField ID="hidpsid" runat="server" ClientIDMode="Static" />
                           </div>
                           <div class="column">
                               
                           </div>
                           

                       </div>

                         <table id="Table3" class="table table-striped table-bordered second">
                         <tbody>
                         <caption>
                       <asp:Panel ID="Panel1" runat="server" BackColor="white" Height="590px" 
                         ScrollBars="Auto" Width="1510px">
                         <asp:GridView ID="grdPriceGroup" runat="server" AutoGenerateColumns="False" 
                         BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
                         CellPadding="3" DataKeyNames="PSGID" Font-Size="Small" Height="170px" 
                         onselectedindexchanged="grdPriceGroup_SelectedIndexChanged" Width="600px" >
                         <Columns>
                         <%--<asp:TemplateField HeaderText="SNo">
                           <ItemTemplate>
                           <%#Container.DataItemIndex + 1%>
                           </ItemTemplate>
                           </asp:TemplateField>
                          --%>
                          <asp:TemplateField HeaderText="PSGID" Visible="false">
                          <ItemTemplate>
                          <asp:Label ID="lblPSGID" runat="server" Text='<%#Eval("PSGID") %>'></asp:Label>
                          </ItemTemplate>
                          </asp:TemplateField>

                          <asp:TemplateField HeaderText="Price GroupName" ItemStyle-Width="250px">
                          <ItemTemplate>
                          <asp:Label ID="lblPriceGroupName" runat="server" 
                          Text='<%#Eval("PSGroupName") %>'></asp:Label>
                          </ItemTemplate>
                          </asp:TemplateField>
  
                           <asp:ButtonField CommandName="Select"  
                          ItemStyle-ForeColor="Green" Text="Edit" />
                          </Columns>
                          <FooterStyle BackColor="White" ForeColor="#000066" />
                          <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="White" />
                          <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>
                          </asp:Panel>
                        </caption>
                       </tbody>
                            
                       </table>

                   </div>
                   
                   
                       
                   </div>
               </div>
           </div>
       </div>
     </div>


 <div class="modalCss" id="ModalCreatePriceSwitch">
  <div class="modal-dialogCss">
      <div class="modal-contentCss" style="width:90%;">
        
          <div class="modal-body" style="padding: 0px;">


              <div class="card" >
                  <h5 class="card-header" style="background-color: #4c4c4c; color: White;">Create  Price Switch
                      <button type="button" class="close" style="color: White; opacity: 1;" onclick="CloseCreatePriceSwitchModal()" data-dismiss="modal">
                       &times;</button></h5>

                  <div class="card-body">
                      <div class="row">

                          <div class="column">
                              <label for="validationCustom03">
                               Inventoryid 
                              </label>
                              <asp:TextBox ID="txtPSInventoryid" class="form-control" runat="server"></asp:TextBox>
                          </div>
                      </div>
                      <div class="row">

                        <div class="column">
                            <label for="validationCustom03">
                             Barcode
                            </label>
                            <asp:TextBox ID="txtPSBarcode" class="form-control" runat="server"></asp:TextBox>
                        </div>
                    </div>

                    <div class="row">

                            <div class="column">
                                <label for="validationCustom03">
                                 Price GroupName
                                </label>
                                <asp:DropDownList ID="cmbPriceGroupName" CssClass="custom-select" runat="server"></asp:DropDownList>
                                
                            </div>
                    </div>
                       <div class="row">

                             <div class="column">
                                 <label for="validationCustom03">
                                  Price To Switch
                                 </label>
                                 <asp:DropDownList ID="cmbPriceList" CssClass="custom-select" runat="server">
                                  <asp:ListItem Text="Select Price" Value="0"></asp:ListItem>
                                  <asp:ListItem Text="Price2" Value="1"></asp:ListItem>
                                  <asp:ListItem Text="Price3" Value="2"></asp:ListItem>
                                  <asp:ListItem Text="Price4" Value="3"></asp:ListItem>
                                 </asp:DropDownList>
             
                             </div>
                     </div>

                    <div class="row">
                    <div class="column">
                     <label for="validationCustom03">
                      Start Time
                     </label>

                    <asp:TextBox ID="txtT1_StTm" runat="server" CssClass="textbox" Text="00:00:00"  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>
                     </div>
                     </div>


                      
                    <div class="row">
                    <div class="column">
                    <label for="validationCustom03">
                    Start Time
                    </label>
                    <asp:TextBox ID="txtT1_EndTm" runat="server" CssClass="textbox" Text="23:59:59"   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>
                     </div>
                     </div>
                      
                 


                      <%--<asp:TextBox ID="txtDate" runat="server"></asp:TextBox>
      
                        <asp:MaskedEditExtender 
                            ID="MEEDate" Mask="99:99:99" 
                            MaskType="date" 
                            TargetControlID="txtDate" 
                            MessageValidatorTip="true" 
                            ClearMaskOnLostFocus="false" 
                            CultureName="fr-CA" 
                            PromptCharacter="_"
                            Filtered="-" 
                            ErrorTooltipEnabled="true"  
                            UserDateFormat="YearMonthDay" 
                            runat="server" />
        
                        <asp:MaskedEditValidator 
                            ID="MEEVDate" 
                            ControlExtender="MEEDate" 
                            ClientValidationFunction="checkDate" 
                            Display="Dynamic" 
                            InvalidValueMessage="Le format de date n'est pas valide." 
                            ControlToValidate="txtDate" 
                            IsValidEmpty="true" 
                            runat="server" />
                       --%>



                      <div class="row">
                          <div class="column">
                              <asp:Button ID="btnCreateSwitchPrice" runat="server" Text="Create"  CssClass="btn btn-primary" OnClick="btnCreateSwitchPrice_Click" />
                              
                          </div>
                          <div class="column">
                              
                          </div>
   
                      </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>
