<%@ Page Title="Customers" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Customers.aspx.cs" Inherits="SMTBETECH_V3.Customers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">


    <style type="text/css">
    /*body {
        font-family: Arial;
        font-size: 10pt;
    }*/

    .GridPager a, .GridPager span {
        display: block;
        height: 28px;
        width: 24px;
        font-weight: bold;
        text-align: center;
        text-decoration: none;
    }

    .GridPager a {
        background-color: #f5f5f5;
        color: #969696;
        border: 1px solid #969696;
    }

    .GridPager span {
        /*background-color: #A1DCF2;*/
        background-color: steelblue;
        color: whitesmoke;
        border: 1px solid #3AC0F2;
    }
</style>
  
    
    <asp:ScriptManagerProxy ID="ScriptManagerProxy1" runat="server"></asp:ScriptManagerProxy>

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

   <ProgressTemplate>
      Loading...
   </ProgressTemplate>
   
    </asp:UpdateProgress>

    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>

            <h2 id="title"><%: Title %></h2>

           
            <asp:Panel runat="server" DefaultButton="btnSearch">

            <div class="row" style="width:100%">

                <div class="col-2" style="text-align:left">
                    <asp:Button CssClass="btn btn-primary btn-sm" ID="btnNewCustomer" runat="server"
                        Text="New" OnClick="btnNewCustomer_Click"/>
                </div>
                <div class="col-4">
                    <asp:TextBox CssClass="form-control" placeholder="Search Customer"  runat="server"
                        ID="txtSearCustomer" AutoPostBack="false" onFocus="this.select()"/>
                </div>
                <div class="col-6" style="text-align:left">
                    <asp:Button CssClass="btn btn-primary btn-sm" ID="btnSearch" runat="server" 
                        Text="Search" OnClick="btnSearch_Click"/>
                    <asp:Button CssClass="btn btn-primary btn-sm" ID="btnClearSearch" runat="server"
                        Text="Clear" OnClick="btnClearSearch_Click"/>
                </div>
                

            </div>
            <p></p>
            </asp:Panel>

    <div style="overflow-x:scroll">

        <%--<asp:GridView CssClass="table table-bordered table-striped table-sm"
            ID="GVCustomers"
            runat="server"
            DataSourceID="SMTBETECH_DS"
            AutoGenerateColumns="False"
            DataKeyNames="CustomerName"
            AllowPaging="True"
            AllowSorting="True"
            OnRowCommand="GVCustomers_RowCommand">--%>

            <asp:GridView CssClass="table table-bordered table-striped table-sm"
                ID="GVCustomers"
                runat="server"
                AutoGenerateColumns="False"
                AllowPaging="True"
                AllowSorting="False"
                OnRowCommand="GVCustomers_RowCommand" OnPageIndexChanging="GVCustomers_PageIndexChanging" PageSize="10">
            <HeaderStyle CssClass="table-primary" />
                <Columns>
                    <asp:BoundField DataField="Id" HeaderText="Id" ReadOnly="True" InsertVisible="False" SortExpression="Id"></asp:BoundField>

                    <asp:ButtonField HeaderStyle-Wrap="false" HeaderStyle-Width="300px" ItemStyle-Wrap="false" SortExpression="CustomerName" 
                        CommandName="EditCustomer" DataTextField="CustomerName" HeaderText="Customer Name" />
                
            <%--<asp:BoundField ItemStyle-Wrap="false" ItemStyle-Width="300px" DataField="CustomerName" HeaderText="Customer Name" SortExpression="CustomerName" />--%>
            
                    <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="200px" DataField="CustomerAbbrevation" HeaderText="Customer Abbrevation" SortExpression="CustomerAbbrevation"></asp:BoundField>
                    <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="200px" DataField="VendorNo" HeaderText="Vendor No" SortExpression="VendorNo"></asp:BoundField>
                    <asp:BoundField DataField="TaxId" HeaderText="Tax Id" SortExpression="TaxId"></asp:BoundField>
                    <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false"  DataField="BillToStreet" HeaderText="Bill To Street" SortExpression="BillToStreet"></asp:BoundField>
                    <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false"  DataField="BillToSuburb" HeaderText="Bill To Suburb" SortExpression="BillToSuburb"></asp:BoundField>
                    <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false" DataField="BillToMunicipality" HeaderText="Bill To Municipality" SortExpression="BillToMunicipality"></asp:BoundField>
                    <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false" DataField="BillToZipCode" HeaderText="Bill To ZipCode" SortExpression="BillToZipCode"></asp:BoundField>
                    <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false" DataField="BillToState" HeaderText="Bill To State" SortExpression="BillToState"></asp:BoundField>
                    <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false" DataField="BillToCountry" HeaderText="Bill To Country" SortExpression="BillToCountry"></asp:BoundField>
                    <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false"  DataField="ShipToStreet" HeaderText="Ship To Street" SortExpression="ShipToStreet"></asp:BoundField>
                    <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false" DataField="ShipToSuburb" HeaderText="Ship To Suburb" SortExpression="ShipToSuburb"></asp:BoundField>
                    <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false" DataField="ShipToMunicipality" HeaderText="Ship To Municipality" SortExpression="ShipToMunicipality"></asp:BoundField>
                    <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false" DataField="ShipToZipCode" HeaderText="Ship To ZipCode" SortExpression="ShipToZipCode"></asp:BoundField>
                    <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false" DataField="ShipToState" HeaderText="Ship To State" SortExpression="ShipToState"></asp:BoundField>
                    <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false" DataField="ShipToCountry" HeaderText="Ship To Country" SortExpression="ShipToCountry"></asp:BoundField>
                    <asp:BoundField HeaderStyle-Wrap="false" HeaderStyle-Width="200px" ItemStyle-Wrap="false" DataField="TermsPayment" HeaderText="Terms Payment" SortExpression="TermsPayment"></asp:BoundField>
                    <asp:BoundField DataField="Currency" HeaderText="Currency" SortExpression="Currency"></asp:BoundField>
                    <asp:BoundField ItemStyle-Wrap="false" ItemStyle-Width="200px" DataField="CreationDate" HeaderText="Creation Date" SortExpression="CreationDate"></asp:BoundField>
                    <asp:BoundField ItemStyle-Wrap="false" ItemStyle-Width="200px" DataField="ModifiedDate" HeaderText="Modified Date" SortExpression="ModifiedDate"></asp:BoundField>
                </Columns>
                    <PagerStyle CssClass="GridPager" />
        
        </asp:GridView>
    </div>
            <p></p>
            <div>
                Total:
                <asp:Label runat="server" ID="lblCount"></asp:Label>
            </div>
    

        </ContentTemplate>
    </asp:UpdatePanel>
        
    
    


    <%--<asp:SqlDataSource runat="server" ID="SMTBETECH_DS" 
        ConnectionString="<%$ ConnectionStrings:SMTBETECHConnectionString %>" 
        SelectCommand="SELECT * FROM [Customers] ORDER BY [Id]" 
        FilterExpression="CustomerName like '%{0}%'">
        
        <FilterParameters>
            <asp:ControlParameter ControlID="txtSearCustomer" PropertyName="Text" Name="paramCustomer"></asp:ControlParameter>
        </FilterParameters>    
    </asp:SqlDataSource>--%>

</asp:Content>
