<%@ Page Language="vb" MasterPageFile="~/Admin.Master" AutoEventWireup="false" CodeBehind="BrandList.aspx.vb" Inherits="Stock_Control.BrandList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
    <table style="width:100%;" cellpadding="2">
    <tr>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td align="center" class="headings" colspan="3">
            Brands List</td>
    </tr>
    <tr>
        <td>
            &nbsp;</td>
        <td>
            <asp:Label ID="lblMessage" CssClass="redBold" runat="server" Text=""></asp:Label>&nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td align="right">
            Brand: </td>
        <td>
            <asp:TextBox ID="txtBrand" runat="server"></asp:TextBox>
        </td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td align="right">
            <Show:/></td>
        <td>
            <asp:DropDownList ID="ddlStatus" runat="server" AutoPostBack="True" Visible="false">
							<asp:ListItem Value="-1">-All-</asp:ListItem>
							<asp:ListItem Value="1">Active</asp:ListItem>
							<asp:ListItem Value="0">Inactive</asp:ListItem>
						</asp:DropDownList>
				</td>
        <td>
            <asp:Button ID="btnSearch" runat="server" Text="Search" />
        </td>
    </tr>
    <tr>
        <td align="right">
            &nbsp;</td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        
        <td align="center" colspan="3">
<asp:GridView ID="gvBrand" runat="server" AutoGenerateColumns="False" 
                DataSourceID="sdsBrand" AllowPaging="True"  BorderColor="#CCCCCC"
                AllowSorting="True" PageSize="20" Width="100%" DataKeyNames="BrandID" 
						CellPadding="2">
                <Columns>
                    <asp:HyperLinkField DataNavigateUrlFields="BrandID" 
                        DataNavigateUrlFormatString="BrandDetails.aspx?BID={0}" 
                        DataTextField="strBrand" HeaderText="Brand" 
                        NavigateUrl="~/BrandDetails.aspx" SortExpression="strBrand" 
											ItemStyle-HorizontalAlign="Left" >
											
<ItemStyle HorizontalAlign="Left"></ItemStyle>
											
										</asp:HyperLinkField>
                    <asp:BoundField DataField="intLeadMonths" HeaderText="Number of Lead Months" 
                        SortExpression="intLeadMonths" ItemStyle-HorizontalAlign="Right" >

<ItemStyle HorizontalAlign="Right"></ItemStyle>

										</asp:BoundField>
										<asp:BoundField DataField="dblVariance" HeaderText="Target Variance" 
											SortExpression="dblVariance">
											<ItemStyle HorizontalAlign="Right" />
										</asp:BoundField>
                    <asp:CommandField ShowDeleteButton="True" HeaderText="Delete" 
											ItemStyle-HorizontalAlign="Center" >

<ItemStyle HorizontalAlign="Center"></ItemStyle>

										</asp:CommandField>
                </Columns>
                <PagerStyle CssClass="red" />
                <HeaderStyle BorderColor="White" CssClass="lightgrey" VerticalAlign="Middle" />
                <AlternatingRowStyle CssClass="lightergrey" />
            </asp:GridView>

        </td>
        
    </tr>
    <tr><td></td>
        <td>
            &nbsp;</td>
        <td>
            <asp:Button ID="btnAdd" runat="server" Text="Add Brand" />
        </td>
        </tr>
</table>
            <asp:SqlDataSource ID="sdsBrand" runat="server" 
                ConnectionString="<%$ ConnectionStrings:csStockControl %>" 
                DeleteCommand="UPDATE mstBrand SET blnActive = 0 WHERE (BrandID = @BrandID)" 
                SelectCommand="SELECT mstBrand.* FROM mstBrand ORDER BY strBrand">
                <DeleteParameters>
                    <asp:ControlParameter Name="BrandID" ControlID="gvBrand" PropertyName="SelectedValue" />
                </DeleteParameters>
                <FilterParameters>
                    <asp:ControlParameter ControlID="txtBrand" DefaultValue="" Name="strBrand" PropertyName="Text" />
                		<asp:Parameter DefaultValue="1" Name="blnActive" />
                </FilterParameters>
            </asp:SqlDataSource>
</asp:Content>
