<%@ Page Title="Plan Approve" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="plan_approve_seq.aspx.cs" Inherits="edicenter.plan_approve_seq" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <br /><br /><br /><br />
   <div class="container-fluid">
        <div class="row row-offcanvas row-offcanvas-right">

        <div class="col-xs-12 col-sm-12">
    <div class="row">

         <div class="panel panel-primary">
      <div class="panel-heading">&nbsp&nbsp Plan Approve - Manager MRP รายการแผนการผลิตและสั่งสินค้า(Sequence Number) สำหรับอนุมัติ Forecast&nbsp&nbsp&nbsp&nbsp&nbsp[<%= Session["ULogin"].ToString().Trim() %>]</div>
      <div class="panel-body">
        &nbsp&nbsp
        <asp:Label ID="lblCompany" runat="server" Text="" Font-Bold="true"></asp:Label>
               <br />
        &nbsp&nbsp
        <asp:Label ID="Label20" runat="server" Text="Manager MRP Name:" Font-Bold="true"></asp:Label>
        <asp:Label ID="lblMGName" runat="server" Text=""></asp:Label>&nbsp&nbsp  
        <asp:Label ID="Label22" runat="server" Text="Plant:" Font-Bold="true"></asp:Label>
        <asp:Label ID="lblPlant" runat="server" Text=""></asp:Label>&nbsp&nbsp    
               <br />
        &nbsp&nbsp
        <asp:Label ID="lblVenderID" runat="server" Text="Vender:" Font-Bold="true"></asp:Label>
        <asp:Label ID="lblVender" runat="server" Text=""></asp:Label>&nbsp&nbsp      
        <asp:Label ID="Label23" runat="server" Text="SANo." Font-Bold="true"></asp:Label>
        <asp:Label ID="lblSANo" runat="server" Text=""></asp:Label>&nbsp&nbsp   
        <asp:Label ID="Label13" runat="server" Text="Item:" Font-Bold="true"></asp:Label>
        <asp:Label ID="lblItem" runat="server" Text=""></asp:Label>&nbsp&nbsp  
        <asp:Label ID="lblEvent" runat="server" Text="" Font-Bold="true" ForeColor="blue"></asp:Label>&nbsp&nbsp&nbsp&nbsp&nbsp
        <asp:Label ID="lblDateFrm" runat="server" Text="" Font-Bold="true"></asp:Label>&nbsp
        <asp:Label ID="lblTo" runat="server" Text="To"></asp:Label>&nbsp
        <asp:Label ID="lblDateTo" runat="server" Text="" Font-Bold="true"></asp:Label>
               <br /><br />
        &nbsp&nbsp&nbsp<asp:Label ID="lblResultSearch" runat="server" Text=""></asp:Label>&nbsp
          <br />
        <asp:Button ID="btnDLAll" runat="server" Text="Download Format#B" Width="150px" OnClick="btnDLAll_Click" />&nbsp&nbsp&nbsp
        <asp:Button ID="btnApproveAll" runat="server" Text="Approve All" Font-Bold="true" Width="100px" OnClick="btnApproveAll_Click" />&nbsp
         <br />
&nbsp;<asp:Repeater id="myRepeater" runat="server">
	<HeaderTemplate>
<table class="table table-bordered">
<tr style="background-color:#fa7b16; color:black; font-weight:bold;height:35px;" align="Left">
                <td>No.</td>
                <td>Item</td>
                <td>Seq.</td>
                <td>Locat.</td>
                <td>Plant</td>
                <td>ArtNo.</td>
                <td>MatNo.</td>
                <td>Description</td>
                <td>Time</td>
                <td>Date</td>
                <td>ReSch</td>
                <td>R.Status</td>
                <td>Quantity</td>
                <td>Unit</td>
                <td>Time Firm</td>
                <td>Date Firm</td>
                <td>Qty Firm</td>
                <td>Price</td>
                <td>Total Price(Baht)</td>
                <td>Revise</td>
                <td>Cancel</td>
                <td>Status</td>
                <td>MRP</td>
                <td>MRPName</td>
                </tr>           	
   </HeaderTemplate>             
	<ItemTemplate>    
			 <tr style="background-color:#FFFFFF; color:black; height:35px;" align="left">
             <td><asp:Label id="Label2" runat="server" Text='<%# myRepeater.Items.Count + 1 %>'></asp:Label></td>     
             <td><asp:Label id="lblCustomerID" runat="server" Text='<%# Text_CheckColumn(1,"",Container.DataItem) %>'></asp:Label></td>        
             <td><asp:Label id="Label3" runat="server" Text='<%# Text_CheckColumn(2,"",Container.DataItem)%>'></asp:Label></td>     
             <td><asp:Label id="Label34" runat="server" Text='<%# Text_CheckColumn(19,"",Container.DataItem)%>'></asp:Label></td>        
             <td><asp:Label id="Label6" runat="server" Text='<%# Text_CheckColumn(7,"",Container.DataItem) %>'></asp:Label></td>
             <td><asp:Label id="Label4" runat="server" Text='<%# Text_CheckColumn(12,"",Container.DataItem) %>'></asp:Label></td>    
             <td><asp:Label id="Label17" runat="server" Text='<%# Text_CheckColumn(9,"",Container.DataItem) %>'></asp:Label></td>   
             <td><asp:Label id="Label5" runat="server" width="300px" Text='<%# Text_CheckColumn(4,"",Container.DataItem) %>'></asp:Label></td>  
             <td><asp:Label id="Label24" runat="server" Text='<%# Text_CheckColumn(14,Session["event_f"].ToString(),Container.DataItem) %>'></asp:Label></td> 
             <td><asp:Label id="Label7" runat="server" width="80px" Text='<%# Text_CheckColumn(3,"",Container.DataItem) %>'></asp:Label></td> 
             <td><asp:Label id="Label36" runat="server" width="80px" Text='<%# Text_CheckColumn(20,"",Container.DataItem) %>'></asp:Label></td> 
             <td><asp:Label id="Label37" runat="server" Text='<%# Text_CheckColumn(21,"",Container.DataItem) %>'></asp:Label></td> 
             <td><asp:Label id="Label8" runat="server" Text='<%# Text_Qty(Text_CheckColumn(5,Session["event_f"].ToString(),Container.DataItem)) %>'></asp:Label></td>
             <td><asp:Label id="Label9" runat="server" Text='<%# Text_CheckColumn(6,"",Container.DataItem) %>'></asp:Label></td> 
             <td><asp:Label id="Label28" runat="server" Text='<%# Text_CheckColumn(16,Session["event_f"].ToString(),Container.DataItem) %>'></asp:Label></td>      
             <td><asp:Label id="Label26" runat="server" Text='<%# Text_CheckColumn(15,Session["event_f"].ToString(),Container.DataItem) %>'></asp:Label></td>      
             <td><asp:Label id="Label10" runat="server" Text='<%# Text_Qty(Text_CheckColumn(13,Session["event_f"].ToString(),Container.DataItem)) %>'></asp:Label></td> 
             <td><asp:Label id="Label14" runat="server" Text='<%# Text_Qty(Text_Price(Container.DataItem)) %>'></asp:Label></td>     
             <td><asp:Label id="Label11" runat="server" Text='<%# Text_Qty(Text_TotalPrice(Session["event_f"].ToString(),Container.DataItem)) %>'></asp:Label></td>                    
             <td><input id="btnMo_<%# ID_indexes(Container.DataItem) %>" type="<%# Button_CheckModify(Container.DataItem) %>" value="<%# Text_CheckModify(Container.DataItem) %>" onclick="modify_click(<%# ID_indexes(Container.DataItem) %>)" class="btn-block"/></td>
             <td><input id="btnCL_<%# ID_indexes(Container.DataItem) %>" type="<%# Button_CancelFirm(Session["event_f"].ToString(),Container.DataItem) %>" value="CL" onclick="cancel_click(<%# ID_indexes(Container.DataItem) %>)" <%# Session["ShowBtnUpAll"]=Button_CheckVenderFirm(Container.DataItem) %> <%# bfUpAll += Convert.ToInt16(Text_CheckBtnUpload(Session["ShowBtnUpAll"].ToString())) %> class="btn-block" /></td>             
             <td><asp:Label id="Label15" runat="server" width="150px" Text="<%# Text_CheckVenderFirm(Container.DataItem) %>" ></asp:Label></td>                                                                                   
	         <td><asp:Label id="Label30" runat="server" Text='<%# Text_CheckColumn(17,"",Container.DataItem) %>'></asp:Label></td> 
             <td><asp:Label id="Label31" runat="server" Text='<%# Text_CheckColumn(18,"",Container.DataItem) %>'></asp:Label></td> 
             </tr>
   </ItemTemplate>
       
        <AlternatingItemTemplate>          
			 <tr style="background-color:#20B2AA; color:black; height:35px;" align="left">
             <td><asp:Label id="Label2" runat="server" Text='<%# myRepeater.Items.Count + 1 %>'></asp:Label></td>
             <td><asp:Label id="lblCustomerID" runat="server" Text='<%# Text_CheckColumn(1,"",Container.DataItem) %>'></asp:Label></td>        
             <td><asp:Label id="Label3" runat="server" Text='<%# Text_CheckColumn(2,"",Container.DataItem) %>'></asp:Label></td>      
             <td><asp:Label id="Label35" runat="server" Text='<%# Text_CheckColumn(19,"",Container.DataItem) %>'></asp:Label></td>                     
             <td><asp:Label id="Label6" runat="server" Text='<%# Text_CheckColumn(7,"",Container.DataItem) %>'></asp:Label></td> 
             <td><asp:Label id="Label18" runat="server" Text='<%# Text_CheckColumn(12,"",Container.DataItem) %>'></asp:Label></td>                     
             <td><asp:Label id="Label19" runat="server" Text='<%# Text_CheckColumn(9,"",Container.DataItem) %>'></asp:Label></td>                   
             <td><asp:Label id="Label5" runat="server" width="300px" Text='<%# Text_CheckColumn(4,"",Container.DataItem) %>'></asp:Label></td>  
             <td><asp:Label id="Label25" runat="server" Text='<%# Text_CheckColumn(14,Session["event_f"].ToString(),Container.DataItem) %>'></asp:Label></td>  
             <td><asp:Label id="Label7" runat="server" width="80px" Text='<%# Text_CheckColumn(3,"",Container.DataItem) %>'></asp:Label></td>
             <td><asp:Label id="Label36" runat="server" width="80px" Text='<%# Text_CheckColumn(20,"",Container.DataItem) %>'></asp:Label></td> 
             <td><asp:Label id="Label37" runat="server" Text='<%# Text_CheckColumn(21,"",Container.DataItem) %>'></asp:Label></td> 
             <td><asp:Label id="Label8" runat="server" Text='<%# Text_Qty(Text_CheckColumn(5,Session["event_f"].ToString(),Container.DataItem)) %>'></asp:Label></td>
             <td><asp:Label id="Label9" runat="server" Text='<%# Text_CheckColumn(6,"",Container.DataItem) %>'></asp:Label></td>  
             <td><asp:Label id="Label29" runat="server" Text='<%# Text_CheckColumn(16,Session["event_f"].ToString(),Container.DataItem) %>'></asp:Label></td>  
             <td><asp:Label id="Label27" runat="server" Text='<%# Text_CheckColumn(15,Session["event_f"].ToString(),Container.DataItem) %>'></asp:Label></td>  
             <td><asp:Label id="Label12" runat="server" Text='<%# Text_Qty(Text_CheckColumn(13,Session["event_f"].ToString(),Container.DataItem)) %>'></asp:Label></td>  
             <td><asp:Label id="Label21" runat="server" Text='<%# Text_Qty(Text_Price(Container.DataItem)) %>'></asp:Label></td> 
             <td><asp:Label id="Label11" runat="server" Text='<%# Text_Qty(Text_TotalPrice(Session["event_f"].ToString(),Container.DataItem)) %>'></asp:Label></td>        
             <td><input id="btnMo_<%# ID_indexes(Container.DataItem) %>" type="<%# Button_CheckModify(Container.DataItem) %>" value="<%# Text_CheckModify(Container.DataItem) %>" onclick="modify_click(<%# ID_indexes(Container.DataItem) %>)" class="btn-block" style="color:black" /></td>                                              
             <td><input id="btnCL_<%# ID_indexes(Container.DataItem) %>" type="<%# Button_CancelFirm(Session["event_f"].ToString(),Container.DataItem) %>" value="CL" onclick="cancel_click(<%# ID_indexes(Container.DataItem) %>)" <%# Session["ShowBtnUpAll"]=Button_CheckVenderFirm(Container.DataItem) %> <%# bfUpAll += Convert.ToInt16(Text_CheckBtnUpload(Session["ShowBtnUpAll"].ToString())) %> class="btn-block" style="color:black"/></td>          
             <td><asp:Label id="Label16" runat="server" width="150px" Text="<%# Text_CheckVenderFirm(Container.DataItem) %>" ></asp:Label></td>     
             <td><asp:Label id="Label32" runat="server" Text='<%# Text_CheckColumn(17,"",Container.DataItem) %>'></asp:Label></td>  
             <td><asp:Label id="Label33" runat="server" Text='<%# Text_CheckColumn(18,"",Container.DataItem) %>'></asp:Label></td>  
             </tr>	           
	</AlternatingItemTemplate> 

	</asp:Repeater> </table>
               <br />
        
      </div>
    </div>
                
      </div>
            </div>

         </div>

       <script src="css/js/jquery.min.js"></script>
       <script src="css/js/bootstrap.min.js"></script>
       <script type="text/javascript">
           /* $(document).ready(function () { });*/
           /*function load_click(doc)
           {
               var DOC_NEW = $("#PO_" + doc).text();
               if (DOC_NEW == "") {
                   alert("คุณไม่สามารถโหลดได้");
                   $("#btn" + doc).attr("disabled", "disabled").removeClass("btn btn-primary").addClass("btn btn-danger").html("Close Download");                                    
               } else {
                   $("#btn" + doc).attr("disabled", "disabled").removeClass("btn btn-primary").addClass("btn btn-success").html("Downloaded");
                   window.open("load_files.aspx?DC="+doc+"");
               }            
           }*/
           function cancel_click(id)
           {
               var confirm_value = document.createElement("INPUT");
               confirm_value.type = "hidden";
               confirm_value.name = "confirm_value";
               if (confirm("Press Button Yes to Cancel?")) 
               {
                   confirm_value.value = "Yes";
                   <%= Session["ShowPageMGCancel"] = "1" %>
                   //$.post("MGRMP_Cancel.aspx",{id:id});
                   window.open("MGRMP_Cancel.aspx?id="+id,"_self");  
               } 
               else 
                   confirm_value.value = "No";            
           }
           function modify_click(id)
           {
               <%= Session["ShowPageMF"] = "1" %>
               //$.post("page_viewmodify.aspx",{id:id});
               //window.open("page_viewmodify.aspx?DC="+id+"");
               window.open("plan_revise_mgr.aspx?DC="+id+"");
           }
           function qtylock_click(id)
           {
               var confirm_value = document.createElement("INPUT");
               confirm_value.type = "hidden";
               confirm_value.name = "confirm_value";
               if (confirm("Press Button Yes to Confirm?")) 
               {
                   confirm_value.value = "Yes";
                   <%= Session["ShowPageLK"] = "1" %>
                   $.post("page_qtylock.aspx",{id:id});
                   window.location.reload();   
               } 
               else 
                   confirm_value.value = "No";             
           }
           /*
           $.post("WebFormTest.aspx",{A:"XX"},function(data){
               alert(data);
           });
           */
           /*function btn_disable(id)
           {
               //document.getElementById("btnCF_" + id).setAttribute("value","Yes");
               document.getElementById("btnCF_" + id).disabled=true;
           }*/
       </script>
    </div>
</asp:Content>
