<%@ Page Title="Edit Supplier" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="SuppliersEdit.aspx.cs" Inherits="SMTBETECH_V3.SuppliersEdit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">


         <h2 id="title"><%: Title %></h2>
 
 <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"></asp:ScriptManagerProxy>

 <asp:UpdateProgress ID="UpdateProgress1" runat="server" DynamicLayout="true" AssociatedUpdatePanelID="UpdatePanelSupplierEdit"  >

<ProgressTemplate>
   Loading...
</ProgressTemplate>

 </asp:UpdateProgress>

 <asp:UpdatePanel ID="UpdatePanelSupplierEdit" runat="server" >

     <ContentTemplate>


    <div class="row mb-1">
        <div class="col-2">
            <label style="font-weight:bold" for="FormSupplierID" class="form-label">Id:</label>
            <asp:TextBox disabled="true" CssClass="form-control" runat="server" ID="FormSupplierID"></asp:TextBox>
        </div>
        <div class="col">
            <label style="font-weight:bold" for="FormSupplierName" class="form-label">Supplier Name:</label>
            <asp:TextBox CssClass="form-control" runat="server" ID="FormSupplierName"></asp:TextBox>
        </div>
    </div>
    
    <div class="row mb-1">
        <div class="col">
            <label style="font-weight:bold" for="FormSupplierAbbrevation" class="form-label">Abbrevation:</label>
            <asp:TextBox CssClass="form-control" runat="server" ID="FormSupplierAbbrevation"></asp:TextBox>
        </div>
        <div class="col">
            <label style="font-weight:bold" for="FormTaxID" class="form-label">Tax ID:</label>
            <asp:TextBox CssClass="form-control" runat="server" ID="FormTaxID"></asp:TextBox>
        </div>
    </div>

    <hr />

    <div class="row mb-1">
        <div class="col">
            <label style="font-weight:bold" for="FormStreet" class="form-label">Street:</label>
            <asp:TextBox CssClass="form-control" runat="server" ID="FormStreet"></asp:TextBox>
        </div>
        <div class="col">
            <label style="font-weight:bold" for="FormSuburb" class="form-label">Suburb:</label>
            <asp:TextBox CssClass="form-control" runat="server" ID="FormSuburb"></asp:TextBox>
        </div>
    </div>

    <div class="row mb-1">
        <div class="col">
            <label style="font-weight:bold" for="FormMunicipality" class="form-label">Municipality:</label>
            <asp:TextBox CssClass="form-control" runat="server" ID="FormMunicipality"></asp:TextBox>
        </div>
        <div class="col">
            <label style="font-weight:bold" for="FormZipCode" class="form-label">ZipCode:</label>
            <asp:TextBox CssClass="form-control" runat="server" ID="FormZipCode"></asp:TextBox>
        </div>
    </div>

    <div class="row mb-1">
        <div class="col">
            <label style="font-weight:bold" for="FormState" class="form-label">State:</label>
            <asp:TextBox CssClass="form-control" runat="server" ID="FormState"></asp:TextBox>
        </div>
        <div class="col">
            <label style="font-weight:bold" for="FormCountry" class="form-label">Country:</label>
            <asp:TextBox CssClass="form-control" runat="server" ID="FormCountry"></asp:TextBox>
        </div>
    </div>

    <hr />

    
         <%--Start SELLER --%>
    <h4>Sellers:</h4>
         
         <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtenderSellers" runat="server" BackgroundCssClass="modalBackground" DropShadow="True" TargetControlID="btnNewSeller" PopupControlID="panModalPopup" CancelControlID="btnCancelButton" />
            <asp:Panel ID="panModalPopup" runat="server" style="display:none; text-align:left; width:350px; background-color:White; border-width:2px; border-color:steelblue; border-style:solid; padding:10px;">
                <h4>New Seller</h4>
                 <hr />
                <div class="row mb-1">
                    <div class="col">
                        <label style="font-weight:bold" for="FormSellerName" class="form-label">Seller Name:</label>
                        <asp:TextBox CssClass="form-control" runat="server" ID="FormSellerName"></asp:TextBox>
                    </div>
                </div>
                <div class="row mb-1">
                    <div class="col">
                        <label style="font-weight:bold" for="FormSellerEmail" class="form-label">Seller Email:</label>
                        <asp:TextBox CssClass="form-control" runat="server" ID="FormSellerEmail"></asp:TextBox>
                    </div>
                </div>
                <div class="row mb-1">
                    <div class="col">
                        <label style="font-weight:bold" for="FormSellerPhone" class="form-label">Seller Phone:</label>
                        <asp:TextBox CssClass="form-control" runat="server" ID="FormSellerPhone"></asp:TextBox>
                    </div>
                </div>

                <p></p>

                <div style="text-align:right;">
                    <asp:Button ID="btnSaveSeller" CssClass="btn btn-primary btn-sm" runat="server" Text="Save Seller" OnClick="btnSaveSeller_Click" />
                    <asp:Button ID="btnCancelButton" CssClass="btn btn-secondary btn-sm" runat="server" Text="Cancel" OnClick="btnCancelButton_Click"/>
                </div>
            </asp:Panel>

         <asp:Button ID="btnNewSeller" runat="server" CssClass="btn btn-primary btn-sm" Text="New Seller" />
         <p></p>

        <asp:GridView CssClass="table table-bordered table-striped table-sm"
            ID="GVSuppliersSellers" runat="server" AutoGenerateColumns="false" OnRowCommand="GVSuppliersSellers_RowCommand">
            <HeaderStyle CssClass="table-primary" />
            <Columns>
                <asp:BoundField Visible="false" DataField="IdSeller" HeaderText="Id" SortExpression="IdSeller" InsertVisible="False" ReadOnly="True">
                <ItemStyle Width="100px" />
                </asp:BoundField>
                <asp:BoundField DataField="SellerName" HeaderText="Seller Name" SortExpression="SellerName">
                <ItemStyle Width="400px" />
                </asp:BoundField>
                <asp:BoundField DataField="SellerEmail" HeaderText="Seller Email" SortExpression="SellerEmail">
                <ItemStyle Width="200px" />
                </asp:BoundField>
                <asp:BoundField DataField="SellerPhone" HeaderText="Seller Phone" SortExpression="SellerPhone">
                <ItemStyle Width="200px" />
                </asp:BoundField>

                <asp:TemplateField HeaderStyle-CssClass="col-1" ItemStyle-Width="80px" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>                        
                        <asp:Button runat="server" ID="btnDeleteSeller" CssClass="btn btn-close" CommandName="DeleteSeller" CommandArgument= '<%# Eval("IdSeller") %>' />
                    </ItemTemplate>
                </asp:TemplateField>

            </Columns>

            <EmptyDataTemplate>No Sellers</EmptyDataTemplate>
        </asp:GridView>
    
         <%--End SELLERS--%>

    <hr />

   

    <div class="row mb-1">
        <div class="col">
            <label style="font-weight:bold" for="FormTermsPayment" class="form-label">Terms of Payment:</label>
            <asp:TextBox CssClass="form-control" runat="server" ID="FormTermsPayment"></asp:TextBox>
        </div>
        <div class="col">
            <label style="font-weight:bold" for="FormCurrency" class="form-label">Currency:</label>
            <asp:TextBox CssClass="form-control" runat="server" ID="FormCurrency"></asp:TextBox>
        </div>
    </div>




    <hr />

        

   <div class="row mb-1">
        <div class="col">
            <label style="font-weight:bold" for="FormCreationDate" class="form-label">Creation Date:</label>
            <asp:TextBox disabled="true" CssClass="form-control" runat="server" ID="FormCreationDate"></asp:TextBox>
        </div>
        <div class="col">
            <label style="font-weight:bold" for="FormModifiedDate" class="form-label">Last Modified Date:</label>
            <asp:TextBox disabled="true" CssClass="form-control" runat="server" ID="FormModifiedDate"></asp:TextBox>
        </div>
        
   
    </div>

         <asp:Button ID="btnSave" runat="server" CssClass="btn btn-primary" Text="Update" OnClick="btnSave_Click" OnClientClick="return confirm('Update Supplier ? ');" />
         <asp:Button ID="btnBack" runat="server" CssClass="btn btn-secondary" Text="Back to Suppliers" OnClick="btnBack_Click" />
         
        </ContentTemplate>
    </asp:UpdatePanel>



</asp:Content>
