<%@ Page Title="External Transfer" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="ExternalTransfer.aspx.cs" Inherits="ZFJINV.Inventory.ExternalTransfer" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <div class="row">
        <div class="col-md-12 mySpace">
            <asp:UpdatePanel runat="server">
                <ContentTemplate>

                    <div class="caption" style="padding-bottom: 12px; overflow: auto;">
                        <span class="caption-subject font-blue sbold" style="font-size: 150%;">Inventory Transfer</span>
                        <%--<div class="pull-right">
                        <button type="button" class="btn btn-success" disabled="disabled" style="height: 28px;">saved</button>
                    </div> --%>
                        <div class="btn-group pull-right">
                            <img src="../assets/global/img/gridicons/addgrid.png" />
                            <asp:LinkButton ID="lblAdd" Text="Add" runat="server" class="imgCss" OnClick="Add"></asp:LinkButton>

                            <img src="../assets/global/img/gridicons/gridsearch.png" />
                            <asp:LinkButton ID="lblFind" Text="Find" runat="server" class="imgCss" OnClick="lblFind_Click"></asp:LinkButton>

                           <%-- <img src="../assets/global/img/gridicons/editgrid.png" />
                            <asp:LinkButton ID="lblEdit" Text="Edit" runat="server" class="imgCss" OnClick="Edit"></asp:LinkButton>--%>

                            <img src="../assets/global/img/gridicons/previous.png" onclick="#" />
                            <asp:LinkButton ID="lblFirst" Text="First" runat="server" class="imgCss" OnClick="First"></asp:LinkButton>

                            <img src="../assets/global/img/gridicons/first.png" />
                            <asp:LinkButton ID="lblNext" Text="Next" runat="server" class="imgCss" OnClick="Next"></asp:LinkButton>

                            <img src="../assets/global/img/gridicons/last.png" class="imgCss" />
                            <asp:LinkButton ID="lblPrevious" Text="Previous" runat="server" OnClick="Previous"></asp:LinkButton>

                            <img src="../assets/global/img/gridicons/next.png" class="imgCss" />
                            <asp:LinkButton ID="lblLast" Text="Last" runat="server" OnClick="Last"></asp:LinkButton>
                        </div>
                    </div>
                    <div class="ui segment">
                        <div class="ui stackable form">
                            
                            <div class="col-md-3">
                                <label class="lbStyle">Transfer ID:</label>
                                <asp:TextBox ID="txtTransferID" AutoPostBack="True" OnTextChanged="txtTransferID_TextChanged" CssClass="myInput" runat="server" title="Transfer ID"></asp:TextBox>
                            </div>

                            <div class="col-md-3">
                                <label class="lbStyle">Transfer Date:</label>
                                <asp:TextBox ID="txtTransferDate" runat="server" title="Transfer Date" CssClass="mydatepickerclass myInput" required="required"></asp:TextBox>
                            </div>
                            <div class="col-md-3">
                                <label class="lbStyle">Source W.H.:</label>
                                <asp:DropDownList ID="txtWHLocation" AutoPostBack="True" runat="server" OnSelectedIndexChanged ="txtWHLocation_SelectedIndexChanged" CssClass="select2 form-control" required="required"></asp:DropDownList>
                            </div>
                            
                         <%--   <div class="col-md-3">
                                <label class="lbStyle">Supplier:</label>

                                <asp:DropDownList ID="txtSupplier" AutoPostBack="True" runat="server" CssClass="select2 form-control ">
                                </asp:DropDownList>
                            </div>--%>

                            <div class="col-md-3">
                                <label class="lbStyle">Ref No.:</label>
                                <asp:TextBox ID="txtRefNo" runat="server" title="Transfer Reference No." CssClass="myInput" ReadOnly="True"></asp:TextBox>
                            </div>

<%--                            <div class="col-md-3">

                                <label class="lbStyle">Ref. Date:</label>
                                <asp:TextBox ID="txtRefDate" runat="server" title="Transfer Reference Date" CssClass="mydatepickerclass myInput" required="required"></asp:TextBox>
                            </div>--%>
                           
                             <div class="col-md-3">
                                <label class="lbStyle">Remarks:</label>
                                <asp:TextBox ID="txtRemarks" runat="server" title="Remarks" CssClass="myInput" ></asp:TextBox>
                            </div>

                            <div class="col-md-3">
                                <label class="lbStyle"></label>

                            </div>
                            <div class="row">
                            </div>

                        </div>
                    </div>

                    <div class="rounded-corners">
                        <div style="width: 100%; overflow: auto;">

                            <asp:GridView ID="grdTransferExternal" ShowHeaderWhenEmpty="True" EnableViewState="true"
                                GridLines="Horizontal" BorderColor="WhiteSmoke" RowStyle-Wrap="false"
                                HeaderStyle-Wrap="false" RowStyle-BorderColor="#e8e8ec"
                                CssClass="uimy ui table" runat="server" AutoGenerateColumns="False"
                                ShowFooter="True"
                                OnRowCommand="grdTransferExternal_RowCommand" AllowPaging="true"
                                OnPageIndexChanging="grdTransferExternal_PageIndexChanging"
                                OnRowEditing="grdTransferExternal_RowEditing"
                                OnRowUpdating="grdTransferExternal_RowUpdating"
                                OnRowCancelingEdit="grdTransferExternal_RowCancelingEdit"
                                OnRowDeleting="grdTransferExternal_RowDeleting"
                                OnRowDataBound="grdTransferExternal_RowDataBound"
                                PageSize="10"
                                PagerStyle="pagination-ys">

                                <Columns>
                                    <asp:TemplateField HeaderText="Transfer ID" InsertVisible="False" Visible="False" SortExpression="TransferID">
                                        <EditItemTemplate>

                                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("TransferID") %>'></asp:Label>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("TransferID") %>'></asp:Label>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <asp:TextBox ID="txtTransferID" CssClass="myInput1" runat="server"></asp:TextBox>
                                        </FooterTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Product Code" InsertVisible="False" SortExpression="ProductID" HeaderStyle-CssClass="gridView2" ItemStyle-CssClass="gridviewBody1" FooterStyle-CssClass="FooterStyle">
                                        <EditItemTemplate>
                                            <asp:Label ID="Label3" runat="server" Text='<%# Eval("ProductID") %>'></asp:Label>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label4" runat="server" Text='<%# Bind("ProductID") %>'></asp:Label>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <asp:TextBox ID="txtCode" Enabled="False" required="required" CssClass="itemCode" runat="server"></asp:TextBox>
                                        </FooterTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Warehouse" InsertVisible="False" SortExpression="WHID" HeaderStyle-CssClass="gridView2" ItemStyle-CssClass="gridviewBody1" FooterStyle-CssClass="FooterStyle2">
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="txtWHID" Text='<%# Eval("WHID") %>' CssClass="select2 form-control gvModel" AutoPostBack="false" AppendDataBoundItems="true" runat="server" required="required"></asp:DropDownList>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="lblwhid" Text='<%# Eval("WHID") %>' runat="server"></asp:Label>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <asp:DropDownList ID="txtWHID" CssClass="select2 form-control gvModel" AutoPostBack="false" AppendDataBoundItems="true" runat="server" required="required"></asp:DropDownList>
                                       
                                             </FooterTemplate>

                                    </asp:TemplateField>

                                       <asp:TemplateField HeaderText="Brand" InsertVisible="False" SortExpression="Brand" HeaderStyle-CssClass="gridViewModel" ItemStyle-CssClass="gridviewBody1" FooterStyle-CssClass="FooterStyle">
                                        <EditItemTemplate>
                                            <asp:Label ID="Label13" runat="server" Text='<%# Eval("Brand") %>'></asp:Label>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label14" runat="server" Text='<%# Bind("Brand") %>'></asp:Label>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <asp:DropDownList ID="txtBrand"  CssClass="Amount" runat="server" OnSelectedIndexChanged ="txtBrand_SelectedIndexChanged" AutoPostBack ="true" required="required"></asp:DropDownList>
                                        </FooterTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Name" InsertVisible="False" SortExpression="Name" HeaderStyle-CssClass="gridView2" ItemStyle-CssClass="gridviewBody1" FooterStyle-CssClass="FooterStyle2">
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="txtName" Text='<%# Eval("Name") %>' OnSelectedIndexChanged="txtName_SelectedIndexChanged" CssClass="select2 form-control gvModel" AutoPostBack="True" required="required" AppendDataBoundItems="true" runat="server"></asp:DropDownList>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Labelname" Text='<%# Eval("Name") %>' runat="server"></asp:Label>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <asp:DropDownList ID="txtName" OnSelectedIndexChanged="txtName_SelectedIndexChanged" CssClass="select2 form-control gvModel" AutoPostBack="True" required="required" AppendDataBoundItems="true" runat="server"></asp:DropDownList>
                                        </FooterTemplate>
                                    </asp:TemplateField>                                                                   

                                    <asp:TemplateField HeaderText="Unit Price" InsertVisible="False" SortExpression="UnitPrice" HeaderStyle-CssClass="gridView2" ItemStyle-CssClass="gridviewBody1" FooterStyle-CssClass="FooterStyle">
                                        <EditItemTemplate>
                                            <asp:Label ID="Label7" runat="server" Text='<%# Eval("UnitPrice") %>'></asp:Label>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label8" runat="server" Text='<%# Bind("UnitPrice") %>'></asp:Label>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <asp:TextBox ID="txtUnitPrice" Enabled="False" CssClass="UnitPrice" runat="server"></asp:TextBox>
                                        </FooterTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Batch No" InsertVisible="False" SortExpression="BatchNo" HeaderStyle-CssClass="gridView2" ItemStyle-CssClass="gridviewBody1" FooterStyle-CssClass="FooterStyle2">
                                        <EditItemTemplate>
                                            <asp:DropDownList ID="txtBatchNo" Text='<%# Eval("BatchNo") %>' OnSelectedIndexChanged="txtBatchNo_SelectedIndexChanged" CssClass="select2 form-control gvModel" AutoPostBack="True" required="required" AppendDataBoundItems="true" runat="server"></asp:DropDownList>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Lblbatchno" Text='<%# Eval("BatchNo") %>' runat="server"></asp:Label>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <asp:DropDownList ID="txtBatchNo" OnSelectedIndexChanged="txtBatchNo_SelectedIndexChanged" CssClass="select2 form-control gvModel" AutoPostBack="True" required="required" AppendDataBoundItems="true" runat="server"></asp:DropDownList>
                                        </FooterTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Balance Qty" InsertVisible="False" SortExpression="BalanceQty" HeaderStyle-CssClass="gridViewModel" ItemStyle-CssClass="gridviewBody1" FooterStyle-CssClass="FooterStyle">
                                        <EditItemTemplate>
                                            <asp:Label ID="label1234" runat="server" Text='<%# Bind("BalanceQty") %>'></asp:Label>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label1232" runat="server" Text='<%# Bind("BalanceQty") %>'></asp:Label>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <asp:TextBox ID="txtBalanceQty" Enabled="false" CssClass="Quatntity" runat="server" required="required"></asp:TextBox>
                                        </FooterTemplate>
                                    </asp:TemplateField>

                                    <asp:TemplateField HeaderText="Transfer Qty" InsertVisible="False" SortExpression="TransferQty" HeaderStyle-CssClass="gridViewModel" ItemStyle-CssClass="gridviewBody1" FooterStyle-CssClass="FooterStyle">
                                        <EditItemTemplate>
                                            <asp:TextBox ID="txtQty" AutoPostBack="True" Text='<%# Bind("TransferQty") %>' TextMode="Number" OnTextChanged="txtQty_TextChanged" CssClass="Quatntity" runat="server" required="required"></asp:TextBox>
                                        </EditItemTemplate>
                                        <ItemTemplate>
                                            <asp:Label ID="Label12" runat="server" Text='<%# Bind("TransferQty") %>'></asp:Label>
                                        </ItemTemplate>
                                        <FooterTemplate>
                                            <asp:TextBox ID="txtQty" AutoPostBack="True" TextMode="Number" OnTextChanged="txtQty_TextChanged" CssClass="Quatntity" runat="server" required="required"></asp:TextBox>
                                        </FooterTemplate>
                                    </asp:TemplateField>                                                                       

                                    <asp:TemplateField HeaderText="Action" InsertVisible="False" SortExpression="Action" HeaderStyle-CssClass="gridView2" ItemStyle-CssClass="gridviewBody1" FooterStyle-CssClass="FooterStyle">
                                        <ItemTemplate>
                                             <asp:Button CssClass="small ui button red" Text="Delete" ID="lblDelete" ToolTip="Delete" CommandArgument='<%# Eval("TransferID") %>'
                                                    formnovalidate="formnovalidate" ImageUrl="~/assets/global/img/deletee.png" runat="server" CommandName="DeleteRow" />
                                            <%--<asp:Button CssClass="small ui button red" Text="Delete" ID="lblDelete" ToolTip="Delete" CommandArgument='<%# Eval("TransferID") %>' formnovalidate="formnovalidate" ImageUrl="~/assets/global/img/deletee.pngg" runat="server" CommandName="DeleteRow" />--%>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                        </EditItemTemplate>
                                        <FooterTemplate>
                                            <asp:Button ID="lblSave" CommandName="InsertRow" CssClass="small ui button blue" Text="Add" runat="server"></asp:Button>
                                        </FooterTemplate>

                                    </asp:TemplateField>
                                </Columns>

                            </asp:GridView>
                        </div>

                    </div>
                    <div class="ui segment col-md-5" style="border-color: #AAB7B8;">
                        <div class="col-md-12">
                            <div class="messagealert" id="alert_container">
                            </div>
                        </div>
                        <label style="font-size: 12px; color: #2E4053; font-weight: 700; padding-bottom: 3px;">Total Qty:</label>
                        <asp:TextBox ID="txtTotalQty" type="text" disabled="disabled" runat="server" class=" form-control" /><br />


                        <asp:Button ID="btnAdd" runat="server" CausesValidation="false" class="ui button green" formnovalidate="formnovalidate" OnClick="btnAdd_Click" Text="Save" /><tb/>
                        <asp:Button ID="btnPrint" runat="server" class="ui button green" OnClick="lblShow_Click" Text="Print Preview" /><br />

                    </div>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="grdTransferExternal" />
                </Triggers>
            </asp:UpdatePanel>

        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="footerContent" runat="server">
</asp:Content>
