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

<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">
                        Unit Of Measure Classes
                            <div class="pull-right">
                                <asp:Button Text="Save" CssClass="btn btn-info" ID="btn_save" Width="120px"
                                    ValidationGroup="save" runat="server" OnClick="btn_save_Click" />
                                <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" style="padding-top: 10px">

                            <%-- <asp:HiddenField ID="SuppID" runat="server" />--%>
                            <asp:HiddenField ID="hid_uom_class" runat="server" />
                            <label class="control-label col-md-2">Name</label>
                            <div class="col-md-3">
                                <div class="input-group">
                                    <asp:TextBox ID="txt_ClassName" runat="server" CssClass="form-control">
                                    </asp:TextBox>
                                    <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save"
                                        runat="server" ID="req_txt_ClassName" ControlToValidate="txt_ClassName"
                                        ErrorMessage="ClassName is Required!" />

                                </div>
                            </div>
                            <label class="col-md-2 control-label">Base Unit</label>
                            <div class="col-md-3">
                                <div class="input-group">
                                    <asp:TextBox Enabled="false" ID="txt_BaseUnit" runat="server" CssClass="form-control"></asp:TextBox>

                                </div>
                            </div>
                        </div>

                        <div class="row" style="padding-top: 10px">

                            <label class="col-md-2 control-label">UOM</label>
                            <div class="col-md-3">
                                <asp:TextBox ID="txt_UOM" runat="server" CssClass="form-control"></asp:TextBox>

                            </div>

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


                        <div class="row" style="padding-top: 10px">

                            <label class="col-md-2 control-label">Description</label>
                            <div class="col-md-3">
                                <div class="input-group">
                                    <asp:TextBox ID="txt_desc" runat="server" CssClass="form-control" TextMode="MultiLine"></asp:TextBox>

                                </div>
                            </div>


                        </div>


                        <div class="pull-left">
                            <div class="control-label">Unit Of Measure</div>
                        </div>
                       
                            <hr />





                        <div class="row">
                            <div class="col-md-12">
                                <asp:GridView ID="GridView1" Visible="true" runat="server" AutoGenerateColumns="False"
                                    CssClass="table table-striped table-bordered table-hover" CellPadding="0" Width="100%" OnRowCommand="GridView1_RowCommand">
                                    <Columns>
                                        <asp:TemplateField HeaderText="Name" HeaderStyle-Width="30%">
                                            <ItemTemplate>
                                                <asp:HiddenField ID="hid_uom" runat="server" Value='<%# Bind("uom_ID") %>' />
                                                <asp:TextBox ID="txt_uom_name" Text='<%# Bind("UNIT_OF_MEASURE_TL") %>' runat="server" CssClass="form-control"></asp:TextBox>
                                                <%--<asp:RequiredFieldValidator SetFocusOnError="true" runat="server" ID="reqtxt_uom_name" ControlToValidate="txt_uom_name" ErrorMessage="Receive Date is Required!" />--%>
                                            </ItemTemplate>
                                        </asp:TemplateField>


                                        <asp:TemplateField HeaderText="UOM" HeaderStyle-Width="20%">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txt_uom" Text='<%# Bind("uom_code") %>' runat="server" CssClass="form-control"></asp:TextBox>
                                                <%--<asp:RequiredFieldValidator SetFocusOnError="true" runat="server" ID="reqtxt_uom" ControlToValidate="txt_uom" ErrorMessage="Receive Date is Required!" />--%>
                                            </ItemTemplate>
                                        </asp:TemplateField>


                                        <asp:TemplateField HeaderText="Description" HeaderStyle-Width="30%">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txt_desc" Text='<%# Bind("DESCRIPTION") %>' runat="server" CssClass="form-control"></asp:TextBox>
                                                <%--<asp:RequiredFieldValidator SetFocusOnError="true" runat="server" ID="reqtxt_desc" ControlToValidate="txt_desc" ErrorMessage="Receive Date is Required!" />--%>
                                            </ItemTemplate>
                                        </asp:TemplateField>


                                        <asp:TemplateField HeaderText="Base Unit" HeaderStyle-Width="40px">
                                            <ItemTemplate>
                                                <asp:CheckBox ID="chk_bu" runat="server" CssClass="checkbox" Enabled='<%#bool.Parse(Eval("base_uom_flag").ToString() == "Y" ? "False":"True") %>' Checked='<%# bool.Parse(Eval("base_uom_flag").ToString() == "Y" ? "True": "False") %>' />
                                            </ItemTemplate>
                                        </asp:TemplateField>


                                        <asp:TemplateField HeaderText="Inactive On" HeaderStyle-Width="40%">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txt_inactive_dt" Text='<%# Bind("disable_date") %>' runat="server" CssClass="form-control datetime"></asp:TextBox>
                                            </ItemTemplate>
                                        </asp:TemplateField>


                                        <asp:TemplateField HeaderText="Action" ItemStyle-Width="6%">
                                            <ItemTemplate>
                                                <asp:LinkButton ID="lnk_add" 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>

                        <div class="pull-right">
                            <asp:Button ID="btn_con" runat="server" CssClass="btn btn-info" Text="Conversions" OnClick="btn_con_Click" />
                        </div>
                    </div>
                </section>
            </div>
        </div>
    </div>
</asp:Content>
