<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Site1.Master" CodeBehind="Menu.aspx.cs" Title="Cloud HR - Menu::."
    Inherits="HRMS.Menu" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   
    <div class="row">
        <div class="col-lg-12">
            <section class="panel">
                 <header class="panel-heading">Menu</header>
                    <div class="panel-body">
                             <div class="span6">
                                <div id="divMessage" runat="server" visible="false" class="alert alert-info alert-dismissable">

                                    <i class="icon-check-sign"></i>
                                    <asp:Label ID="lblMessage" class="msg" runat="server" Text="" ></asp:Label>
                                </div>
                                <div id="diverrorMessage" runat="server" visible="false" class="alert alert-danger alert-dismissable">

                                    <i class="icon-check-sign"></i>
                                    <asp:Label ID="lblerrorMessage" class="msg" runat="server" Text="" ></asp:Label>
                                </div>
                            </div>
                                  <div class="form-group">
                                        <div class="col-lg-1"></div>
                                        
                                      <label for="inputEmail1" class="col-lg-2 col-sm-2 control-label"> Menu Code </label>
                                      <div class="col-lg-4">
                                      
                                      <asp:TextBox ID="txtMenucode" runat="server" MaxLength="10" placeholder="Menu Code" ToolTip="The maximum length for Menu Code is 10 character." CssClass="form-control"></asp:TextBox>
                                      <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="Req_txtMenucode" controltovalidate="txtMenucode" errormessage="Menu Code is Required!" />
                                      </div>
                                     </div>
                                   <%--<div class="form-group">
                                   <div class="col-lg-1"></div>
                                      <label for="inputPassword1" class="col-lg-2 col-sm-2 control-label">Menu Category</label>
                                      <div class="col-lg-4">
                                      <asp:TextBox ID="txtMenuCategory" runat="server" placeholder="Menu Category" CssClass="form-control"></asp:TextBox>
                                      </div>
                                  </div>  --%>
                                  <div class="form-group">
                                   <div class="col-lg-1"></div>
                                      <label for="inputPassword1" class="col-lg-2 col-sm-2 control-label">Menu Name </label>
                                      <div class="col-lg-4">
                                        <asp:TextBox ID="txtDesc" runat="server" MaxLength="40" placeholder="Menu Name" ToolTip="The maximum length for Menu Name is 40 character."  CssClass="form-control"></asp:TextBox>
                                        <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="RequiredFieldValidator1" controltovalidate="txtDesc" errormessage="Menu Name is Required!" />
                                      </div>
                              </div>
                                   <div class="form-group">
                                   <div class="col-lg-1"></div>
                                      <label for="inputPassword1" class="col-lg-2 col-sm-2 control-label">Application</label>
                                      <div class="col-lg-4">
                                        <asp:TextBox ID="txtAppCode" runat="server" MaxLength="10" placeholder="Application" ToolTip="The maximum length for Application Name is 10 character." TextMode="SingleLine" CssClass="form-control"></asp:TextBox>
                                      </div>
                              </div>
                                   <div class="form-group">
                                   <div class="col-lg-1"></div>
                                      <label for="inputPassword1" class="col-lg-2 col-sm-2 control-label">Module</label>
                                      <div class="col-lg-4">
                                        <asp:TextBox ID="txtAppModuleCode" runat="server" MaxLength="10" placeholder="Module" ToolTip="The maximum length for Module Name is 10 character." TextMode="SingleLine" CssClass="form-control"></asp:TextBox>
                                      </div>
                              </div>
                                   <div class="form-group">
                                   <div class="col-lg-1"></div>
                                      <label for="inputPassword1" class="col-lg-2 col-sm-2 control-label">parent Menu</label>
                                      <div class="col-lg-4">
                                        <asp:DropDownList ID="ddlPMenuCode" runat="server" placeholder="parent Menu" CssClass="form-control select2"></asp:DropDownList>
                                      </div>
                              </div>
                                   <div class="form-group">
                                   <div class="col-lg-1"></div>
                                      <label for="inputPassword1" class="col-lg-2 col-sm-2 control-label">Sequence #</label>
                                      <div class="col-lg-4">
                                        <asp:TextBox ID="txtMenuSeq" runat="server" placeholder="Sequence #" TextMode="SingleLine" ToolTip="Sequence # should be numeric values." onkeypress="return numbersOnly(event)" CssClass="form-control"></asp:TextBox>
                                        <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="RequiredFieldValidator2" controltovalidate="txtMenuSeq" errormessage="Sequence is Required!" />
                                      </div>
                              </div>
                                   
                                  <div class="form-group">
                                  <div class="col-lg-1"></div>
                                      <div class="col-lg-offset-2 col-lg-8">
                                      <asp:Button ID="btnSave" class="btn btn-info" runat="server" ValidationGroup="save" Text="Save" OnClick="btnSave_Click"></asp:Button>
                                      <a href="#" id="aCancel" runat="server" class="btn btn-info">Back</a>
                                          
                                      </div>
                                  </div>
                                  <%--<div class="row" style="visibility:hidden;">
                                    <div class="container">
                                      <div class="row">
                                       <div class="col-md-3">
                                        <asp:GridView ID="grd_asign_objects" runat="server" AutoGenerateColumns="False">
                                            <Columns>
                                                <asp:BoundField DataField="Description" HeaderText="Object Name" />
                                            </Columns>
                                           </asp:GridView>



                                        </div >
                                        <div class="col-md-2">
                                        </div >
                                      
                                        <div class="col-md-4 " style="font-size:7pt !important;">
                                          <asp:GridView ID="grd_all_objects" runat="server" AutoGenerateColumns="False" 
                                            cellpadding="0" border="0" class="display" >
                                           <Columns>
                                               <asp:TemplateField HeaderText="Object">
                                                   <ItemTemplate>
                                                       <asp:CheckBox ID="CheckBox1" runat="server" Text='<%# bind("Description") %>' />
                                                   </ItemTemplate>
                                               </asp:TemplateField>
                                               <asp:BoundField DataField="description" HeaderText="test" Visible="False" />
                                               
                                           </Columns>
                                           <RowStyle CssClass="rowStyle"/>
                                           
                                            <HeaderStyle CssClass="headerStyle" />
                                           
                                           <FooterStyle  CssClass="footerStyle"  />
                                        </asp:GridView>
                                        </div>
                                       
                                      
                                      </div>



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


                                  <div class="row">
                                    <div class="col-lg-12">
                                        <div class="panel">
                                            <div class="panel-heading">Add Object(s) to Menu</div>
                                            <div class="panel-body">
                                                <asp:GridView ID="grdObject" runat="server" AutoGenerateColumns="false" cellpadding="0" cellspacing="0" border="0" class="display" OnRowDataBound="OnRowDataBound" OnRowCommand="OnRowCommand" >
                                                    <Columns>
                                                        <asp:TemplateField ItemStyle-Width="40%" HeaderText ="Detail Menu Code">
                                                            <ItemTemplate >
                                                                <%--<asp:DropDownList ID="ddlObjects" runat="server" se></asp:DropDownList>--%>
                                                                <asp:TextBox ID="txtDMenuCode" runat="server" CssClass="form-control" Width="100%" MaxLength="10" placeholder="Detail Menu Code" Text='<%# Bind("MenuDtlCode") %>'></asp:TextBox>
                                                                <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="d_save" runat="server" id="RequiredFieldValidator2" controltovalidate="txtDMenuCode" errormessage="Detail Menu Code is Required!" />
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                         <asp:TemplateField ItemStyle-Width="40%" HeaderText ="Object Name">
                                                            <ItemTemplate  >
                                                                <asp:DropDownList ID="ddlObjects" CssClass="form-control select2" runat="server" Width="100%" ></asp:DropDownList>
                                                                <asp:Label ID="lblObject" runat="server" Text='<%# Eval("ObjectId") %>' Visible = "false" />
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField ItemStyle-Width="10%" HeaderText ="Sequence #">
                                                            <%--<EditItemTemplate>
                                                                <asp:TextBox ID="txtMenuDtlSeq" runat="server" Text='<%# Bind("MenuDtlSeq") %>'></asp:TextBox>
                                                            </EditItemTemplate>--%>
                                                            <ItemTemplate>
                                                                <asp:TextBox ID="txtMenuDtlSeq" CssClass="form-control" runat="server" Width="100%" placeholder="Sequence #" onkeypress="return numbersOnly(event)" Text='<%# Bind("MenuDtlSeq") %>'></asp:TextBox>
                                                                <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="d_save" runat="server" id="ReqtxtMenuDtlSeq" controltovalidate="txtMenuDtlSeq" errormessage="Sequence is Required!" />
                                                            </ItemTemplate>
                                                        </asp:TemplateField>
                                                        <asp:TemplateField ItemStyle-Width="10%" HeaderText="Action">
                                                            <ItemTemplate>
                                                                <%--   <%#Container.DataItemIndex+1 %>
                                                                <asp:CheckBox ID="chk" runat="server" />--%>
                                                                <asp:LinkButton ID="lnkAdd" ValidationGroup="d_save" runat="server" CommandName="gAdd"><i class="fa fa-plus" style="font-size:20px !important"></i></asp:LinkButton>
                                                                &nbsp
                                                                <%--<a href="Menu.aspx?uid=<%# Eval("MenuCode") %>"><i class="fa fa-pencil" style="font-size:20px !important"></i></a>--%>
                                                                &nbsp<asp:LinkButton ID="lnkDelete" runat="server" CommandName="gDelete" OnClientClick="return confirm('Are you sure to delete?')"><i class="fa fa-trash" style="font-size:20px !important"></i></asp:LinkButton>
                        
                        
                            
                                                             </ItemTemplate>
                                                        </asp:TemplateField>
                                                    </Columns>
                                                    <%-- Mandatory--%>
                                                    <RowStyle CssClass="rowStyle"/>
                                                   <%-- Mandatory--%>
                                                    <HeaderStyle CssClass="headerStyle" />
                                                   <%-- optional--%>
                                                   <FooterStyle  CssClass="footerStyle"  />
                                                </asp:GridView>
                                                    
                                                        <br />
                                            </div>
                                        </div>
                                    </div>
                                  </div>
                             
                             <script src="../../../ThemeScrips/Datatables/media/js/jquery.js" type="text/javascript"></script>
                                            <script src="../../../ThemeScrips/Datatables/media/js/jquery.dataTables.min.js" type="text/javascript"></script>
                                            <script src="../../../ThemeScrips/Datatables/media/js/jquery.dataTables.js" type="text/javascript"></script>
                                            <script src="../../../ThemeScrips/Datatables/media/js/GridviewFix.js" type="text/javascript"></script>
                                     <script type="text/javascript">
                                            //without passing class names.
                                         $("#ContentPlaceHolder1_grd_all_objects").GridviewFix().dataTable();

                                        
                                            //Passing class names
                                         </script>
                                     <script type="text/javascript">
                                         //without passing class names.
                                         $("#ContentPlaceHolder1_grdObject").GridviewFix().dataTable({ bFilter: false, bInfo: false });
                                         //Passing class names
                                   </script>
                                   
                          </div>
             </section>
        </div>
    </div>

    <script src="../../ThemeScrips/jquery.min.js"></script>
    <link href="../../ThemeScrips/select2.min.css"
        rel="stylesheet" />
    <script src="../../ThemeScrips/select2.min.js"></script>
    <%--<script src="/ThemeScrips/select2.min.js"></script>--%>
    <script>
        $('.select2').select2();
    </script>
</asp:Content>
