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

<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">
                        Country Setup
                          <div class="action pull-right">
                              <asp:Button ID="btnSave" ValidationGroup="save" class="btn btn-info" runat="server" Text="Save" OnClick="btnSave_Click"></asp:Button>
                              <input type="button" value="New Record" class="btn btn-info" onclick="clearTextBox()" />
                          </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="control-label col-xs-12 col-md-2 ">Country Code</label>
                            <div class="col-xs-12 col-md-2">
                                <asp:TextBox ID="txt_ctr_code" runat="server" CssClass="form-control"></asp:TextBox>
                            </div>
                        </div>

                        <div class="row" style="padding-top: 05px">
                            <asp:HiddenField ID="hid_country" runat="server" />
                                <label class="control-label col-xs-12 col-md-2">Title</label>

                            <div class="col-xs-12 col-md-3">
                                <asp:TextBox ID="txt_title" runat="server" CssClass="form-control"></asp:TextBox>
                            </div>


                                <label class="control-label col-xs-12 col-md-2">Country Name</label>

                            <div class="col-xs-12 col-md-3">
                                <asp:TextBox ID="txt_name" runat="server" CssClass="form-control"></asp:TextBox>
                                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator3" ControlToValidate="txt_name" ErrorMessage="Country is required. " ValidationGroup="save" SetFocusOnError="true"></asp:RequiredFieldValidator>
                            </div>
                        </div>

                        <div class="row" style="padding-top: 05px">
                                <label class="control-label col-xs-12 col-md-2">Date From</label>

                            <div class="col-xs-12 col-md-3">
                                <asp:TextBox ID="txt_frm_date" runat="server" CssClass="form-control datetime"></asp:TextBox>
                                <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" ControlToValidate="txt_frm_date" ErrorMessage="Date From is required. " ValidationGroup="save" SetFocusOnError="true"></asp:RequiredFieldValidator>
                            </div>

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

                        <hr />

                        <div class="table-responsive">
                            <asp:GridView ID="grd" runat="server" AutoGenerateColumns="False"
                                CellPadding="0" border="0" class="display" OnRowCommand="grd_RowCommand">
                                <Columns>
                                    <asp:BoundField HeaderText="ID" DataField="COUNTRY_ID" />
                                    <asp:BoundField HeaderText="Title" DataField="TITLE" />
                                    <asp:BoundField HeaderText="Country Name" DataField="COUNTRY_NAME" />
                                    <asp:BoundField HeaderText="Date From" DataField="DATE_FROM" />
                                    <asp:BoundField HeaderText="Date To" DataField="DATE_TO" />
                                    <asp:BoundField DataField="COUNTRY_CODE" ItemStyle-CssClass="hidden" HeaderStyle-CssClass="hidden" />

                                    <asp:TemplateField ItemStyle-Width="6%" HeaderText="Action">
                                        <ItemTemplate>
                                            <%--   <%#Container.DataItemIndex+1 %>
                        <asp:CheckBox ID="chk" runat="server" />--%>
                                            <asp:LinkButton ID="lnkEdit" runat="server" CommandName="gEdit"><i class="fa fa-pencil" style="font-size:20px !important"></i></asp:LinkButton>
                                            &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>

                                        <ItemStyle Width="6%"></ItemStyle>
                                    </asp:TemplateField>
                                </Columns>
                                <%-- Mandatory--%>
                                <RowStyle CssClass="rowStyle" />
                                <%-- Mandatory--%>
                                <HeaderStyle CssClass="headerStyle" />
                                <%-- optional--%>
                                <FooterStyle CssClass="footerStyle" />
                            </asp:GridView>
                        </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").GridviewFix().dataTable();
                //Passing class names
                        </script>


                        <script type="text/javascript">
                            function clearTextBox() {
                                var elements = document.getElementsByTagName("input");
                                for (var ii = 0; ii < elements.length; ii++) {
                                    if (elements[ii].type == "text" || elements[ii].type == "hidden") {
                                        elements[ii].value = "";

                                    }
                                }
                            }
                        </script>

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