<%@ Page Title="Plan Release" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="plan_upload_seq.aspx.cs" Inherits="edicenter.plan_upload_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 Release - MRP รายการแผนการผลิตและสั่งสินค้า(Sequence Number)&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="Label6" runat="server" Text="MRP:" Font-Bold="true"></asp:Label>
        <asp:Label ID="lblMRP" runat="server" Text=""></asp:Label>&nbsp&nbsp 
        <asp:Label ID="Label20" runat="server" Text="Name:" Font-Bold="true"></asp:Label>
        <asp:Label ID="lblMRPName" 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
        <asp:Button ID="btnDLAll" runat="server" Text="Download Format#B" Width="150px" OnClick="btnDLAll_Click" />&nbsp&nbsp&nbsp
        <asp:Button ID="btnUploadAll" runat="server" Text="Release" Font-Bold="true" Width="150px" OnClick="btnUploadAll_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>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>Revise</td>
                <td>Cancel</td>
                <td>Status</td>
                <td>QtyLK</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='<%# 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="Label5" runat="server" width="300px" Text='<%# Text_CheckColumn(4,"",Container.DataItem) %>'></asp:Label></td>  
             <td><asp:Label id="Label10" runat="server" Text='<%# Text_CheckColumn(13,Session["event_f"].ToString().Trim(),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="Label30" runat="server" width="80px" Text='<%# Text_CheckColumn(18,"",Container.DataItem) %>'></asp:Label></td> 
             <td><asp:Label id="Label31" runat="server" Text='<%# Text_CheckColumn(19,"",Container.DataItem) %>'></asp:Label></td> 
             <td><asp:Label id="Label8" runat="server" Text='<%# Text_CheckColumn(5,Session["event_f"].ToString().Trim(),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="Label24" runat="server" Text='<%# Text_CheckColumn(14,Session["event_f"].ToString().Trim(),Container.DataItem) %>'></asp:Label></td>  
             <td><asp:Label id="Label25" runat="server" Text='<%# Text_CheckColumn(15,Session["event_f"].ToString().Trim(),Container.DataItem) %>'></asp:Label></td>  
             <td><asp:Label id="Label11" runat="server" Text='<%# Text_CheckColumn(16,Session["event_f"].ToString().Trim(),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(Container.DataItem) %>" value="CL" onclick="cancel_click(<%# ID_indexes(Container.DataItem) %>)" class="btn-block" /></td>                                      
             <td><asp:Label id="Label15" runat="server" width="150px" Text="<%# Text_CheckVenderFirm(Container.DataItem) %>" ></asp:Label></td>                                                                                   
	         <td><input id="btnLk_<%# ID_indexes(Container.DataItem) %>" type="<%# Button_CheckQtyLk(Session["event_f"].ToString(),Container.DataItem) %>" value="<%# Text_CheckQtyLk(Session["event_f"].ToString(),Container.DataItem) %>" onclick="qtylock_click(<%# ID_indexes(Container.DataItem) %>)" <%# Session["ShowBtnUpAll"]=Button_CheckVenderFirm(Container.DataItem) %> <%# bfUpAll += Convert.ToInt16(Text_CheckBtnUpload(Session["ShowBtnUpAll"].ToString())) %> class="btn-block"/></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='<%# 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="Label5" runat="server" width="300px" Text='<%# Text_CheckColumn(4,"",Container.DataItem) %>'></asp:Label></td>  
             <td><asp:Label id="Label21" runat="server" Text='<%# Text_CheckColumn(13,Session["event_f"].ToString().Trim(),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="Label30" runat="server" width="80px" Text='<%# Text_CheckColumn(18,"",Container.DataItem) %>'></asp:Label></td> 
             <td><asp:Label id="Label31" runat="server" Text='<%# Text_CheckColumn(19,"",Container.DataItem) %>'></asp:Label></td> 
             <td><asp:Label id="Label8" runat="server" Text='<%# Text_CheckColumn(5,Session["event_f"].ToString().Trim(),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="Label26" runat="server" Text='<%# Text_CheckColumn(14,Session["event_f"].ToString().Trim(),Container.DataItem) %>'></asp:Label></td>
             <td><asp:Label id="Label27" runat="server" Text='<%# Text_CheckColumn(15,Session["event_f"].ToString().Trim(),Container.DataItem) %>'></asp:Label></td>  
             <td><asp:Label id="Label12" runat="server" Text='<%# Text_CheckColumn(16,Session["event_f"].ToString().Trim(),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(Container.DataItem) %>" value="CL" onclick="cancel_click(<%# ID_indexes(Container.DataItem) %>)" 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><input id="btnLk_<%# ID_indexes(Container.DataItem) %>" type="<%# Button_CheckQtyLk(Session["event_f"].ToString(),Container.DataItem) %>" value="<%# Text_CheckQtyLk(Session["event_f"].ToString(),Container.DataItem) %>" onclick="qtylock_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>                                  
             </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>
