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

<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">
                        Final Candidates List
                    </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 style="width: 102%; height:250px; overflow: scroll">

                          <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"
                                        CssClass="table table-striped table-bordered table-hover" CellPadding="0" OnRowCommand="GridView2_RowCommand">
                                        <Columns>
                                            <asp:TemplateField HeaderText="Candidate Name" HeaderStyle-Width="20%" ItemStyle-Width="20%">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hid_candidate" runat="server" Value='<%# Bind("CANDIDATE_ID") %>' />
                                                    <asp:HiddenField ID="hid_vac" runat="server" Value='<%# Bind("VACANCY_APPLY_ID") %>' />
                                                    <asp:HiddenField ID="hid_pos" runat="server" Value='<%# Bind("POSITION_ID") %>' />
                                                    <asp:HiddenField ID="hid_city" runat="server" Value='<%# Bind("CityName") %>' />

                                                    <asp:HiddenField ID="hid_bg" runat="server" Value='<%# Bind("BUSINESS_GROUP_ID") %>' />
                                                    <asp:HiddenField ID="hid_fname" runat="server" Value='<%# Bind("FIRST_NAME") %>' />
                                                    <asp:HiddenField ID="hid_lname" runat="server" Value='<%# Bind("LAST_NAME") %>' />
                                                    <asp:HiddenField ID="hid_dob" runat="server" Value='<%# Bind("DATE_OF_BIRTH") %>' />
                                                    <asp:HiddenField ID="hid_email" runat="server" Value='<%# Bind("EMAIL") %>' />
                                                    <asp:HiddenField ID="hid_cntry" runat="server" Value='<%# Bind("COUNTRY_ID") %>' />
                                                   <asp:Label CssClass="control-label" ID="lbl_candidate_name" runat="server" Text='<%#Bind("NAME")  %>'></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Position" HeaderStyle-Width="25%" ItemStyle-Width="25%">
                                                <ItemTemplate>
                                                    <asp:Label CssClass="control-label" ID="lbl_pos" runat="server" Text='<%#Bind("POSITION")  %>'>></asp:Label>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Offer Date" HeaderStyle-Width="20%" ItemStyle-Width="20%">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_ofr_date" runat="server"  CssClass="form-control datetime" Text='<%# Bind("OFFER_DATE") %>'></asp:TextBox>
                                                    <asp:RequiredFieldValidator runat="server" ID="Reqdt" ControlToValidate="txt_ofr_date" ErrorMessage="Offer Date is required." setfocusonerror="true" ValidationGroup = '<%# "add_" + Container.DataItemIndex %>'></asp:RequiredFieldValidator>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                             <asp:TemplateField HeaderText="Acceptance Date" HeaderStyle-Width="20%" ItemStyle-Width="20%">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_ofr_acp_date" runat="server"  CssClass="form-control datetime" Text='<%# Bind("OFFER_ACCEPTANCE_DATE") %>'></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            
                                             <asp:TemplateField HeaderText="Date Of Joining" HeaderStyle-Width="20%" ItemStyle-Width="20%">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_doj" runat="server"  CssClass="form-control datetime" Text='<%# Bind("DATE_OF_JOINING") %>'></asp:TextBox>
                                                    <asp:RequiredFieldValidator runat="server" ID="Reqdoj" ControlToValidate="txt_doj" ErrorMessage="Date of Joining is required." setfocusonerror="true" ValidationGroup = '<%# "add_" + Container.DataItemIndex %>'></asp:RequiredFieldValidator>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                          

                                            <asp:TemplateField HeaderText="Action" ItemStyle-Width="5%">
                                                <ItemTemplate>
                                                    <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>
                                            </asp:TemplateField>

                                                <asp:TemplateField HeaderText="Print Offer Letter">
                                                <ItemTemplate>
                                                    <asp:Button ID="btn_prnt_ofr_ltr" Enabled='<%# bool.Parse(Eval("CANDIDATE_ID").ToString()==""?"False":"True") %>' runat="server" CssClass="btn btn-primary" Text="Print Offer Letter" OnClick="btn_prnt_ofr_ltr_Click" />
                                                </ItemTemplate>

                                                    
                                            </asp:TemplateField>

                                             <asp:TemplateField HeaderText="Create Employee">
                                                <ItemTemplate>
                                                    <asp:Button ID="btn_cr_emp" Enabled='<%# bool.Parse(Eval("OFFER_ACCEPTANCE_DATE").ToString()==""?"False":"True") %>' runat="server" CssClass="btn btn-primary" Text="Create Employee" OnClick="btn_cr_emp_Click"/>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                           
                                        </Columns>
                                    </asp:GridView>
                            </div>
                    </div>
                </section>
            </div>
        </div>
    </div>
</asp:Content>
