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

<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 Forecast & Firm - Vender รายการแผนการผลิตและสั่งสินค้า(รอบการรับส่งสินค้า Item)&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="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="lblEvent" runat="server" Text="" Font-Bold="true" ForeColor="blue"></asp:Label>&nbsp&nbsp&nbsp&nbsp&nbsp
        <asp:Label ID="lblRound" runat="server" Text="" Font-Bold="true" ForeColor="blue"></asp:Label>&nbsp&nbsp&nbsp&nbsp&nbsp
        <asp:Label ID="lblDate" runat="server" Text="" Font-Bold="true" ForeColor="blue"></asp:Label>&nbsp&nbsp&nbsp&nbsp&nbsp
        <asp:Label ID="lblTime" runat="server" Text="" Font-Bold="true" ForeColor="blue"></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#D" Width="150px" OnClick="btnDLAll_Click" />&nbsp&nbsp&nbsp
        <asp:Button ID="btnDLSH" runat="server" Text="Download Shipping" Width="150px" Font-Bold="true" OnClick="btnDLSH_Click" />&nbsp&nbsp&nbsp
        <asp:Button ID="btnDLLB" runat="server" Text="Download Label" Width="150px" Font-Bold="true" OnClick="btnDLLB_Click" />&nbsp&nbsp&nbsp
        <asp:Button ID="btnDLCommon" runat="server" Text="Download Shipping&Label" Width="200px" Font-Bold="true" OnClick="btnDLCommon_Click" />&nbsp&nbsp&nbsp
        <asp:Button ID="btnPreview" runat="server" Text="PDF Preview" Width="150px" Font-Bold="true"  ForeColor="BlueViolet" OnClick="btnPreview_Click" />&nbsp&nbsp&nbsp
          <br />
&nbsp;<asp:Repeater id="myRepeater" runat="server">
	<HeaderTemplate>
<table class="table table-bordered">
                <tr style="background-color:#0000FF; color:white; font-weight:bold;height:35px;" align="Left">
                <td>No.</td>
                <td>Item</td>
                <td>Seq.</td>
                <td>Locat.</td>
                <td>ArtNo.</td>
                <td>MatNo.</td>
                <td>Plant</td>
                <td>Description</td>
                <td>Quantity</td>
                <td>Unit</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="Label3" runat="server" Text='<%# Text_CheckColumn(1,"",Container.DataItem)%>'></asp:Label></td>        
             <td><asp:Label id="Label4" runat="server" Text='<%# Text_CheckColumn(2,"",Container.DataItem) %>'></asp:Label></td>
             <td><asp:Label id="Label28" runat="server" Text='<%# SaveLocation(Text_CheckColumn(17,"",Container.DataItem)) %>'></asp:Label></td>      
             <td><asp:Label id="Label14" 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="Label6" runat="server" Text='<%# SavePlant(Text_CheckColumn(7,"",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="Label12" runat="server" Text='<%# Text_Qty(Text_CheckColumn(5,"",Container.DataItem)) %>'></asp:Label></td>   
             <td><asp:Label id="Label13" runat="server" Text='<%# Text_CheckColumn(6,"",Container.DataItem) %>'></asp:Label></td>
             <td><asp:Label id="Label7" runat="server" Text='<%# SaveMRPControl(Text_CheckColumn(10,"",Container.DataItem)) %>'></asp:Label></td>
             <td><asp:Label id="Label8" runat="server" Text='<%# Text_CheckColumn(11,"",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="Label3" runat="server" Text='<%# Text_CheckColumn(1,"",Container.DataItem) %>'></asp:Label></td>        
             <td><asp:Label id="Label4" runat="server" Text='<%# Text_CheckColumn(2,"",Container.DataItem) %>'></asp:Label></td>   
             <td><asp:Label id="Label29" runat="server" Text='<%# SaveLocation(Text_CheckColumn(17,"",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="Label9" runat="server" Text='<%# SavePlant(Text_CheckColumn(7,"",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="Label15" runat="server" Text='<%# Text_Qty(Text_CheckColumn(5,"",Container.DataItem)) %>'></asp:Label></td>        
             <td><asp:Label id="Label16" runat="server" Text='<%# Text_CheckColumn(6,"",Container.DataItem) %>'></asp:Label></td>    
             <td><asp:Label id="Label10" runat="server" Text='<%# SaveMRPControl(Text_CheckColumn(10,"",Container.DataItem)) %>'></asp:Label></td>  
             <td><asp:Label id="Label11" runat="server" Text='<%# Text_CheckColumn(11,"",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 confirm_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["ShowPageMPConfirm"] = "1" %>
                   $.post("MP_Confirm.aspx", { id: id });
                   window.location.reload();
               }
               else
                   confirm_value.value = "No";
               //document.forms[0].appendChild(confirm_value);
               //window.alert("Test");
               //$.post("Vender_Confirm.aspx",{A:"B",B:"B"});
               //$.post("Vender_Confirm.aspx",{id:id});
               //window.location.reload();            
           }
           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["ShowPageMPCancel"] = "1" %>
                   //$.post("MP_Cancel.aspx",{id:id});
                   //window.location.reload();
                   window.open("MP_Cancel.aspx?id=" + id, "_self");
               }
               else
                   confirm_value.value = "No";
               //document.forms[0].appendChild(confirm_value);
               //window.alert("Test");
               //$.post("Vender_Confirm.aspx",{A:"B",B:"B"});
               //$.post("Vender_Confirm.aspx",{id:id});
               //window.location.reload();            
           }
           function modify_click(id) {
               <%= Session["ShowPageMF"] = "1" %>
               //$.post("page_viewmodify.aspx",{id:id});
               //window.open("page_viewmodify.aspx?DC="+id+"");       
               window.open("plan_revise_mrp.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();   
                   window.open("page_qtylock.aspx?id=" + id, "_self");
               }
               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>
