<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="Requisition_Location.aspx.cs" Inherits="HRMS.Requisition_Location" %>
<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">
                        Location
                         <div class="pull-right">
                            <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">
                            <asp:HiddenField ID="hid_requisition" runat="server" />
                            <asp:HiddenField ID="hid_req_line_id" runat="server" />
                            <asp:HiddenField ID="hid_bg_grp" runat="server" />
                            <asp:HiddenField ID="hid_position" runat="server" />
                        </div>

                        <div class="table-responsive">
                          <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" 
                                CssClass="table table-striped table-bordered table-hover" CellPadding="0" OnRowCommand="GridView3_RowCommand" OnRowDataBound="GridView3_RowDataBound">
                                <Columns>

                                <asp:TemplateField HeaderStyle-Width="1%" ItemStyle-Width="1%" FooterStyle-Width="1%">
                                    <ItemTemplate>
                                        <asp:HiddenField ID="hid_location_dtl" runat="server" Value='<%#Bind("LOCATION_DTL_ID")%>' />
                                        <asp:HiddenField ID="hid_location" runat="server" Value='<%#Bind("LOCATION_ID")%>' />
                                        <asp:HiddenField ID="hid_position" runat="server" Value='<%#Bind("POSITION_ID")%>' />  
                                        <asp:HiddenField ID="hid_city" runat="server" Value='<%#Bind("CITY_ID")%>' /> 
                                        <asp:HiddenField ID="hid_state" runat="server" Value='<%#Bind("STATE_ID")%>' /> 
                                        <asp:HiddenField ID="hid_country" runat="server" Value='<%#Bind("COUNTRY_ID")%>' /> 
                                    </ItemTemplate>
                                </asp:TemplateField> 

                                      <asp:TemplateField HeaderText="Position" ItemStyle-Width="25%">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_pos_name" Enabled="false" runat="server"  CssClass="form-control"></asp:TextBox>
                                        <asp:DropDownList Visible="false" ID="ddl_position" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                    </ItemTemplate>
                                </asp:TemplateField>


                                <asp:TemplateField HeaderText="Location" HeaderStyle-Width="15%" ItemStyle-Width="15%" FooterStyle-Width="15%">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="ddl_location" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                        <asp:RequiredFieldValidator runat="server" ID="rq1" ControlToValidate="ddl_location" ErrorMessage="Location is required." setfocusonerror="true" ValidationGroup = '<%# "add1_" + Container.DataItemIndex %>'></asp:RequiredFieldValidator>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                    
                             

                                <asp:TemplateField HeaderText="City" HeaderStyle-Width="15%" ItemStyle-Width="15%" FooterStyle-Width="15%">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="ddl_city" runat="server" AutoPostBack="true" CssClass="form-control select2" OnSelectedIndexChanged="ddl_city_SelectedIndexChanged"></asp:DropDownList>
                                        <asp:RequiredFieldValidator runat="server" ID="rq3" ControlToValidate="ddl_city" ErrorMessage="City is required." setfocusonerror="true" ValidationGroup = '<%# "add1_" + Container.DataItemIndex %>'></asp:RequiredFieldValidator>
                                    </ItemTemplate>
                                </asp:TemplateField>                                    

                                <asp:TemplateField HeaderText="State" HeaderStyle-Width="15%" ItemStyle-Width="15%" FooterStyle-Width="15%">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="ddl_state" runat="server" AutoPostBack="true" CssClass="form-control select2" OnSelectedIndexChanged="ddl_state_SelectedIndexChanged"></asp:DropDownList>
                                        <asp:RequiredFieldValidator runat="server" ID="rq4" ControlToValidate="ddl_state" ErrorMessage="State is required." setfocusonerror="true" ValidationGroup = '<%# "add1_" + Container.DataItemIndex %>'></asp:RequiredFieldValidator>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Country" HeaderStyle-Width="15%" ItemStyle-Width="15%" FooterStyle-Width="15%">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="ddl_country" runat="server" AutoPostBack="true" CssClass="form-control select2"></asp:DropDownList>
                                        <asp:RequiredFieldValidator runat="server" ID="rq5" ControlToValidate="ddl_country" ErrorMessage="Country is required." setfocusonerror="true" ValidationGroup = '<%# "add1_" + Container.DataItemIndex %>'></asp:RequiredFieldValidator>
                                    </ItemTemplate>
                                </asp:TemplateField>

                                <asp:TemplateField HeaderText="Vaccancies" HeaderStyle-Width="15%" ItemStyle-Width="15%" FooterStyle-Width="15%">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_vaccancies" runat="server" onkeypress="return numbersOnly(event);" Text='<%#Bind("NO_OF_VACANCIES")%>' CssClass="form-control"></asp:TextBox>
                                        <asp:RequiredFieldValidator runat="server" ID="rq6" ControlToValidate="txt_vaccancies" ErrorMessage="Vaccancies is required." setfocusonerror="true" ValidationGroup = '<%# "add1_" + Container.DataItemIndex %>'></asp:RequiredFieldValidator>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                                                
                                    <asp:TemplateField HeaderText="Action" HeaderStyle-Width="9%" ItemStyle-Width="9%" FooterStyle-Width="9%">
                                                            <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= '<%# "add1_" + Container.DataItemIndex %>'
                                                                    runat="server" CommandName="gadd"><i
                                                                        class="fa fa-plus"
                                                                        style="font-size:20px !important;"></i>
                                                                </asp:LinkButton>
                                                                <asp:linkbutton ID="linkdlt" CausesValidation="false"
                                                                    CommandName="gDelete" runat="server"
                                                                    OnClientClick="return confirm('Are you sure to delete?')">
                                                                    <i class="fa fa-trash"
                                                                        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>
                    </div>
                </section>
            </div>
        </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>
        $('.select2').select2();
    </script>
</asp:Content>
