<%@ Page Title="GroupMaster" Language="C#" MasterPageFile="~/SunMaster.Master" AutoEventWireup="true" CodeBehind="GroupMaster.aspx.cs" Inherits="SUNWEB.GroupMaster" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">


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

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

         if (document.getElementById("<%=txtDescription.ClientID %>").value == "") {
             alert("Enter the Description");
             document.getElementById("<%=txtDescription.ClientID %>").focus();
             return false;
         }

     }
    
 </script>
 
    <style type="text/css">
    @media only screen and (max-width: 600px)
     {
      div 
       {
       text-align:left;        
       }
     }
  </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: 300px;
            height:300px;
            border-radius: 3px;
        }
        
        
        /* Create two equal columns that floats next to each other */
        .column
        {
            float: left;
            width: 40%;
            padding: 2px;
            margin-left:5px;
            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: inherit;
                font-size: 14px;
                line-height: inherit;
                border-width: thin;
                border-color: #212529;
                border-radius: 2px;
                color: #212529;
                
               }
        
        
    </style>





   <script type="text/javascript">
         function ShowModalGroupList() {
           var modal = document.getElementById("ModalGroupList");
           modal.style.display = "block";
       }

       function CloseModal() {
           var modal = document.getElementById("ModalGroupList");
           modal.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="width:100%">
       <tr>
       <td>
         
          <%--<h5 class="section-title">GROUP</h5>--%>
       </td>
      <%-- <td align="right" style="padding-bottom:2px;">
            <label for="validationCustom05">Branch <asp:Label ID="lblBranchAliasName" runat="server"></asp:Label> 
            </label> 
            <asp:DropDownList ID="cmbBranches" CssClass="custom-select"  
            runat="server" AutoPostBack="true"  Width="200px" Height="35px"
            onselectedindexchanged="cmbBranches_SelectedIndexChanged"></asp:DropDownList>
          

      
       </td>
       </tr>
       
      </table>--%>


    <div class="d-flex justify-content-end align-items-center mb-3">
    <!-- Label -->
    <label for="cmbBranches" class="form-label mb-0 me-2">Branch</label>

    <!-- Optional alias label -->
    <asp:Label ID="lblBranchAliasName" runat="server" CssClass="text-muted me-2" />

    <!-- Dropdown with auto width -->
    <asp:DropDownList ID="cmbBranches" runat="server"
        CssClass="form-select "
        AutoPostBack="true"
        Style="width: 250px;"
        OnSelectedIndexChanged="cmbBranches_SelectedIndexChanged" />
    </div>



        <div class="row">
        <div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12">
        <div class="section-block">
        <h5 class="section-title">
        
        </h5>
        </div>
                            
                             <div class="card" >
                                    <h7 class="card-header"  style="background-color: #4c4c4c; color: White;"> <span style="font-size:14px;color:#F8F9FA">GROUP</span>&nbsp;&nbsp;  
                                    <asp:Button ID="btnAddNew" OnClick="btnAddNew_Click" runat="server" CssClass="btn btn-success" Text="Add New" />
                                   <button type="button"  onclick="ShowModalGroupList()" class="btn btn-warning">
                                    Search
                                    </button>     
                                    </h7>
                                       <div class="card-body border-top">
                                         <div class="form-row">
                                         <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                                <label for="validationCustom05">
                                                Group
                                                </label> 
                                                <asp:DropDownList ID="cmbGroupMain" CssClass="custom-select"  
                                                runat="server" AutoPostBack="true" 
                                                onselectedindexchanged="cmbGroupMain_SelectedIndexChanged">
                                                
                                                <asp:ListItem Value="0" Text="Select"></asp:ListItem>
                                                <asp:ListItem Value="1" Text="Group1"></asp:ListItem>
                                                <asp:ListItem Value="2" Text="Group2"></asp:ListItem>
                                                <asp:ListItem Value="3" Text="Group3"></asp:ListItem>
                                                <asp:ListItem Value="4" Text="Group4"></asp:ListItem>
                                                <asp:ListItem Value="5" Text="Group5"></asp:ListItem>
                                                </asp:DropDownList>
                                              
                                          </div>



                                                <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                                <label for="validationCustom04"> 
                                                Group Name
                                                 </label>
                                                <asp:TextBox ID="txtGroupName" class="form-control" placeholder="Enter Group Name"  runat="server"  ></asp:TextBox>

                                                </div>

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

                                                 </label>
                                                 <asp:TextBox ID="txtDescription" class="form-control" placeholder="Enter Description"  runat="server"></asp:TextBox>
                                                 <asp:HiddenField id="hidGroup1" runat="server" />
                                                 <asp:HiddenField id="hidGroupName" runat="server" />
                                                </div>
                                                <div class="col-xl-4 col-lg-4 col-md-12 col-sm-12 col-12 mb-2">
                                                </div>
                                                

                                          
                                      </div>

                                      <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="btnSave1"  OnClick="btnSave1_Click" OnClientClick="return Groupvalidate1()"   runat="server" class="btn btn-primary" Text="Save" />
                                      <asp:Button ID="btnUpdate1"  OnClick="btnUpdate1_Click" OnClientClick="return Groupvalidate1()"   runat="server" class="btn btn-primary" Text="Update" />
                                      </div>
                                      </div>
                                      
                                      </div>

                                </div>


                          <div>

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

                     
      
            

 <div class="modalCss" id="ModalGroupList">
             <div class="modal-dialogCss" style="width:90%;">
            <%-- <div class="modal-contentCss" >--%>
             <div class="modal-body" style="padding:0px;margin-left:-5PX">

             <div class="card"  style="width:90%; height:800px; margin-left:165PX">
             <h7 class="card-header" style="background-color: #4c4c4c; color: White;">
             GROUP SEARCH
             <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">
             Select Group
             
             </label>
             <asp:DropDownList ID="cmbSearchGroup" CssClass="form-select w-25" runat="server">
                                  
             <asp:ListItem Value="0" Text="Select"></asp:ListItem>
             <asp:ListItem Value="1" Text="Group1"></asp:ListItem>
             <asp:ListItem Value="2" Text="Group2"></asp:ListItem>
             <asp:ListItem Value="3" Text="Group3"></asp:ListItem>
             <asp:ListItem Value="4" Text="Group4"></asp:ListItem>
             <asp:ListItem Value="5" Text="Group5"></asp:ListItem>
             </asp:DropDownList>                    

             </div>
              <div class="column">

              <label for="validationCustom04">
              
              Group Name
              </label>
              <asp:TextBox ID="txtSearchGroupName" class="form-control w-25" placeholder="Enter Group Name"  runat="server"></asp:TextBox>


              </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>
             <br />
             <div class="row">
                          <div class="col-xl-6 col-lg-6 col-md-12 col-sm-12 col-12">
                            <div class="card">
                                <h7 class="card-header">GROUP  LIST</h7>
                                <div class="card-body">
                                    <table id="Table2" class="table table-striped table-bordered second" style="width:100%">
                                        <tbody>
                                           <caption>
                                           <label for="validationCustom03">
                                           Search Result:
                                           </label>
                                            <asp:Panel ID="Panel1" runat="server" BackColor="white" Height="370px"    ScrollBars="Auto" Width="350px">
                                           
                                          
                                          <asp:GridView ID="grdGroupnew" runat="server" AutoGenerateColumns="False" OnRowDeleting="grdGroupnew_RowDeleting"
                                                    DataKeyNames="GroupID" Font-Size="Small" Width="200px" EmptyDataText="No Data Found !"
                                                    onselectedindexchanged="grdGroupnew_SelectedIndexChanged"  OnRowCommand="grdGroupnew_RowCommand">
                                                    <Columns>
                                                      <%--  <asp:TemplateField HeaderText="SNo"> 
                                                            <ItemTemplate>
                                                                <%#Container.DataItemIndex + 1%>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        --%>
                                                        <asp:TemplateField HeaderText="GroupID" Visible="false">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lblGroupID" runat="server" Text='<%#Eval("GroupID") %>'></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField HeaderText="GroupName">
                                                            <ItemTemplate>
                                                                <asp:Label ID="lblGroupName" runat="server" 
                                                                    Text='<%#Eval("GroupName") %>'></asp:Label>
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:ButtonField CommandName="Select" 
                                                            ItemStyle-ForeColor="Green" Text="Edit" />

                                                       <asp:TemplateField HeaderText="Delete"  ShowHeader="False">
                                                        <ItemTemplate>
                                                        
                                                        <asp:LinkButton ID="lnkDelete" runat="server" CausesValidation="False"  ForeColor="Red"    ToolTip="Click Here to Remove"
                                                        CommandName="Delete" OnClientClick="javascript: return confirm('Do you want to delete this record?')" CommandArgument='<%#Eval("GroupID") %>' Text="Delete"></asp:LinkButton>
                                                        </ItemTemplate>
                                                        </asp:TemplateField>
                                                      </Columns>
                                                </asp:GridView>
                                                </asp:Panel>
                                           </caption>
                                         </tbody>    
                                      </table>
                                    
                                </div>
                            </div>
                        
                            
                           <%-- </div>--%>

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




  

            
           
 <script type="text/javascript" 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" />
<!-- Optional Bootstrap Icons -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css" rel="stylesheet" />
         
      </ContentTemplate>
     </asp:UpdatePanel>


     <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
     <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
</asp:Content>
