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

<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">
                        Requisitions
                            <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="hid_REQUISITION_ID" runat="server" />
                            <asp:HiddenField ID="hid_ORG_ID" runat="server" />
                            <%--<asp:HiddenField ID="hid_countryId" runat="server" />--%>
                            <label class="control-label col-md-2">Operating Unit</label>
                            <div class="col-md-3">
                                <div class="input-group">
                                    <asp:TextBox CssClass="form-control" ID="txt_operatingUnit" runat="server">
                                    </asp:TextBox>
                                    <asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save"
                                        runat="server" ID="req_Operating" ControlToValidate="txt_operatingUnit"
                                        ErrorMessage="Operating Unit is Required!" />
                                    <span class="input-group-btn">
                                        <button id="btn_lov_operatingUnit" type="button" runat="server"
                                            class="btn btn-white" onserverclick="btn_lov_operatingUnit_Click">
                                            <i
                                                class="fa fa-search"></i>
                                        </button>
                                    </span>
                                </div>
                            </div>
                            <label class="col-md-2 control-label">Number</label>
                            <div class="col-md-3">
                                <asp:TextBox CssClass="form-control" ID="txt_Number" runat="server">
                                </asp:TextBox>
                            </div>

                        </div>

                        <div class="row" style="padding-top: 10px">
                            <asp:HiddenField ID="hid_parentCode" runat="server" />
                            <label class="col-md-2 control-label">Type</label>
                            <div class="col-md-3">
                                <asp:DropDownList ID="ddl_type" runat="server" CssClass="form-control"></asp:DropDownList>
                            </div>

                            <label class="col-md-2 control-label">Preparer</label>
                            <div class="col-md-3">

                                <asp:TextBox ID="txt_preparer" runat="server" CssClass="form-control">
                                </asp:TextBox>
                            </div>
                        </div>

                        <div class="row" style="padding-top: 10px">
                            <label class="col-md-2 control-label">Description</label>
                            <div class="col-md-3">
                                <asp:TextBox ID="txt_Desc" runat="server" CssClass="form-control"></asp:TextBox>
                            </div>
                            <%--<asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save"
                                    runat="server" id="req_ins_amt" controltovalidate="txt_ints_amt"
                                    errormessage="Installment Amount is Required!" />--%>


                            <label class="col-md-2 control-label">Status</label>
                            <div class="col-md-3">
                                <asp:DropDownList ID="ddl_status" runat="server" CssClass="form-control"></asp:DropDownList>


                            </div>
                        </div>

                        <div class="row" style="padding-top: 10px">
                            <label class="col-md-2 control-label">Total</label>
                            <div class="col-md-1">
                                <asp:TextBox ID="txt_GBP" Text="GBP" Width="80%" runat="server"
                                    CssClass="form-control">
                                </asp:TextBox>
                            </div>
                            <div class="col-md-3">
                                <asp:TextBox ID="TextBox1" Width="63%" runat="server" CssClass="form-control">
                                </asp:TextBox>
                            </div>

                        </div>

                        <hr />


                        <asp:HiddenField runat="server" ID="hidTAB" Value="0" />

                        <ul class="nav nav-tabs" id="myTabs">
                            <li class="active"><a data-toggle="tab" id="line_click" href="#Line" aria-expanded="true">Line</a></li>



                            <li><a data-toggle="tab" href="#SourceDetail" aria-expanded="true">Source Detail</a></li>
                            <li><a data-toggle="tab" href="#Detail" aria-expanded="false">Detail</a></li>
                            <li><a data-toggle="tab" href="#Currency" aria-expanded="false">Currency</a></li>
                        </ul>

                        <div class="tab-content">
                            <div id="Line" class="tab-pane fade active in">
                                <br>

                                <div style="width: 102%; height: 250px; overflow: scroll">
                                    <asp:GridView ID="Grd_Line" runat="server" AutoGenerateColumns="False"
                                        CssClass="table table-striped table-bordered table-hover" CellPadding="0"
                                        OnRowDataBound="Grd_Line_RowDataBound" OnRowCommand="Grd_Line_RowCommand1">
                                        <Columns>
                                            <asp:TemplateField HeaderText="Number" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hid_line_id" runat="server" Value='<%#Bind("REQUISITION_LINE_ID")%>' />
                                                    <asp:TextBox CssClass="form-control" ID="txt_line_Number" Enabled="false"
                                                        runat="server" Text='<%#Bind("LINE_NUM") %>'>
                                                    </asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Type" ControlStyle-Width="180px" ItemStyle-Width="180px">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hid_line_type" runat="server" Value='<%#Bind("LINE_TYPE_ID") %>' />
                                                    <asp:DropDownList ID="ddl_line_type" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Item" ControlStyle-Width="220px" ItemStyle-Width="220px">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hid_Item" runat="server"
                                                        Value='<%#Bind("ITEM_ID")%>' />
                                                    <div class="input-group">
                                                        <asp:TextBox CssClass="form-control" ID="txt_Item"
                                                            runat="server" Text='<%#Bind("ItemName") %>'>
                                                        </asp:TextBox>

                                                        <span class="input-group-btn">
                                                            <button id="btn_lov_Item" type="button" runat="server"
                                                                class="btn btn-white" onserverclick="btn_lov_Item_ServerClick">
                                                                <i class="fa fa-search"></i>
                                                            </button>
                                                        </span>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Rev" ControlStyle-Width="50px" ItemStyle-Width="50px">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_rev" runat="server"
                                                        Text='<%#Bind("ITEM_REVISION") %>'
                                                        CssClass="form-control"></asp:TextBox>

                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Category" ControlStyle-Width="180px" ItemStyle-Width="180px">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        <asp:HiddenField ID="hid_Cat" runat="server"
                                                            Value='<%#Bind("CATEGORY_ID")%>' />
                                                        <asp:TextBox CssClass="form-control" ID="txt_Category"
                                                            runat="server" Text='<%#Bind("CatName") %>'>
                                                        </asp:TextBox>

                                                        <span class="input-group-btn">
                                                            <button id="btn_lov_Category" type="button" runat="server"
                                                                class="btn btn-white">
                                                                <i class="fa fa-search"></i>
                                                            </button>
                                                        </span>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Description" ControlStyle-Width="220px" ItemStyle-Width="220px">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_Desc" runat="server"
                                                        Text='<%#Bind("ITEM_DESCRIPTION") %>' CssClass="form-control"></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="UOM" ControlStyle-Width="180px" ItemStyle-Width="180px">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        <asp:HiddenField ID="hid_UOM" runat="server"
                                                            Value='<%#Bind("UNIT_MEAS_LOOKUP_CODE")%>' />
                                                        <asp:TextBox CssClass="form-control" ID="txt_UOM"
                                                            runat="server" Text='<%#Bind("UOM") %>'>
                                                        </asp:TextBox>

                                                        <span class="input-group-btn">
                                                            <button id="btn_lov_UOMLine" type="button" runat="server"
                                                                class="btn btn-white" onserverclick="btn_lov_UOMLine_ServerClick">
                                                                <i class="fa fa-search"></i>
                                                            </button>
                                                        </span>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Quantity" ControlStyle-Width="100px" ItemStyle-Width="100px">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_qty" runat="server"
                                                        Text='<%#Bind("QUANTITY") %>' CssClass="form-control"></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Price" ControlStyle-Width="100px" ItemStyle-Width="100px">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_Price" runat="server"
                                                        Text='<%#Bind("UNIT_PRICE") %>' CssClass="form-control"></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Promised" ControlStyle-Width="120px" ItemStyle-Width="120px">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_Promised" runat="server"
                                                        CssClass="form-control datetime"></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Need-By" ControlStyle-Width="120px" ItemStyle-Width="120px">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_Needby" runat="server"
                                                        Text='<%#Bind("NEED_BY_DATE") %>' CssClass="form-control datetime"></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>



                                            <asp:TemplateField HeaderText="Amount" ControlStyle-Width="120px" ItemStyle-Width="120px">
                                                <ItemTemplate>

                                                    <asp:TextBox ID="txt_Amount" runat="server"
                                                        Text='<%#Bind("AMOUNT") %>' CssClass="form-control"></asp:TextBox>

                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Charge Account" ControlStyle-Width="120px" ItemStyle-Width="120px">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_chargAccount" runat="server"
                                                        CssClass="form-control"></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Reserved" ControlStyle-Width="50px" ItemStyle-Width="50px">
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chk_rsvrd" runat="server" CssClass="checkbox" />
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Action" ItemStyle-Width="5%">
                                                <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"
                                                        runat="server" CommandName="gadd"><i class="fa fa-plus"
                                                            style="font-size:20px !important;"></i>
                                                    </asp:LinkButton>
                                                    <asp:LinkButton ID="linkdlt" 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>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Distributions">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="lnk_dist" runat="server" CommandName="gDist"  Text="Distributions" CssClass="btn btn-primary"></asp:LinkButton>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                        </Columns>
                                        <%--  <FooterStyle CssClass="footerStyle" />
                                        <HeaderStyle CssClass="headerStyle" />
                                        <RowStyle CssClass="rowStyle" />--%>
                                    </asp:GridView>
                                </div>
                                <br />
                            </div>


                            <div id="SourceDetail" class="tab-pane fade">
                                <div style="width: 102%; height: 250px; overflow: scroll">
                                    <asp:GridView ID="Grd_Source" runat="server" AutoGenerateColumns="False"
                                        CssClass="table table-striped table-bordered table-hover" CellPadding="0"
                                        OnRowCommand="Grd_Source_RowCommand">
                                        <Columns>
                                            <asp:TemplateField HeaderText="Number" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hid_src_id" runat="server" Value='<%#Bind("REQUISITION_LINE_ID")%>' />
                                                    <asp:TextBox CssClass="form-control" ID="txt_src_Number" Enabled="false"
                                                        runat="server" Text='<%#Bind("LINE_NUM") %>'>
                                                    </asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Note To Buyer" ControlStyle-Width="250px" ItemStyle-Width="250px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" ID="txt_note_buyr"
                                                        runat="server" Text='<%#Bind("NOTE_TO_AGENT") %>'>
                                                    </asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Buyer" ControlStyle-Width="200px" ItemStyle-Width="200px">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        <asp:HiddenField ID="hid_sug_buyer" runat="server" Value='<%#Bind("SUGGESTED_BUYER_ID") %>' />
                                                        <asp:TextBox CssClass="form-control" ID="txt_sug_buyer" runat="server"></asp:TextBox>
                                                        <span class="input-group-btn">
                                                            <button id="btn_lov_byr" type="button" runat="server"
                                                                class="btn btn-white">
                                                                <i class="fa fa-search"></i>
                                                            </button>
                                                        </span>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="RFQ Required" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chk_rfq" runat="server" CssClass="checkbox" />
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Supplier Item" ControlStyle-Width="150px" ItemStyle-Width="150px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" Text='<%#Bind("SUGGESTED_VENDOR_PRODUCT_CODE") %>' ID="txt_sup_itm" runat="server"></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Document Type" ControlStyle-Width="150px" ItemStyle-Width="150px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" ID="txt_Doctype" runat="server" Enabled="false"> </asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Document" ControlStyle-Width="100px" ItemStyle-Width="100px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" ID="Doc" Enabled="false" runat="server"> </asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Line" ControlStyle-Width="100px" ItemStyle-Width="100px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" ID="txt_Line" runat="server" Enabled="false"></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>



                                            <asp:TemplateField HeaderText="Global" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chk_globl" runat="server" CssClass="checkbox" />
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Owning ORg" ControlStyle-Width="150px" ItemStyle-Width="150px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" Enabled="false" ID="txt_Owningorg1" runat="server"></asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>




                                            <asp:TemplateField HeaderText="Contract Num" ControlStyle-Width="200px" ItemStyle-Width="200px">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        <asp:TextBox CssClass="form-control" ID="txt_ContractNum" runat="server">
                                                        </asp:TextBox>
                                                        <span class="input-group-btn">
                                                            <button id="btn_lov_ContractNum" type="button" runat="server"
                                                                class="btn btn-white">
                                                                <i class="fa fa-search"></i>
                                                            </button>
                                                        </span>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Rev" ControlStyle-Width="100px" ItemStyle-Width="100px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" ID="txt_Rev"
                                                        runat="server" Text='<%#Bind("OKE_CONTRACT_VERSION_ID") %>'>
                                                    </asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Action" ItemStyle-Width="5%">
                                                <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"
                                                        runat="server" CommandName="gadd"><i class="fa fa-plus"
                                                            style="font-size:20px !important;"></i>
                                                    </asp:LinkButton>
                                                    <asp:LinkButton ID="linkdlt" 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 id="Detail" class="tab-pane fade">
                                <br />
                                <div style="width: 102%; height: 250px; overflow: scroll">
                                    <asp:GridView ID="Grd_Dtl" runat="server" AutoGenerateColumns="False"
                                        CssClass="table table-striped table-bordered table-hover" CellPadding="0" OnRowCommand="Grd_Dtl_RowCommand">
                                        <Columns>

                                            <asp:TemplateField HeaderText="Number" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hid_dtl_req" runat="server" Value='<%#Bind("REQUISITION_LINE_ID")%>' />
                                                    <asp:TextBox CssClass="form-control" ID="txt_dtl_Number"
                                                        runat="server" Enabled="false" Text='<%#Bind("line_num") %>'>
                                                    </asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Urgent" ControlStyle-Width="50px" ItemStyle-Width="50px">
                                                <ItemTemplate>
                                                    <asp:CheckBox ID="chk_urg" runat="server" CssClass="checkbox" />
                                                </ItemTemplate>
                                            </asp:TemplateField>



                                            <asp:TemplateField HeaderText="Justification" ControlStyle-Width="200px" ItemStyle-Width="200px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" ID="txt_justif"
                                                        runat="server" Text='<%#Bind("JUSTIFICATION") %>'>
                                                    </asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>





                                            <asp:TemplateField HeaderText="Note To Receiver" ControlStyle-Width="200px" ItemStyle-Width="200px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" ID="txt_NotetoRcvr"
                                                        runat="server" Text='<%#Bind("NOTE_TO_RECEIVER") %>'>
                                                    </asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Transaction Nature" ControlStyle-Width="200px" ItemStyle-Width="200px">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        <asp:HiddenField ID="hid_trans" runat="server" Value='<%#Bind("TRANSACTION_REASON_CODE") %>' />
                                                        <asp:TextBox CssClass="form-control" ID="txt_Transnature" Text='<%#Bind("TRANSACTION_REASON_DESC") %>'
                                                            runat="server">
                                                        </asp:TextBox>

                                                        <span class="input-group-btn">
                                                            <button id="btn_lov_Transnature" type="button" runat="server" onserverclick="btn_lov_Transnature_ServerClick"
                                                                class="btn btn-white">
                                                                <i
                                                                    class="fa fa-search"></i>
                                                            </button>
                                                        </span>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Reference Number" ControlStyle-Width="150px" ItemStyle-Width="150px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" ID="txt_refnumber"
                                                        runat="server" Text='<%#Bind("REFERENCE_NUM") %>'>
                                                    </asp:TextBox>


                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="UN Number" ControlStyle-Width="100px" ItemStyle-Width="100px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" ID="txt_Unnumber"
                                                        runat="server">
                                                    </asp:TextBox>


                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Hazard" ControlStyle-Width="200px" ItemStyle-Width="200px">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hid_hzrd_cls" runat="server" Value='<%#Bind("HAZARD_CLASS_ID") %>' />
                                                    <div class="input-group">
                                                        <asp:TextBox CssClass="form-control" ID="txt_Hazard" Text='<%#Bind("HAZARD_CLASS_DESC") %>'
                                                            runat="server">
                                                        </asp:TextBox>

                                                        <span class="input-group-btn">
                                                            <button id="btn_lov_hzrd" type="button" runat="server" onserverclick="btn_lov_hzrd_ServerClick"
                                                                class="btn btn-white">
                                                                <i
                                                                    class="fa fa-search"></i>
                                                            </button>
                                                        </span>
                                                    </div>






                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Action" ItemStyle-Width="5%">
                                                <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"
                                                        runat="server" CommandName="gadd"><i class="fa fa-plus"
                                                            style="font-size:20px !important;"></i>
                                                    </asp:LinkButton>
                                                    <asp:LinkButton ID="linkdlt" 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>
                                <br />

                            </div>


                            <div id="Currency" class="tab-pane fade">
                                <br />
                                <div style="width: 102%; height: 250px; overflow: scroll">
                                    <asp:GridView ID="Grd_Curr" runat="server" AutoGenerateColumns="False"
                                        CssClass="table table-striped table-bordered table-hover" CellPadding="0" OnRowDataBound="Grd_Curr_RowDataBound" OnRowCommand="Grd_Curr_RowCommand">
                                        <Columns>

                                            <asp:TemplateField HeaderText="Number" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hid_curr_req" runat="server" Value='<%#Bind("REQUISITION_LINE_ID")%>' />
                                                    <asp:TextBox CssClass="form-control" Enabled="false" ID="txt_curr_Number"
                                                        runat="server" Text='<%#Bind("line_num") %>'>
                                                    </asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Currency" ControlStyle-Width="150px" ItemStyle-Width="150px">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hid_curr" runat="server" Value='<%#Bind("CURRENCY_CODE") %>' />
                                                    <asp:DropDownList ID="ddl_curr" runat="server" CssClass="form-control select2"></asp:DropDownList>
                                                </ItemTemplate>
                                            </asp:TemplateField>



                                            <asp:TemplateField HeaderText="Rate Type" ControlStyle-Width="200px" ItemStyle-Width="200px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" ID="txt_rt_typ"
                                                        runat="server" Text='<%#Bind("RATE_TYPE") %>'>
                                                    </asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>





                                            <asp:TemplateField HeaderText="Rate Date" ControlStyle-Width="150px" ItemStyle-Width="150px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control datetime" ID="txt_rt_dt"
                                                        runat="server" Text='<%#Bind("RATE_DATE") %>'>
                                                    </asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Rate" ControlStyle-Width="100px" ItemStyle-Width="100px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" ID="txt_rate"
                                                        Text='<%#Bind("RATE") %>' runat="server">
                                                    </asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Price" ControlStyle-Width="100px" ItemStyle-Width="100px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" ID="txt_prc"
                                                        runat="server">
                                                    </asp:TextBox>


                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Amount" ControlStyle-Width="100px" ItemStyle-Width="100px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" ID="txt_amt"
                                                        runat="server">
                                                    </asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>


                                            <asp:TemplateField HeaderText="Price" ControlStyle-Width="100px" ItemStyle-Width="100px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" ID="txt_curr_prc"
                                                        Text='<%#Bind("CURRENCY_UNIT_PRICE") %>' runat="server">
                                                    </asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Amount" ControlStyle-Width="100px" ItemStyle-Width="100px">
                                                <ItemTemplate>
                                                    <asp:TextBox CssClass="form-control" ID="txt_curr_amt"
                                                        runat="server">
                                                    </asp:TextBox>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Action" ItemStyle-Width="5%">
                                                <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"
                                                        runat="server" CommandName="gadd"><i class="fa fa-plus"
                                                            style="font-size:20px !important;"></i>
                                                    </asp:LinkButton>
                                                    <asp:LinkButton ID="linkdlt" 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>
                                <br />

                            </div>




                            <div class="row">
                                <asp:Label CssClass="control-label col-md-offset-2" ID="lbl_due" runat="server">
                                </asp:Label>
                            </div>


                        </div>

                        <div class="row" style="padding-top: 10px">
                            <label class="col-md-2 control-label">Destination Type</label>
                            <div class="col-md-3">
                                <asp:DropDownList ID="ddl_DestinationType" runat="server" CssClass="form-control select2"></asp:DropDownList>
                            </div>

                            <label class="col-md-2 control-label">Source</label>
                            <div class="col-md-3">
                                <asp:TextBox ID="txt_Source" runat="server" CssClass="form-control">
                                </asp:TextBox>
                            </div>
                        </div>
                        <div class="row" style="padding-top: 10px">

                            <label class="col-md-2 control-label">Requester</label>
                            <div class="col-md-3">
                                <asp:DropDownList ID="ddl_reqstr" runat="server" CssClass="form-control select2"></asp:DropDownList>
                            </div>

                            <label class="col-md-2 control-label">Supplier</label>
                            <div class="col-md-3">

                                <asp:DropDownList ID="ddl_supp" runat="server" CssClass="form-control select2"></asp:DropDownList>

                            </div>
                        </div>
                        <div class="row" style="padding-top: 10px">
                            <label class="col-md-2 control-label">Organization</label>
                            <div class="col-md-3">
                                <asp:DropDownList ID="ddl_org" runat="server" CssClass="form-control select2"></asp:DropDownList>
                            </div>

                            <label class="col-md-2 control-label">Site</label>
                            <div class="col-md-3">

                                <asp:TextBox ID="txt_Sites" runat="server" CssClass="form-control">
                                </asp:TextBox>
                            </div>
                        </div>
                        <div class="row" style="padding-top: 10px">
                            <asp:HiddenField ID="HiddenField4" runat="server" />
                            <label class="col-md-2 control-label">Locations</label>
                            <div class="col-md-3">
                                <asp:DropDownList ID="ddl_loc" runat="server" CssClass="form-control select2"></asp:DropDownList>
                            </div>

                            <label class="col-md-2 control-label">Contact</label>
                            <div class="col-md-3">

                                <asp:TextBox ID="txt_Contact" runat="server" CssClass="form-control">
                                </asp:TextBox>
                            </div>
                        </div>
                        <div class="row" style="padding-top: 10px">
                            <asp:HiddenField ID="HiddenField5" runat="server" />
                            <label class="col-md-2 control-label">Sub Inventory</label>
                            <div class="col-md-3">
                                <asp:TextBox ID="txt_Subinventory" runat="server" CssClass="form-control"></asp:TextBox>
                            </div>

                            <label class="col-md-2 control-label">Phone</label>
                            <div class="col-md-3">

                                <asp:TextBox ID="txt_Phone" runat="server" CssClass="form-control">
                                </asp:TextBox>
                            </div>
                        </div>

                        <br />
                        <br />

                        
                    </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 src="/ThemeScrips/select2.min.js"></script>--%>


    <script src="Scripts/jquery-2.1.3.min.js"></script>
    <script src="Scripts/bootstrap.js"></script>

    <script>
        $('.select2').select2();
        $('.select2').select2({ dropdownAutoWidth: true });





        $(document).ready(function () {

            var tabId = document.getElementById('<%= hidTAB.ClientID%>').value;
            if (tabId == "3") {
                $('#myTabs a[href="#Detail_click"]').tab('show');
                //alert(tabId);
                //$('.nav-tabs a[href="#Location"]').tab('show');
            }


            //$('.nav-tabs a[href="#' + tabId + '"]').tab('show');
            //$('#myTabs a[href="' + tab + '"]').tab('show');

            //$("btn_lov_ReqPlan").click(function ()){
            //    $('#myTabs a[href="#Action"]').tab('show');
            //    alert('Yes Action');
            //});

        });


        $("#Detail_click").click(function () {
            document.getElementById('<%= hidTAB.ClientID%>').value = "3";
             //var z = document.getElementById('<%= hidTAB.ClientID%>').value;
            //alert(z);
        });
        // Open & Close Modal Popup \\

        //function openModal() {
        //    $('[id*=myModal2]').modal('show');
        //}  

        //function closeModal() {
        //    $('[id*=myModal2]').modal('hide');
        //} 

        // Open & Close Modal Popup \\

        //$("#lnkpopup").click(function () {
        //    // show Modal
        //    //$('[id*=myModal2]').modal('show');
        //});

    </script>

</asp:Content>
