<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="PurchaseOrder.aspx.cs" Inherits="HRMS.Purcahsing.PurchaseOrder" %>
<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">
                    Purcahse Order
                        <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_po_header_id" runat="server" />
                                <asp:HiddenField ID="hid_Supplier" runat="server" />
                                <asp:HiddenField ID="OrgID" runat="server" />
                                 <asp:HiddenField ID="hid_ShipLocation" runat="server" />
                                <asp:HiddenField ID="hid_Agent" runat="server" />
                                <asp:HiddenField ID="hid_Site" runat="server" />
                                <asp:HiddenField ID="hid_billto" runat="server" />
                                <asp:HiddenField ID="hid_Contact" 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_OperatingUnit" controltovalidate="txt_OperatingUnit" errormessage="OperatingUnit 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">Created Date</label>
                                <div class="col-md-3">
                                    
                                    <asp:TextBox ID="txt_createdate" runat="server" CssClass="form-control datetime"></asp:TextBox>
                                              
                                    
                                    </div>
                               </div>

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


                                <label class="col-md-2 control-label">PO Rec No</label>
                                <div class="col-md-3">
                                    
                                    <asp:TextBox ID="txt_Porecno" runat="server" CssClass="form-control"></asp:TextBox>
                                           </div>
                                   <label class="control-label col-md-2">Type</label>
                                 <div class="col-md-3">
                                   
                                 <asp:DropDownList  CssClass="form-control" ID="ddl_Type" runat="server"></asp:DropDownList> 
                                     
                                   
                               </div>
                                 
                            </div>

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

                               <label class="control-label col-md-2">Supplier</label>
                                <div class="col-md-3">
                                    <div class="input-group">
                                 <asp:TextBox  CssClass="form-control" ID="txt_Suppier" runat="server" ></asp:TextBox>
                                   <span class="input-group-btn">
                                    <button id="btn_lov_Suppier" type="button" runat="server" class="btn btn-white" onserverclick="btn_lov_Suppier_Click"><i class="fa fa-search"></i></button>
                                    </span>
                           
                                   </div>
                                     </div>
                                <label class="control-label col-md-2">Site</label>
                                <div class="col-md-3">
                                    <div class="input-group">
                                 <asp:TextBox  CssClass="form-control" ID="txt_Site" runat="server" ></asp:TextBox>
                                               <span class="input-group-btn">
                                    <button id="btn_lov_Site" type="button" runat="server" class="btn btn-white" onserverclick="btn_lov_Site_Click"><i class="fa fa-search"></i></button>
                                    </span>
                           
                                   </div>
                                     </div>
                               

                                
                            </div>

                            <div class="row" style="padding-top:10px">
                               
                                  <label class="col-md-2 control-label">Contact</label>
                                <div class="col-md-3">
                                     <div class="input-group">
                                     <asp:TextBox ID="txt_Contact" runat="server" CssClass="form-control"></asp:TextBox>
                                      <span class="input-group-btn">
                                    <button id="btn_lov_Contact" type="button" runat="server" class="btn btn-white" onserverclick="btn_lov_Contact_Click"><i class="fa fa-search"></i></button>
                                    </span>
                                    </div>    
                                    </div>   
                                <label class="control-label col-md-2">Ship To</label>
                                <div class="col-md-3">
                                <div class="input-group">
                                 <asp:TextBox ID="txt_shipto" runat="server" CssClass="form-control" ></asp:TextBox>
                                       <span class="input-group-btn">
                                    <button id="btn_lov_shipto" type="button" runat="server" class="btn btn-white" onserverclick="btn_lov_shipto_Click"><i class="fa fa-search"></i></button>
                                    </span>
                                     </div>    
                                    </div>
                                 
                                  </div>
                                                    
                            <div class="row" style="padding-top:10px">      
                                  <label class="col-md-2 control-label">Bill To</label>
                                 <div class="col-md-3">
                                <div class="input-group">
                                 <asp:TextBox ID="txt_billto" runat="server" CssClass="form-control" ></asp:TextBox>
                                       <span class="input-group-btn">
                                    <button id="btn_lov_billto" type="button" runat="server" class="btn btn-white" onserverclick="btn_lov_billto_Click"><i class="fa fa-search"></i></button>
                                    </span>
                                     </div>    
                                    </div>
                                 <label class="col-md-2 control-label">Currency</label>
                                <div class="col-md-3">
                                    
                                    <asp:DropDownList  CssClass="form-control" ID="ddl_Currency" runat="server"></asp:DropDownList> 
                                 <%--<asp:RequiredFieldValidator SetFocusOnError="true" ValidationGroup="save" runat="server" id="RequiredFieldValidator2" controltovalidate="txt_Country" errormessage="Country is Required!" />--%>
                                   
                                </div>
                               </div>   
                          
                            <div class="row" style="padding-top:10px">                             
                              
                                <label class="control-label col-md-2">Buyer</label>
                                <div class="col-md-3">
                                <div class="input-group">
                                 <asp:TextBox ID="txt_Buyer" runat="server" CssClass="form-control" ></asp:TextBox>
                                       <span class="input-group-btn">
                                    <button id="btn_lov_Buyer" type="button" runat="server" class="btn btn-white" onserverclick="btn_lov_Buyer_Click"><i class="fa fa-search"></i></button>
                                    </span>
                                     </div>    
                                    </div>
                                 

                                 <label class="col-md-2 control-label">Status</label>
                                 <div class="col-md-3">
                                
                                  <asp:DropDownList  CssClass="form-control" ID="ddl_Status" runat="server"></asp:DropDownList> 
                                    
                                    </div>
                                
                                
                               </div>
                            <div class="row" style="padding-top:10px">   
                             <label class="control-label col-md-2">P-CArd</label>
                                 <div class="col-md-3">
                                   
                                 <asp:TextBox ID="txt_PCard" runat="server" CssClass="form-control"></asp:TextBox>
                                     
                               </div>
                            
                              
                                 <label class="col-md-2 control-label">Total</label>
                                <div class="col-md-3">
                                    
                                    <asp:TextBox ID="txt_Total" 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" TextMode="MultiLine" ></asp:TextBox>    </div>
                             </div>
                            <hr />
                            <div class="row">
                                <asp:Label CssClass="control-label col-md-offset-2" ID="lbl_due" runat="server"></asp:Label>
                            </div>
                    </div>
                      <updatepanel>
                            <asp:HiddenField runat="server" ID="hidTAB" Value="0" />
                         
                            <ul class="nav nav-tabs">
                                <li class="active"><a data-toggle="tab" id="Line_click" href="#Line" aria-expanded="true">Line</a></li>
                               <li class="inactive"><a data-toggle="tab" id="PriceRef_click" href="#Priceref" aria-expanded="false">Price Refernce</a></li>
                                <li class="inactive"><a data-toggle="tab"id="RefDoc_click" href="#RefDoc" aria-expanded="false">Reference Document</a></li>
                                <li class="inactive"><a data-toggle="tab" id="More_click" href="#More" aria-expanded="false">More</a></li>
                                <li class="inactive"><a data-toggle="tab" id="TempLabor_click" href="#TempLabor" aria-expanded="false">Temporary Labor</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;">--%>
                                 <div class="row" style="padding-top:10px">
                                      <div class="modal-body" style="overflow-y: scroll;">
                                    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
                                       CssClass="table table-striped table-bordered table-hover" CellPadding="0" Width="5000px"
                                        OnRowCommand="GridView1_RowCommand">
                                        <Columns>
                                            <asp:TemplateField HeaderStyle-Width="10px">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hid_line_id" runat="server"  Value='<%#Bind("po_line_id")%>'  />
                                                    <asp:HiddenField ID="hid_Item" runat="server"
                                                        Value='<%#Bind("item_id")%>' />
                                                    <asp:HiddenField ID="hid_UOM" runat="server"
                                                        Value='<%#Bind("unit_meas_lookup_code")%>' />
                                                    <asp:HiddenField ID="hid_Cat" runat="server"
                                                        Value='<%#Bind("category_id")%>' />
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Numeber" HeaderStyle-Width="5%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_Number"
                                                            runat="server" Text='<%#Bind("po_line_id") %>'>
                                                        </asp:TextBox>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Type" HeaderStyle-Width="20%">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_type" runat="server"
                                                        Text='<%#Bind("line_type_id") %>' CssClass="form-control"
                                                        ></asp:TextBox>
                                                                                                         
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                             <asp:TemplateField HeaderText="Item" HeaderStyle-Width="20%">
                                                <ItemTemplate>
                                                    <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_Click"><i
                                                                    class="fa fa-search"></i></button>
                                                        </span>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Rev" HeaderStyle-Width="15%">
                                                <ItemTemplate>
                                                    <div class="input-group">            
                                                    <asp:TextBox ID="txt_rev" runat="server"
                                                        Text='<%#Bind("item_revision") %>'
                                                        CssClass="form-control"></asp:TextBox>
                                                   </div>

                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Job" HeaderStyle-Width="15%">
                                                <ItemTemplate>
                                                    <div class="input-group">            
                                                    <asp:TextBox ID="txt_Job" runat="server"
                                                        Text='<%#Bind("job_id") %>'
                                                        CssClass="form-control"></asp:TextBox>
                                                  </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Category"  HeaderStyle-Width="30%">
                                                <ItemTemplate>
                                                    <div class="input-group">                                                        
                                                        <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"
                                                                onserverclick="btn_lov_Category_Click"><i
                                                                    class="fa fa-search"></i></button>
                                                        </span>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                                     
                                            <asp:TemplateField HeaderText="Description" HeaderStyle-Width="50%">
                                                <ItemTemplate>
                                                    <div class="input-group">            
                                                    <asp:TextBox ID="txt_Desc" runat="server"
                                                        Text='<%#Bind("item_description") %>' CssClass="form-control"
                                                        ></asp:TextBox>
                                                                 </div>                                        
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                             <asp:TemplateField HeaderText="UOM">
                                                <ItemTemplate>
                                                    <div class="input-group">                                                        
                                                        <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_Click"><i
                                                                    class="fa fa-search"></i></button>
                                                        </span>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Quantity" HeaderStyle-Width="25%">
                                                <ItemTemplate>
                                                    <div class="input-group">            
                                                    <asp:TextBox ID="txt_qty" runat="server"
                                                        Text='<%#Bind("quantity") %>' CssClass="form-control"
                                                        ></asp:TextBox>
                                                                  </div>                                       
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                             <asp:TemplateField HeaderText="Price" HeaderStyle-Width="25%">
                                                <ItemTemplate>
                                                    <div class="input-group">            
                                                    <asp:TextBox ID="txt_Price" runat="server"
                                                        Text='<%#Bind("unit_price") %>' CssClass="form-control"
                                                        ></asp:TextBox>
                                                            </div>                                             
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                              
                                             <asp:TemplateField HeaderText="Promised" HeaderStyle-Width="25%">
                                                <ItemTemplate>
                                                    <div class="input-group">            
                                                    <asp:TextBox ID="txt_Promised" runat="server"
                                                        Text='<%#Bind("start_date") %>' CssClass="form-control datetime" 
                                                        ></asp:TextBox>
                                                              </div>                                           
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                              <asp:TemplateField HeaderText="Need-By" HeaderStyle-Width="25%">
                                                <ItemTemplate>
                                                    <div class="input-group">            
                                                    <asp:TextBox ID="txt_Needby" runat="server"
                                                        Text='<%#Bind("closed_flag") %>' CssClass="form-control datetime" 
                                                        ></asp:TextBox>
                                                            </div>                                             
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                              <asp:TemplateField HeaderText="Supplier Item" HeaderStyle-Width="25%">
                                                <ItemTemplate>
                                                    <div class="input-group">            

                                                    <asp:TextBox ID="txt_Supplieritem" runat="server"
                                                        Text='<%#Bind("VENDOR_PRODUCT_NUM") %>' CssClass="form-control"
                                                        ></asp:TextBox>
                                                                </div>                                         
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                              <asp:TemplateField HeaderText="Amount" HeaderStyle-Width="25%">
                                                <ItemTemplate>
                                                    <div class="input-group">            
                                                    <asp:TextBox ID="txt_Amount" runat="server"
                                                        Text='<%#Bind("amount") %>' CssClass="form-control"
                                                        ></asp:TextBox>
                                                               </div>                                          
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                             <asp:TemplateField HeaderText="Charge Account" HeaderStyle-Width="25%">
                                                <ItemTemplate>
                                                    <div class="input-group">            
                                                    <asp:TextBox ID="txt_chargAccount" runat="server"
                                                        Text='<%#Bind("committed_amount") %>' CssClass="form-control"
                                                        ></asp:TextBox>
                                                                </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>
                             <a id="Fac" href="Shipment.aspx?Plan_Header=<%# HRMS.Global.Encrypt(hid_ReqplanId.Value.ToString())+"&Request_ID="+HRMS.Global.Encrypt(Eval("REQUEST_HEADER_ID").ToString()) + "&Req_Name="+HRMS.Global.Encrypt(Eval("RequestName").ToString()) +"&bg_id="+ HRMS.Global.Encrypt(ddl_Busunit.SelectedValue.ToString())+"&pos_id="+HRMS.Global.Encrypt(Eval("POSITION_ID").ToString())+"&pos_name="+ HRMS.Global.Encrypt(Eval("Position").ToString())+"&City_id="+HRMS.Global.Encrypt(Eval("CITY_ID").ToString())+"&City_name="+ HRMS.Global.Encrypt(Eval("City").ToString())%>">Factor</a>

                                                </ItemTemplate>
                                                <ItemStyle Width="6%"></ItemStyle>
                                            </asp:TemplateField>
                                        </Columns>
                                        <FooterStyle CssClass="footerStyle" />
                                        <HeaderStyle CssClass="headerStyle" />
                                        <RowStyle CssClass="rowStyle" />
                                    </asp:GridView>
                                    </div>
                                     </div>
                                    <br />
                                </div>
                            
                            <div id="Priceref" class="tab-pane fade">
                                    <br />
                                 <div class="modal-body" style="overflow-y: scroll;">
                                    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False"
                                      CssClass="table table-striped table-bordered table-hover" CellPadding="0" Width="1500px"
                                        OnRowCommand="GridView2_RowCommand">
                                        <Columns>
                                            <asp:TemplateField HeaderStyle-Width="10px">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hid_priceref_id" runat="server" Value='<%#Bind("po_line_id")%>' />
                                                     <asp:HiddenField ID="hid_Pricetpe" runat="server" Value='<%#Bind("price_type_lookup_code")%>' />
                                                    
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                              <asp:TemplateField HeaderText="Numeber" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_Number1" runat="server" Text='<%#Bind("line_num") %>'>
                                                        </asp:TextBox>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="List Price" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_listprice"
                                                            runat="server" Text='<%#Bind("list_price_per_unit") %>'>
                                                        </asp:TextBox>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                             <asp:TemplateField HeaderText="Market Price" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_Market"
                                                            runat="server" Text='<%#Bind("Market_Price") %>'>
                                                        </asp:TextBox>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Pricetpe">
                                                <ItemTemplate>
                                                    <div class="input-group">                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_Pricetype"
                                                            runat="server" Text='<%#Bind("priceCode") %>'>
                                                        </asp:TextBox>
                                                       
                                                        <span class="input-group-btn">
                                                            <button id="btn_lov_Pricetype" type="button" runat="server"
                                                                class="btn btn-white"
                                                                onserverclick="btn_lov_Pricetype_Click"><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="RefDoc" class="tab-pane fade">
                                    <br />
                                                                  <div class="modal-body" style="overflow-y: scroll;">
                                    <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False"
                                      CssClass="table table-striped table-bordered table-hover" CellPadding="0" Width="2000px"
                                        OnRowCommand="GridView3_RowCommand">
                                        <Columns>
                                            <asp:TemplateField HeaderStyle-Width="10px">
                                                <ItemTemplate>
                                                    <asp:HiddenField ID="hid_priceDoc_id" runat="server" Value='<%#Bind("po_line_id")%>' />
                                                    <asp:HiddenField ID="hid_ContractID" runat="server" Value='<%#Bind("Contract_Num")%>' />
                                                     <asp:HiddenField ID="hid_ConID" runat="server" Value='<%#Bind("oke_contract_header_id")%>' />
                                                    
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                              <asp:TemplateField HeaderText="Numeber" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_Number2"
                                                            runat="server" Text='<%#Bind("line_num") %>'>
                                                        </asp:TextBox>
                                                    </div>
                                                </ItemTemplate>
                                          </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Contract">
                                                <ItemTemplate>
                                                    <div class="input-group">                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_Contract"
                                                            runat="server" Text='<%#Bind("ContractName") %>'>
                                                        </asp:TextBox>
                                                       
                                                        <span class="input-group-btn">
                                                            <button id="btn_lov_Contract" type="button" runat="server"
                                                                class="btn btn-white"
                                                                onserverclick="btn_lov_Contract_Click"><i
                                                                    class="fa fa-search"></i></button>
                                                        </span>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                             <asp:TemplateField HeaderText="Owning ORg" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                       <%-- <asp:TextBox CssClass="form-control" ID="txt_Owningorg"
                                                            runat="server"</asp:TextBox> <%--Text='<%#Bind("ownorg") %>'>--%>--%>
                                                        
                                                    </div>
                                                </ItemTemplate>
                                          </asp:TemplateField>
                                             <asp:TemplateField HeaderText="Document Type" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                     <%--   <asp:TextBox CssClass="form-control" ID="txt_Doctype"
                                                            runat="server" </asp:TextBox> <%--Text='<%#Bind("Doctype") %>'>--%>--%>
                                                       
                                                    </div>
                                                </ItemTemplate>
                                          </asp:TemplateField>
                                             <asp:TemplateField HeaderText="Document" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                       <%-- <asp:TextBox CssClass="form-control" ID="Doc"
                                                            runat="server" </asp:TextBox> <%--Text='<%#Bind("Doc") %>'>--%>--%>
                                                       
                                                    </div>
                                                </ItemTemplate>
                                          </asp:TemplateField>
                                             <asp:TemplateField HeaderText="Line" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                        <%--<asp:TextBox CssClass="form-control" ID="txt_Line"
                                                            runat="server"</asp:TextBox><%-- Text='<%#Bind("Line") %>'>--%>--%>
                                                        
                                                    </div>
                                                </ItemTemplate>
                                          </asp:TemplateField>

                                            <asp:TemplateField HeaderText="Contract Num">
                                                <ItemTemplate>
                                                    <div class="input-group">                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_ContractNum"
                                                            runat="server" Text='<%#Bind("ContractNames") %>'>
                                                        </asp:TextBox>
                                                       
                                                        <span class="input-group-btn">
                                                            <button id="btn_lov_ContractNum" type="button" runat="server"
                                                                class="btn btn-white"
                                                                onserverclick="btn_lov_ContractNum_Click"><i
                                                                    class="fa fa-search"></i></button>
                                                        </span>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            
                                             <asp:TemplateField HeaderText="Rev" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_Rev"
                                                            runat="server" Text='<%#Bind("Oke_Contract_Version_Id") %>'>
                                                        </asp:TextBox>
                                                    </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="More" class="tab-pane fade ">
                                    <br />
                                                                 <div class="modal-body" style="overflow-y: scroll;">
                                    <asp:GridView ID="GridView4" runat="server" AutoGenerateColumns="False"
                                        CssClass="table table-striped table-bordered table-hover" CellPadding="0" Width="2000px"
                                        OnRowCommand="GridView4_RowCommand" >
                                        <Columns>
                                            <asp:TemplateField HeaderStyle-Width="10px">
                                                <ItemTemplate>
                                                  
                                                    <asp:HiddenField ID="Hid_Notetosipp_ID" runat="server"
                                                        Value='<%#Bind("Note_To_Vendor")%>' />
                                                    <asp:HiddenField ID="hid_po_line_id" runat="server"
                                                        Value='<%#Bind("po_line_id")%>' />
                                                    <asp:HiddenField ID="hid_UNnumber_Id" runat="server"
                                                        Value='<%#Bind("un_number_id")%>' />
                                                    
                                                    <asp:HiddenField ID="hid_Hazard" runat="server"
                                                        Value='<%#Bind("HAZARD_CLASS_ID")%>' />
                                                    <asp:HiddenField ID="hid_Transnature" runat="server"
                                                        Value='<%#Bind("Transaction_Reason_Code")%>' />
                                                   
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Number" HeaderStyle-Width="10%">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                        
                                                        <asp:TextBox CssClass="form-control" ID="txt_NumberMore"
                                                            runat="server" Text='<%#Bind("line_num") %>'>
                                                        </asp:TextBox>
                                                    </div>
                                                </ItemTemplate>
                                          </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Note To Supplier">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                      
                                                        <asp:TextBox CssClass="form-control" ID="txt_Notetosupplier"
                                                            runat="server" Text='<%#Bind("NoteName") %>'>
                                                        </asp:TextBox>
                                                        
                                                        <span class="input-group-btn">
                                                            <button id="btn_lov_Notetosupplier" type="button" runat="server"
                                                                class="btn btn-white"
                                                                onserverclick="btn_lov_Notetosupplier_Click"><i
                                                                    class="fa fa-search"></i></button>
                                                        </span>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                             <asp:TemplateField HeaderText="UN Number">
                                                <ItemTemplate>
                                                 
                                                      
                                                        <asp:TextBox CssClass="form-control" ID="txt_Unnumber"
                                                            runat="server" Text='<%#Bind("un_number_id") %>'>
                                                        </asp:TextBox>
                                                        
                                                    
                                                </ItemTemplate>
                                            </asp:TemplateField>

                                            <asp:TemplateField HeaderText="UN Description" HeaderStyle-Width="140px">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_UNDesc" runat="server"
                                                        Text='<%#Bind("clm_idc_type") %>' CssClass="form-control"
                                                        ></asp:TextBox>
                                                    
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                              <asp:TemplateField HeaderText="Hazard">
                                                <ItemTemplate>
                                                   
                                                      
                                                        <asp:TextBox CssClass="form-control" ID="txt_Hazard"
                                                            runat="server" Text='<%#Bind("HAZARD_CLASS_ID") %>'>
                                                        </asp:TextBox>
                                                        
                                                    
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                            <asp:TemplateField HeaderText="Transaction Nature">
                                                <ItemTemplate>
                                                    <div class="input-group">
                                                      
                                                        <asp:TextBox CssClass="form-control" ID="txt_Transnature"
                                                            runat="server" Text='<%#Bind("TransName") %>'>
                                                        </asp:TextBox>
                                                        
                                                        <span class="input-group-btn">
                                                            <button id="btn_lov_Transnature" type="button" runat="server"
                                                                class="btn btn-white"
                                                                onserverclick="btn_lov_Transnature_Click"><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="TempLabor" class="tab-pane fade">
                                    <br />    
                                 <div class="modal-body" style="overflow-y: scroll;">
                                    <asp:GridView ID="GridView5" runat="server" AutoGenerateColumns="False" 
                                      CssClass="table table-striped table-bordered table-hover" CellPadding="0" Width="2000px" OnRowCommand="GridView5_RowCommand">
                                <Columns>
                                <asp:TemplateField HeaderStyle-Width="10px">
                                    <ItemTemplate>             
                                        <asp:HiddenField ID="hidlab_po_line_id" runat="server"
                                                        Value='<%#Bind("po_line_id")%>' />
                                    </ItemTemplate>
                                </asp:TemplateField>    
                                     <asp:TemplateField HeaderText="Number" HeaderStyle-Width="140px">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_tempnumber" runat="server"
                                                        Text='<%#Bind("line_num") %>' CssClass="form-control"
                                                        ></asp:TextBox>
                                                    
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                     <asp:TemplateField HeaderText="First Name" HeaderStyle-Width="140px">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_FirstName" runat="server"
                                                        Text='<%#Bind("contractor_first_name") %>' CssClass="form-control"
                                                        ></asp:TextBox>
                                                    
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                     <asp:TemplateField HeaderText="Last Name" HeaderStyle-Width="140px">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_LastName" runat="server"
                                                        Text='<%#Bind("contractor_last_name") %>' CssClass="form-control"
                                                        ></asp:TextBox>
                                                    
                                                </ItemTemplate>
                                            </asp:TemplateField>
                                     <asp:TemplateField HeaderText="Start Date" HeaderStyle-Width="140px">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_StartDate" runat="server"
                                                        Text='<%#Bind("start_date") %>' CssClass="form-control datetime"
                                                        ></asp:TextBox>
                                                    
                                                </ItemTemplate>
                                            </asp:TemplateField>
                               <asp:TemplateField HeaderText="End Date" HeaderStyle-Width="140px">
                                                <ItemTemplate>
                                                    <asp:TextBox ID="txt_EndDate" runat="server"
                                                        Text='<%#Bind("start_date") %>' CssClass="form-control datetime"
                                                        ></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>

                                    <hr />
                              </div>

                        </div>
                               </updatepanel>
                   <div class="pull-left">
                            <asp:button text="Catalog" CssClass="btn btn-info" ID="btn_Catlog" Width="120px"    ValidationGroup="Catalog"
                                runat="server" onclick="btn_Catlog_Click"/>
                        <asp:button text="Currency" CssClass="btn btn-info" ID="btn_Currency" Width="120px"  ValidationGroup="Currency"
                                runat="server" onclick="btn_Currency_Click"/>
                        <asp:button text="Terms" CssClass="btn btn-info" ID="btn_Terms" Width="120px"  ValidationGroup="Terms"
                                runat="server" onclick="btn_Terms_Click"/>
                        <asp:button text="Shipments" CssClass="btn btn-info" ID="btn_Shipment" Width="120px"  ValidationGroup="Shipments"
                                runat="server" onclick="btn_Shipment_Click"/>
                        <asp:button text="Approve" CssClass="btn btn-info" ID="btn_Approve" Width="120px"   ValidationGroup="Approve"
                                runat="server" onclick="btn_Approve_Click"/>
                            
                        </div>
                </section>
            </div>
            </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 });
        $('.select2').select2({ width: '100%' });

        $(document).ready(function () {

            var tabId = document.getElementById('<%= hidTAB.ClientID%>').value;
            if (tabId == "5") {
                $('#myTabs a[href="#TempLabor"]').tab('show');
                //alert(tabId);
                //$('.nav-tabs a[href="#Location"]').tab('show');
            }
            else if (tabId == "4") {
                $('#myTabs a[href="#More"]').tab('show');
                //alert(tabId);
            }
            else if (tabId == "3") {
                $('#myTabs a[href="#RefDoc"]').tab('show');
                //alert(tabId);
            }
            else if (tabId == "2") {
                $('#myTabs a[href="#Priceref"]').tab('show');
                //alert(tabId);
            }
            else {
                $('#myTabs a[href="#Line"]').tab('show');
                //alert(tabId);
            }

            //$('.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');
            //});

        });

        $("#Line_click").click(function () {
            document.getElementById('<%= hidTAB.ClientID%>').value = "1";
            //var x = document.getElementById('<%= hidTAB.ClientID%>').value;           
            //alert(x);
        });

        $("#PriceRef_click").click(function () {
            document.getElementById('<%= hidTAB.ClientID%>').value = "2";
            //var y = document.getElementById('<%= hidTAB.ClientID%>').value;
            //alert(y);
        });

        $("#RefDoc_click").click(function () {
            document.getElementById('<%= hidTAB.ClientID%>').value = "3";
            //var z = document.getElementById('<%= hidTAB.ClientID%>').value;
            //alert(z);
        });

        $("#More_click").click(function () {
            document.getElementById('<%= hidTAB.ClientID%>').value = "4";
             //var z = document.getElementById('<%= hidTAB.ClientID%>').value;
            //alert(z);
        });

        $("#TempLabor_click").click(function () {
            document.getElementById('<%= hidTAB.ClientID%>').value = "5";
             //var z = document.getElementById('<%= hidTAB.ClientID%>').value;
            //alert(z);
        });

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


        // 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>
