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

<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 Insert Invoice - Vender รายการสั่งสินค้าที่ยืนยันเรียบร้อยแล้ว(SA Number)&nbsp&nbsp&nbsp&nbsp&nbsp[<%= Session["ULogin"].ToString().Trim() %>]</div>
      <div class="panel-body">
        &nbsp&nbsp
        <asp:Label ID="lblVenderID" runat="server" Text="Vender:"></asp:Label>
        <asp:TextBox ID="txtVender" runat="server" ReadOnly = "false" Width="100px"></asp:TextBox>&nbsp&nbsp       
        <asp:DropDownList ID="ddlF" runat="server" Height ="26px">
        </asp:DropDownList>&nbsp&nbsp&nbsp&nbsp&nbsp
        <asp:Label ID="lblFrom" runat="server" Text="From"></asp:Label>
        <asp:TextBox ID="txtSearchDate" runat="server" ReadOnly = "true" Width="100px"></asp:TextBox>
        <asp:ImageButton ID="imgCalendar" runat="server" Height="20px" ImageUrl="~/Resources/calendar.gif" Width="25px" OnClick="imgCalendar_Click" />
        <asp:Calendar ID="Calendar" runat="server" OnSelectionChanged="Calendar_SelectionChanged" OnVisibleMonthChanged="Calendar_VisibleMonthChanged"></asp:Calendar>
        <asp:Label ID="lblTo" runat="server" Text="To"></asp:Label>
        <asp:TextBox ID="txtSearchDateLast" runat="server" ReadOnly = "true" Width="100px"></asp:TextBox>
        <asp:ImageButton ID="imgCalendar2" runat="server" Height="20px" ImageUrl="~/Resources/calendar.gif" Width="25px" OnClick="imgCalendar2_Click" />&nbsp&nbsp&nbsp
        <asp:Calendar ID="Calendar2" runat="server" OnSelectionChanged="Calendar2_SelectionChanged" OnVisibleMonthChanged="Calendar2_VisibleMonthChanged" ></asp:Calendar>
        <asp:Button ID="btnSearch" runat="server" Text="Search" width="100px" OnClick="btnSearch_Click"/>&nbsp
               <br /><br />
        &nbsp&nbsp&nbsp<asp:Label ID="lblResultSearch" runat="server" Text=""></asp:Label>&nbsp&nbsp
          <br />
        <asp:Button ID="btnDownload" runat="server" Text="Download All" width="100px" OnClick="btnDownload_Click"/>&nbsp
        <asp:Button ID="btnUpExcel" runat="server" Text="Insert By Excel" Width="130px" OnClick="btnUpExcel_Click" />&nbsp
               <br /><br />
        <asp:FileUpload ID="FileUpload1" runat="server" />               
        <asp:Button ID="btnUpload" runat="server" Text="Upload" OnClick="btnUpload_Click" />&nbsp&nbsp&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>VenderID.</td>
                <td>SA No.</td>
                <td>Company</td>
                <td>Quantity</td>
                <td width="10%">View</td>
                </tr>           	
   </HeaderTemplate>         
	<ItemTemplate>    
			 <tr style="background-color:#FFFFFF; color:black; height:35px;" align="left">
             <td><asp:Label id="Label5" runat="server" Text='<%# myRepeater.Items.Count + 1 %>' ></asp:Label></td>  
             <td><asp:Label id="Label3" runat="server" Text='<%#  valueTB[cntTB+2].ToString().Trim() %>' ></asp:Label></td>                    
             <td><asp:Label id="Label2" runat="server" Text='<%#  valueTB[cntTB+1].ToString().Trim() %>' ></asp:Label></td>       
             <td><asp:Label id="Label4" runat="server" Text='<%#  valueTB[cntTB+3].ToString().TrimEnd() %>' width="300px"></asp:Label></td> 
             <td><asp:Label id="Label11" runat="server" Text='<%#  Text_Qty(valueTB[cntTB+4].ToString().Trim()) %>' ></asp:Label></td>          
             <td><input id="btnCF_<%# valueTB[cntTB].ToString() %>" type="button" value="View" onclick="view_click(<%# valueTB[cntTB+1].ToString() %>)" <%# cntTB+=5 %> 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="Label8" runat="server" Text='<%# valueTB[cntTB+2].ToString().Trim() %>' ></asp:Label></td> 
             <td><asp:Label id="Label7" runat="server" Text='<%# valueTB[cntTB+1].ToString().Trim() %>' ></asp:Label></td>                 
             <td><asp:Label id="Label9" runat="server" Text='<%# valueTB[cntTB+3].ToString().TrimEnd() %>' width="300px"></asp:Label></td> 
             <td><asp:Label id="Label10" runat="server" Text='<%# Text_Qty(valueTB[cntTB+4].ToString().Trim())  %>' ></asp:Label></td>      
             <td><input id="btnCF_<%# valueTB[cntTB].ToString() %>" type="button" value="View" onclick="view_click(<%# valueTB[cntTB+1].ToString() %>)" <%# cntTB+=5 %> 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">
           function view_click(id)
           {
               //$.post("plan_upload_forecast.aspx", { id: id });
               window.open("plan_invoice_item.aspx?DC="+id+"","_self"); 
               //window.open("plan_upload_work.aspx?DC="+id+"",""); 
           }
       </script>
    </div>
</asp:Content>
