<%@ Page Title="MenuGroupCreation " Language="C#" MasterPageFile="~/SunMaster.Master" AutoEventWireup="true" CodeBehind="MenuGroupCreation.aspx.cs" Inherits="SUNWEB.MenuGroupCreation" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script type="text/javascript" language="javascript">
        function validate() {

            if (document.getElementById("<%=txtMenuGroupname.ClientID %>").value == "") {
                 alert("Enter MenuGroup Name ");
                 document.getElementById("<%=txtMenuGroupname.ClientID %>").focus();
                return false;
            }

          

         }


    </script>
    <script type="text/javascript" language="javascript">
        function AllowOnlyNumeric() {
            // Get the ASCII value of the key that the user entered
            var key = window.event.keyCode;

            // Verify if the key entered was a numeric character (0-9) or a decimal (.)
            if ((key > 47 && key < 58) || key == 46)
                // If it was, then allow the entry to continue
                return;

            else
                // If it was not, then dispose the key and continue with entry
                window.event.returnValue = null;
            alert("Number Only Allowed")
        }
    </script>

    
    <style type="text/css">
        @media only screen and (max-width: 600px)
         {
          div 
           {
           text-align:left;        
           }
         }
      </style>
    <style type="text/css">


        /* Create two equal columns that floats next to each other */
        .columnLeft {
          float: left;
          width: 50%;
          padding-left: 15px;
          height: auto; /* Should be removed. Only for demonstration */

        }

        .columnRight {
          float: left;
          width: 50%;
          padding-right:17px;
          height: auto; /* Should be removed. Only for demonstration */
          text-align:right;
          margin-right:-10px;
        }
        /* Clear floats after the columns */
        .row:after {
          content: "";
          display: table;
          clear: both;
        }

        .hrefCss
        {
            text-decoration: underline;
        }
          </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: 100px;
            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;
          }
        
    </style>
    
    <style type="text/css">
    @media only screen and (max-width: 600px) {
    table, th, td {
    font-size: 10px;
    font-weight:bold;
        
    }
    
     .Labels{font-size:10px; }
     .alnright { text-align: right; }
       
             }
    
    
    
    </style>
      <script type="text/javascript">

          //Search Popup For CashBack Tap

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

          function CloseModal() {
              var modal2 = document.getElementById("MenugroupModel");
              modal2.style.display = "none";
          }

      </script>



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

    
<asp:UpdatePanel runat="server" ID="updatepanel1" UpdateMode="Conditional">
  <ContentTemplate>
       <table style="margin-left: 1%; width: 98%;">
       <tr>
      <td style="font-size:large; width: 50%; font-family:'Open Sans', sans-serif; font-weight:bolder;">
       MENU GROUP SETTINGS 
     </td>    
     
     </tr>
     </table>
     <table style="padding-bottom: 2px; width: 100%;">
                <tr>
                    <td style="max-width: 50%; min-width: 50%;">
                    </td>
                  
                    <td style="max-width: 50%; min-width: 50%; text-align: right; padding-bottom: 7px;">
                        <label for="validationCustom03">
                            Branch
                        </label>
                       
                        <asp:DropDownList ID="cmbBranches" CssClass="custom-select" runat="server" AutoPostBack="true"
                            OnSelectedIndexChanged="cmbBranches_SelectedIndexChanged" Width="200px" Height="35px">
                        </asp:DropDownList>
                    </td>
                </tr>
            </table>

          <div class="row" style="display:none">
                 
                          <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="simple-card">
          <div class="row">
          <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; color: White;"> 
          <span style="font-size:14px;color:#F8F9FA">MENUGROUP </span>&nbsp;&nbsp;
          <asp:Button ID="btnAddNew" OnClick="btnAddNew_Click" runat="server" class="btn btn-success" Text="Add New" />
          <button type="button"  onclick="Show_Model_menugroup()"  class="btn btn-warning"> 
          Search
          </button>
          </h5> 
          <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">
          <label for="validationCustom04">
          MenuGroupName 
          </label>
          <asp:TextBox ID="txtMenuGroupname" runat="server" class="form-control" ></asp:TextBox>
          <br />
          </div>
          <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
           <label for="validationCustom04">
          OrderBy Position
          </label>
          <asp:TextBox ID="txtRSeqNo" runat="server" Enabled="false" class="form-control" ></asp:TextBox>
          </div>
          </div>
          <div class="form-row">
          <label for="validationCustom04">
          &nbsp;&nbsp;<asp:CheckBox ID="chkIsActive" runat="server" Checked="true" />
           <span>Active</span>
          </label>
          </div>
          <asp:Button ID="btnSaveMenugroup" runat="server" Text="Save" OnClientClick="return  validate()" OnClick="btnSaveMenugroup_Click" CssClass="btn btn-primary" />
          <asp:Button ID="btnUpdateMenugroup" runat="server" Text="Update" OnClientClick="return  validate()" OnClick="btnUpdateMenugroup_Click" CssClass="btn btn-primary" />  
          <asp:HiddenField ID="hidmid" runat="server" />
          <asp:HiddenField ID="hidSeqNo" runat="server" />
          </div>
          </div>
          </div>
          </div>
          </div>


       <div class="simple-card">

           <div class="row">
                <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; color: White; font-size: 14px;">
                     WEBORDER MENU
                     </h5>
                        <div class="card-body">
                            <div class="table-responsive">
                                <table id="example" class="table table-striped table-bordered second" style="width: 100%">
                                    <tbody>
                                        <caption>
                                            <asp:Panel ID="Panel1" runat="server" BackColor="white" Height="500px" ScrollBars="Auto"
                                                Width="1500px">
                                                <asp:GridView ID="grdGroupMenuLink" runat="server" AutoGenerateColumns="False" EmptyDataRowStyle-CssClass="alert-dark"
                                                    Font-Size="15px" HeaderStyle-BackColor="RoyalBlue" EmptyDataText="No Record Found ! "
                                                    OnRowCommand="grdGroupMenuLink_RowCommand" DataKeyNames="Categoryid" FooterStyle-BackColor="Green"
                                                    FooterStyle-ForeColor="white" Width="920px" AllowPaging="true" PageSize="15000000"
                                                    BackColor="White" BorderColor="#CCCCCC" BorderStyle="None"
                                                    BorderWidth="1px" CellPadding="3" OnRowDataBound="grdGroupMenuLink_RowDataBound">
                                                    <Columns>
                                                    <asp:TemplateField HeaderText="SNo" ItemStyle-Width="50px">
                                                    <ItemTemplate>
                                                     <%#Container.DataItemIndex+1 %>
                                                    </ItemTemplate>
                                                    </asp:TemplateField>
                                                     <%--
                                                         <asp:TemplateField>  
                                                           <HeaderTemplate>   
                                                           <asp:CheckBox ID="chkAllSelect" runat="server" onclick="CheckAll(this);"  />  
                                                           </HeaderTemplate>  
                                                           <ItemTemplate>  
                                                           <asp:CheckBox ID="chkSelect" runat="server" />  
                                                           </ItemTemplate>  
                                                          </asp:TemplateField>  
                                                     --%>
                                                        <asp:TemplateField HeaderText="Menugroupid" Visible="false">
                                                        <ItemTemplate>
                                                        <asp:Label ID="lblMenugroupid" runat="server" Text='<%#Eval("Menugroupid") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        </asp:TemplateField>

                                                        <asp:TemplateField HeaderText="Categoryid" Visible="false">
                                                        <ItemTemplate>
                                                        <asp:Label ID="lblCategoryID" runat="server" Text='<%#Eval("CategoryID") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="MenuName" ItemStyle-Width="180px">
                                                        <ItemTemplate>
                                                        <asp:Label ID="lblCategoryName" runat="server" Text='<%#Eval("Title") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        </asp:TemplateField>
                                                        
                                                        <asp:TemplateField HeaderText="Current Status" ItemStyle-Width="150px" ItemStyle-HorizontalAlign="Center"
                                                        ItemStyle-VerticalAlign="Middle">
                                                        <ItemTemplate>
                                                        <asp:Label ID="lblVisiblityStatus" runat="server" Text='<%#Eval("Visibility") %>'></asp:Label>
                                                        </ItemTemplate>
                                                        </asp:TemplateField>
                                                       <asp:TemplateField HeaderText="Linked To Group">  
                                                        <EditItemTemplate>  
                                                        <asp:TextBox ID="TextBox3" runat="server"  ></asp:TextBox>  
                                                        </EditItemTemplate>  
                                                        <ItemTemplate>  
                                                        <asp:DropDownList ID="cmbgroupsMenu" CssClass="custom-select"  runat="server">  
                                                        </asp:DropDownList>  
                                                        </ItemTemplate>  
                                                        </asp:TemplateField>  
                                                        
                                                        <asp:TemplateField ItemStyle-Width="50px" Visible="false">
                                                        <ItemTemplate>
                                                        <asp:Button ID="btnLink" runat="server" Width="70" Text="Link" CssClass="badge-brand" CommandName="MenuGroupLink" CommandArgument="<%# ((GridViewRow) Container).RowIndex %>"  />
                                                        </ItemTemplate>
                                                        </asp:TemplateField>
                                                    </Columns>
                                                    <PagerStyle CssClass="gridview"></PagerStyle>
                                                    <FooterStyle BackColor="#006699" ForeColor="White"></FooterStyle>
                                                    <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black"></HeaderStyle>
                                                    <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>
                                                <%--Newly Added Grid--%>
                                                <asp:GridView ID="GridView1" runat="server" AllowPaging="true" Visible="false">
                                                </asp:GridView>
                                            </asp:Panel>
                                        </caption>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                        <asp:Button ID="btnLink" runat="server" Text="Group Link" onclick="btnLink_Click" CssClass="btn btn-primary" />
                       </div>

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

       </div>
        

      <div class="modalCss" id="MenugroupModel">
                   <div class="modal-dialogCss" style="width:95%">
                   <%--<div class="modal-contentCss" style="width:90%">--%>
                    
                       <div class="modal-body" >
                       <div class="row">
                       <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
                        <div class="card" style="margin-left:110px">
                      
                            <h7 class="card-header" style="background-color: #4c4c4c; color: White;">MENUGROUP NAME LIST
                             <button type="button" class="close"  style="color:White; opacity:1;" onclick="CloseModal()" data-dismiss="modal">
                              &times;</button>
                            </h7>
                            <div class="card-body">
                                <div class="table-responsive" style="padding: 0px 20px 0px 20px;">
                                <table id="example" class="table table-striped table-bordered second" style="width:70%">
                            
                                <tbody>
                                <div class="row">
                                <div class="column">
                                 <label for="validationCustom03">
                                  Menugroup Name 
                                  </label>
                                  <asp:TextBox ID="txtmenugroupsname" runat="server" class="form-control" Width="250px" 
                                   placeholder="Enter MenuGroupName">
                                   </asp:TextBox>
                                   </div>
                                   </div>
                                 <div class="row">
                                 <div class="column">
                                 <asp:Button ID="btnmenugroupnameSearch" OnClick="btnmenugroupnameSearch_Click"   runat="server" class="btn btn-primary"  Text="Apply" />
                                
                                 </div>
                                 </div>
                                <caption>
                                <asp:Panel ID="Panel8" runat="server" BackColor="white" Height="500px" 
                                ScrollBars="Auto" Width="610px">
                                    
                                <asp:GridView ID="grdMenuGroupName" runat="server" AutoGenerateColumns="False" 
                                BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
                                CellPadding="3" DataKeyNames="MenuGroupid" Font-Size="Small" Height="150px" 
                                onselectedindexchanged="grdMenuGroupName_SelectedIndexChanged" Width="450px">
                                <Columns>
                                <%--<asp:TemplateField HeaderText="SNo">
                                  <ItemTemplate>
                                  <%#Container.DataItemIndex + 1%>
                                  </ItemTemplate>
                                  </asp:TemplateField>
                                 --%>
                                 <asp:TemplateField HeaderText="MenuGroupid" Visible="false">
                                 <ItemTemplate>
                                 <asp:Label ID="lblMenuGroupid" runat="server" Text='<%#Eval("MenuGroupid") %>'></asp:Label>
                                 </ItemTemplate>
                                 </asp:TemplateField>

                                 <asp:TemplateField HeaderText="MenuGroupName" ItemStyle-Width="200px">
                                 <ItemTemplate>
                                 <asp:Label ID="lblMenuGroupName" runat="server" 
                                 Text='<%#Eval("MenuGroupName") %>'></asp:Label>
                                 </ItemTemplate>
                                 </asp:TemplateField>

                               <asp:TemplateField HeaderText="Arrange By" ItemStyle-Width="90px" ItemStyle-HorizontalAlign="Center"
                               ItemStyle-VerticalAlign="Middle">
                               <ItemTemplate>
                               <asp:TextBox ID="txtSeqno" onkeypress="javascript:AllowOnlyNumeric()" Width="50px"
                               runat="server" MaxLength="2" Text='<%#Eval("SeqNo") %>'></asp:TextBox>
                               </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>--%>
               </div>
    </div>

   
   <div>
       <h4>&nbsp;<asp:Label ID="lblGreeting" runat="server"></asp:Label></h4>
           
     </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>
