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

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="scriptManager" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel runat="server" ID="upMain" UpdateMode="Conditional" ChildrenAsTriggers="true">
        <ContentTemplate>
            <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].value = "";
                        }
                    }
                    document.getElementById('<%=hid_flx_value_set_id.ClientID %>').value = "";

                }
            </script>
            <div class="main-panel">
                <div class="row">
                    <div class="col-md-12">
                        <section class="panel">
                    <header class="panel-heading" style="padding-bottom:30px">
                           <span class="label label-primary">Value Set</span>
                       
                        <div class="pull-right">
                            <asp:button text="Save" CssClass="btn btn-info" ID="btn_save" runat="server"  ValidationGroup="save"
                                onclick="btn_save_Click" />
                            <asp:button text="Back" CssClass="btn btn-info" ID="btn_cancel" 
                                runat="server" onclick="btn_cancel_Click" />

                                 <input type="button" value="Clear" 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">
                             <asp:HiddenField ID="hid_flx_value_set_id" runat ="server" />
                                <label class="control-label col-md-2">Value Set Name</label>
                                <div class="col-md-3">
                                    <asp:textbox CssClass="form-control" ID="txt_name" runat="server"></asp:textbox>
                                    <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_name" controltovalidate="txt_name" errormessage="Name Required!" />
                                </div>
                            </div>


                             <div class="row">
                                <label class="control-label col-md-2">Description</label>
                                <div class="col-md-6">
                                    <asp:textbox CssClass="form-control" ID="txt_desc" runat="server"></asp:textbox>
                                     <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="req_desc" controltovalidate="txt_desc" errormessage="Description Required!" />
                                </div>
                            </div>


                            <div class="row">
                                <label class="control-label col-md-2">List Type</label>
                                <div class="col-md-2">
                                    <asp:textbox CssClass="form-control" ID="Textbox1" runat="server"></asp:textbox>
                                     <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="RequiredFieldValidator1" controltovalidate="txt_desc" errormessage="Description Required!" />
                                </div>

                                <label class="control-label col-md-2">Security Type</label>
                                <div class="col-md-2">
                                    <asp:textbox CssClass="form-control" ID="Textbox2" runat="server"></asp:textbox>
                                     <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="RequiredFieldValidator2" controltovalidate="txt_desc" errormessage="Description Required!" />
                                </div>
                            </div>
                            <br />
                            <div class="row">
                                <div class="col-md-11">
                                    <label class="col-md-2 control-label">Format Validation</label>
                                    <hr />
                                </div>
                            </div>


                            <div class="row">
                                <label class="col-md-2 control-label">Format Type</label>
                                <div class="col-md-2">
                                    <asp:DropDownList ID="ddl_type" runat="server" CssClass="form-control"></asp:DropDownList>
                                </div>

                                <label class="col-md-2 control-label">Maximum Size</label>
                                <div class="col-md-1">
                                    <asp:TextBox ID="txt" runat="server" CssClass="form-control"></asp:TextBox>
                                </div>

                                 <label class="col-md-1 control-label">Precision</label>
                                <div class="col-md-1">
                                    <asp:TextBox ID="TextBox3" runat="server" CssClass="form-control"></asp:TextBox>
                                </div>
                            </div>


                             <div class="row">
                                <label class="col-md-2 control-label">Minimum Value</label>
                                <div class="col-md-2">
                                    <asp:TextBox ID="TextBox4" runat="server" CssClass="form-control"></asp:TextBox>
                                </div>

                                 <label class="col-md-2 control-label">Maximum Value</label>
                                <div class="col-md-2">
                                    <asp:TextBox ID="TextBox5" runat="server" CssClass="form-control"></asp:TextBox>
                                </div>
                            </div>

                            <hr />
                            <div class="pull-right">
                                <asp:button text="Segments" ID="btn_seg" CssClass="btn btn-info" runat="server" 
                                    onclick="btn_seg_Click" />
                                <asp:button text="Add Values" CssClass="btn btn-info" ID="btn_add_detail" 
                                    runat="server" onclick="btn_add_detail_Click" />
                            </div>

                            <h4>List Of Values</h4>

                              <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                              CssClass="display" CellPadding="0" onrowcommand="GridView1_RowCommand">
                                <Columns>
                                    <asp:BoundField DataField="FLEX_VALUE_ID" HeaderText="ID" />
                                    <asp:BoundField DataField="FLEX_VALUE_MEANING" HeaderText="Value" />
                                    <asp:BoundField DataField="DESCRIPTION" HeaderText="Description" />
                                    
                                    <asp:BoundField DataField="HIERARCHY_LEVEL" HeaderText="Level" />
                                    <asp:BoundField DataField="Summary_Flag" HeaderText="Parent" />
                                    <asp:BoundField DataField="parent_account" HeaderText="Parent Account" />
                                    <asp:TemplateField HeaderText="Action" ItemStyle-Width="6%">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="linkedit" runat="server" CommandName="gEdit"><i class="fa fa-pencil" style="font-size:20px !important;"></i></asp:LinkButton>
                                            <asp:linkbutton ID="linkdlt" CausesValidation="false" Visible="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>
                            <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">
                                $("#ContentPlaceHolder1_GridView1").GridviewFix().dataTable();
                            </script>



                    </div>

                </section>
                    </div>
                </div>
            </div>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btn_save" EventName="Click" />
            <asp:AsyncPostBackTrigger ControlID="GridView1" EventName="RowCommand" />
        </Triggers>
    </asp:UpdatePanel>
</asp:Content>
