<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="PositionHiearchy.aspx.cs" Inherits="HRMS.Purcahsing.PositionHiearchy" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="main-panel">
        <div class="row">
            <div class="col-md-12">
                <section class="panel">
                    <header class="panel-heading">
                        Position Hierarchy
                        <div class="pull-right">
                            <asp:Button Text="Save" CssClass="btn btn-info" ID="btn_save" Width="120px" ValidationGroup="save"
                                runat="server" OnClick="btn_save_Click" />
                            <asp:Button Text="Back" CssClass="btn btn-info" ID="btn_cancel"
                                runat="server" OnClick="btn_cancel_Click" />
                        </div>
                    </header>

                    <div class="panel-body">
                        <div class="span6">
                            <div id="divmessage" runat="server" visible="false" class="alert alert-info alert-dismissable">
                                <asp:Label Text="" ID="lbl_msg" CssClass="msg" runat="server"></asp:Label>
                            </div>
                        </div>

                        <div class="span6">
                            <div id="diverrmessage" runat="server" visible="false" class="alert alert-info alert-dismissable">
                                <asp:Label Text="" ID="lbl_err_msg" CssClass="msg" runat="server"></asp:Label>
                            </div>
                        </div>


                        <div class="row">

                            <label class="col-md-2 control-label">Business Group</label>
                            <div class="col-md-3">
                                <asp:DropDownList ID="ddl_bg" runat="server" CssClass="form-control"></asp:DropDownList>
                                <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" ID="req_ddl_bg" ControlToValidate="ddl_bg" ErrorMessage="Business Group is Required!" />
                            </div>

                        </div>


                        <div class="row">
                            <asp:HiddenField ID="hid_pos_hr" runat="server" />
                            <asp:HiddenField ID="hid_pos_vers" runat="server" />

                            <label class="col-md-2 control-label">Name</label>
                            <div class="col-md-4">
                                <asp:TextBox ID="txt_hierarchy_name" runat="server" CssClass="form-control"></asp:TextBox>
                                <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" ID="req_txt_hierarchy_name" ControlToValidate="txt_hierarchy_name" ErrorMessage="Name is Required!" />
                            </div>

                            <div class="col-md-4">
                                <asp:CheckBox ID="chk_prim" runat="server" CssClass="checkbox" Text="Primary" />
                            </div>
                        </div>


                        <div class="row">
                            <label class="col-md-2 control-label">Number</label>
                            <div class="col-md-1">
                                <asp:TextBox ID="txt_num" runat="server" CssClass="form-control"></asp:TextBox>

                            </div>


                            <label class="col-md-2  control-label">Date From</label>
                            <div class="col-md-2">
                                <asp:TextBox ID="txt_dt_frm" runat="server" CssClass="form-control datetime"></asp:TextBox>
                                <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" ID="req_txt_dt_frm" ControlToValidate="txt_dt_frm" ErrorMessage="Date From is Required!" />
                            </div>

                            <label class="col-md-2  control-label">Date To</label>
                            <div class="col-md-2">
                                <asp:TextBox ID="txt_dt_to" runat="server" CssClass="form-control datetime"></asp:TextBox>
                            </div>
                        </div>

                        <br />
                        <h4>Position</h4>
                        <hr />



                        <div class="row">
                            <asp:HiddenField ID="hid_pos" runat="server" />
                            <label class="control-label col-md-2">Name</label>
                            <div class="col-md-7">
                                <div class="input-group">
                                    <asp:TextBox CssClass="form-control" ID="txt_pos_name" runat="server">
                                    </asp:TextBox>
                                    <span class="input-group-btn">
                                        <button id="btn_lov_pos" type="button" runat="server" class="btn btn-white" onserverclick="btn_lov_pos_ServerClick">
                                            <i class="fa fa-search"></i>
                                        </button>
                                    </span>
                                </div>
                            </div>
                        </div>

                        <div class="row" style="padding-top: 10px">
                            <label class="control-label col-md-2">Holders</label>
                            <div class="col-md-2">
                                <asp:TextBox ID="txt_holdrs" runat="server" CssClass="form-control"></asp:TextBox>
                            </div>

                            <label class="control-label col-md-3">Worker Numbers</label>
                            <div class="col-md-2">
                                <asp:TextBox ID="txt_wrkr_no" runat="server" CssClass="form-control"></asp:TextBox>
                            </div>
                        </div>



                        <div class="row" style="padding-top: 10px">
                            <label class="control-label col-md-2">Worker Type</label>
                            <div class="col-md-2">
                                <asp:TextBox ID="txt_wrkr_typ" runat="server" CssClass="form-control"></asp:TextBox>
                            </div>

                            <label class="control-label col-md-3">Number of Subordinates</label>
                            <div class="col-md-2">
                                <asp:TextBox ID="TextBox2" runat="server" CssClass="form-control"></asp:TextBox>
                            </div>
                        </div>


                        <div class="row" style="padding-top: 10px">
                            <div class="col-md-3 col-md-offset-2">
                                <asp:CheckBox ID="chk_exst" runat="server" CssClass="checkbox" Text="Exist in Hierarchy" />
                            </div>
                        </div>



                        <h4>Subordinates</h4>
                        <hr />
                        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" OnRowCommand="GridView2_RowCommand"
                            CssClass="table table-striped table-bordered table-hover" CellPadding="0">
                            <Columns>
                                <asp:TemplateField HeaderText="Position Name" HeaderStyle-Width="150px" ItemStyle-Width="150px">
                                    <ItemTemplate>
                                        <div class="input-group">
                                            <asp:HiddenField ID="hid_pos_strc_elem" runat="server" Value='<%#Bind("POS_STRUCTURE_ELEMENT_ID") %>' />
                                            <asp:HiddenField ID="hid_sub_ord_pos_id" runat="server" Value='<%#Bind("SUBORDINATE_POSITION_ID") %>'  />
                                            <asp:TextBox ID="txt_name" runat="server" CssClass="form-control" Text='<%#Bind("SUBORDINATE_POSITION_NAME") %>' ></asp:TextBox>
                                            <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup='<%#"add_"+Container.DataItemIndex %>' runat="server" ID="req_txt_name" ControlToValidate="txt_name" ErrorMessage="Receive Date is Required!" />
                                            <span class="input-group-btn">
                                                <button id="btn_lov" type="button" runat="server" class="btn btn-white" onserverclick="btn_lov_ServerClick"><i class="fa fa-search"></i></button>
                                            </span>
                                        </div>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Name" HeaderStyle-Width="150px" ItemStyle-Width="150px">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="ddl_name" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                        <%--<asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup='<%#"add_"+Container.DataItemIndex %>' runat="server" ID="req_ddl_name" ControlToValidate="ddl_name" ErrorMessage="Payment Mode is Required!" />--%>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Number" HeaderStyle-Width="100px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_num" onkeypress="return numbersOnly(event)" Style="text-align: right" AutoPostBack="true" runat="server" CssClass="form-control"></asp:TextBox>
                                        <%--<asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup='<%#"add_"+Container.DataItemIndex %>' runat="server" ID="req_txt_num" ControlToValidate="txt_num" ErrorMessage="Receive Amount is Required!" />--%>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Number of Subordinates" HeaderStyle-Width="100px" ItemStyle-Width="100px">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_num_of_sub_ord" Enabled="false" runat="server" Style="text-align: right" CssClass="form-control"></asp:TextBox>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Action">
                                    <ItemTemplate>
                                        <asp:LinkButton ID="linkedit" runat="server" Visible="false" CommandName="gEdit"><i class="fa fa-pencil" style="font-size:20px !important;"></i></asp:LinkButton>
                                        <asp:LinkButton ID="lnk_add" ValidationGroup='<%#"add_"+Container.DataItemIndex %>' runat="server" CommandName="gadd"><i class="fa fa-plus" style="font-size:20px !important;"></i></asp:LinkButton>
                                    </ItemTemplate>
                                    <ItemStyle Width="6%"></ItemStyle>
                                </asp:TemplateField>
                            </Columns>
                            <%--<FooterStyle CssClass="footerStyle" />
                                    <HeaderStyle CssClass="headerStyle" />
                                    <RowStyle CssClass="rowStyle" />--%>
                        </asp:GridView>

                    </div>
                </section>
            </div>
        </div>
    </div>
</asp:Content>
