<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Admin.Master" CodeBehind="OpenSeason.aspx.vb" Inherits="RGBC_Forecast.OpenSeason" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<fieldset>
  <legend>Start a new Open Season</legend>
  <table style="width:1000px;" class="" border="0">
    <tr>      
      <td align="left" valign="top" width="20%">
        <table style="width:100%;" class="" border="0" cellpadding="2">
          <tr>
            <td width=""></td>
          </tr>
          <tr>
            <td></td>
          </tr>
        </table>          
      </td comment=col1>
      
      <td align="left" valign="top" width="30%">
        <asp:Calendar ID="calDateStart" runat="server" Caption="Start Date">
          <SelectedDayStyle BackColor="#7F0206" />
          <WeekendDayStyle ForeColor="#333333" />
          <TodayDayStyle BorderColor="#7F0206" BorderStyle="Solid" BorderWidth="1px" />
        </asp:Calendar>
      </td comment='col2'>
      
      <td align="left" valign="top" width="40%">
        <asp:Calendar ID="calDateEnd" runat="server" Caption="End Date">
          <SelectedDayStyle BackColor="#7F0206" />
          <WeekendDayStyle ForeColor="#333333" />
          <TodayDayStyle BorderColor="#7F0206" BorderStyle="Solid" BorderWidth="1px" />
        </asp:Calendar><br />
        <asp:Button ID="btnSet" runat="server" Text="Add New" /></td></tr>        
      </td comment='col3'>
    </tr>
  </table>
</fieldset>
<br />
  <asp:Label ID="lblMessage" runat="server" CssClass="boxError"></asp:Label>
<br />
  <asp:GridView ID="gvOpenSeason" runat="server" CellPadding="2" 
    CssClass="gridviewDefault" Caption="Planned Seasons" AllowPaging="True" 
    AutoGenerateColumns="False" DataKeyNames="OpenSeasonID" 
    DataSourceID="sdsOpenSeason" PageSize="25" Width="1000px">
    <Columns>
      <asp:BoundField DataField="OpenSeasonID" HeaderText="OpenSeasonID" 
        InsertVisible="False" ReadOnly="True" SortExpression="OpenSeasonID" 
        Visible="False" />
      <asp:BoundField DataField="Brand" HeaderText="Brand" ReadOnly="True" 
        SortExpression="Brand" />
      <asp:BoundField DataField="Start Date" HeaderText="Start Date" 
        SortExpression="Start Date">
      <ItemStyle HorizontalAlign="Right" />
      </asp:BoundField>
      <asp:BoundField DataField="End Date" HeaderText="End Date" 
        SortExpression="End Date">
      <ItemStyle HorizontalAlign="Right" />
      </asp:BoundField>
      <asp:BoundField DataField="Last User" HeaderText="Last User" 
        SortExpression="Last User" />
      <asp:BoundField DataField="Last Edit" HeaderText="Last Edit" 
        SortExpression="Last Edit">
      <ItemStyle HorizontalAlign="Right" />
      </asp:BoundField>
      <asp:CommandField ShowDeleteButton="True">
      <ItemStyle HorizontalAlign="Center" />
      </asp:CommandField>
    </Columns>
  </asp:GridView>
  <asp:SqlDataSource ID="sdsOpenSeason" runat="server" 
    ConnectionString="<%$ ConnectionStrings:SuperbowlConnectionString %>" 
    DeleteCommand="DELETE FROM mstOpenSeason WHERE (OpenSeasonID = @OpenSeasonID)" 
    SelectCommand="SELECT mstOpenSeason.OpenSeasonID, CASE WHEN refBrandID = 0 THEN '- All -' ELSE strBrand END AS Brand, mstOpenSeason.strDateStart AS [Start Date], mstOpenSeason.strDateEnd AS [End Date], mstOpenSeason.strLastUser AS [Last User], mstOpenSeason.strLastEdit AS [Last Edit] FROM mstBrand RIGHT OUTER JOIN mstOpenSeason ON mstBrand.BrandID = mstOpenSeason.refBrandID ORDER BY [Start Date] DESC, [End Date] DESC, mstBrand.strBrand DESC">
    <DeleteParameters>
      <asp:Parameter Name="OpenSeasonID" />
    </DeleteParameters>
  </asp:SqlDataSource>
</asp:Content>
