<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="End_Set_Element.aspx.cs" Inherits="HRMS.End_Set_Element" %>
<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">
                       End Settlement Element 
                        <div class="pull-right">
                       <asp:Button CssClass="btn btn-info" ID="btn_save" runat="server" Text="Save"  ValidationGroup="save" onclick="btn_save_Click"/>
                            <asp:Button CssClass="btn btn-info" ID="btn_cancel" runat="server" Text="Back"  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">
                                    <i class="icon-check-sign"></i>
                                    <asp:Label ID="lblMessage" class="msg" runat="server" Text="" ></asp:Label>
                                </div>
                                <div class="span6">
                                    <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>



                        <div class="row">
                            <asp:HiddenField ID="hid_set_elemn" runat="server" />
                            <label class="control-label col-md-2">Element</label>
                            <div class="col-md-3">
                                <asp:DropDownList ID="ddl_elem" runat="server" CssClass="form-control select2" AutoPostBack="true" OnSelectedIndexChanged="ddl_elem_SelectedIndexChanged"></asp:DropDownList>
                                <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_ins_amt" controltovalidate="ddl_elem" errormessage="Element is Required!" />
                            </div>


                                   <label class="control-label col-md-2">Name</label>
                            <div class="col-md-3">
                                <asp:TextBox ID="txt_name" Enabled="false" runat="server" CssClass="form-control"></asp:TextBox>
                            </div>
                        </div>


                        <div class="row">
                            <label class="control-label col-md-2">Half</label>
                            <div class="col-md-3">
                                <asp:TextBox ID="txt_hlf" runat="server" CssClass="form-control"></asp:TextBox>
                                <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="RequiredFieldValidator1" controltovalidate="txt_hlf" errormessage="Half Value is Required!" />
                            </div>


                                   <label class="control-label col-md-2">Full</label>
                            <div class="col-md-3">
                                <asp:TextBox ID="txt_full" runat="server" CssClass="form-control"></asp:TextBox>
                                <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="RequiredFieldValidator2" controltovalidate="txt_full" errormessage="Full Value is Required!" />
                            </div>
                        </div>
                        <hr />

                        <div class="row">
                            <label class="control-label col-md-2">Date From</label>
                            <div class="col-md-3">
                                <asp:TextBox ID="txt_date_frm" runat="server" CssClass="form-control datetime"></asp:TextBox>
                                <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="RequiredFieldValidator3" controltovalidate="txt_date_frm" errormessage="Date From is Required!" />
                            </div>


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

                        <hr />
                        <div class="row col-md-offset-2">

                        
                        <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" Visible="false"
                        CssClass="table table-striped table-bordered table-hover" CellPadding="0" Width="70%" OnRowCommand="GridView2_RowCommand" OnRowDataBound="GridView2_RowDataBound">
                                <Columns>
                                <asp:TemplateField HeaderStyle-Width="1%">
                                    <ItemTemplate>
                                    <asp:HiddenField ID="hid_elem_hdr" runat="server" Value='<%#Bind("END_SET_ELEMENT_HEADER_ID")%>' />
                                        <asp:HiddenField ID="hid_elem_line" runat="server" Value='<%#Bind("END_SET_ELEMENT_LINE_ID")%>' />
                                        <asp:HiddenField ID="hid_elem" runat="server" Value='<%#Bind("ELEMENT_TYPE_ID")%>' />
                                    </ItemTemplate>
                                </asp:TemplateField>    

                                <asp:TemplateField HeaderText="Element Name">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="ddl_elem" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                        <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup='<%# "add_"+Container.DataItemIndex %>' runat="server" id="req1" controltovalidate="ddl_elem" errormessage="Element is Required!" />
                                    </ItemTemplate>
                                </asp:TemplateField>

                                  <asp:TemplateField HeaderText="Date From">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_date_frm" runat="server" CssClass="form-control datetime" Text='<%#Bind("DATE_FROM") %>'></asp:TextBox>
                                        <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup='<%# "add_"+Container.DataItemIndex %>' runat="server" id="req2" controltovalidate="txt_date_frm" errormessage="Date From is Required!" />
                                    </ItemTemplate>
                                </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Date To">
                                    <ItemTemplate>
                                        <asp:TextBox ID="txt_dateto" runat="server" CssClass="form-control datetime" Text='<%#Bind("DATE_TO") %>'></asp:TextBox>
                                        <%--<asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="d_save" runat="server" id="req_rcv_amt" controltovalidate="txt_rcv_amount" errormessage="Receive Amount is Required!" />--%>
                                    </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>
                                            <asp:linkbutton ID="linkdlt" Visible="false" 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>
