<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs"
   Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
   <title>Transactions</title>
</head>
<body>
   <form id="form1" runat="server">
   <div>
      <asp:GridView
      ID="OrdersGridView"
      runat="server"
      CellPadding="4"
      ForeColor="#333333"
      GridLines="None"
      DataKeyNames="OrderID"
      AutoGenerateColumns="False"
      PagerSettings-Mode="Numeric"
      AllowPaging="true"
      PageSize="5"
      OnSelectedIndexChanged="OnSelectedIndexChangedHandler"
      OnPageIndexChanging="OrdersGridView_PageIndexChanging" >
         <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
         <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
         <PagerStyle BackColor="#284775"
            ForeColor="White" HorizontalAlign="Center" />
         <SelectedRowStyle BackColor="#E2DED6"
            Font-Bold="True" ForeColor="#333333" />
         <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
         <EditRowStyle BackColor="#999999" />
         <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
         <Columns>
            <asp:ButtonField ButtonType="Button"
               CommandName="Select" Text="Szczegy" />
            <asp:BoundField DataField="OrderID" HeaderText="ID zamwienia" />
            <asp:BoundField DataField="OrderDate" HeaderText="Data zamwienia" />
            <asp:BoundField DataField="CompanyName" HeaderText="Firma" />
            <asp:BoundField DataField="ContactTitle" HeaderText="Kontakt" />
            <asp:BoundField DataField="Phone" HeaderText="Telefon" />
            <asp:BoundField DataField="ShipperName" HeaderText="Sprzeda poprzez" />
         </Columns>
      </asp:GridView>
      <asp:Panel ID="OrderDetailsPanel" runat="server"
         Height="50px" Width="125px">
            <asp:GridView
            ID="DetailsGridView"
            runat="server"
            AutoGenerateColumns="False"
            BackColor="LightGoldenrodYellow"
            BorderColor="Tan"
            BorderWidth="1px"
            CellPadding="2"
            ForeColor="Black"
            GridLines="None">
               <FooterStyle BackColor="Tan" />
               <Columns>
                  <asp:BoundField DataField="OrderDate"
                     HeaderText="Data zamwienia" />
                  <asp:BoundField DataField="ProductName" HeaderText="Produkt" />
                  <asp:BoundField DataField="UnitPrice" HeaderText="Cena" />
                  <asp:BoundField DataField="Quantity" HeaderText="Ilo" />
               </Columns>
               <PagerStyle BackColor="PaleGoldenrod"
                  ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
               <SelectedRowStyle BackColor="DarkSlateBlue"
                  ForeColor="GhostWhite" />
               <HeaderStyle BackColor="Tan" Font-Bold="True" />
               <AlternatingRowStyle BackColor="PaleGoldenrod" />
            </asp:GridView>
      </asp:Panel>
      &nbsp;<br />
      <h3>
         &nbsp; Umie nowe zamwienie</h3>
      <asp:Table ID="tblAddOrder" runat="server">
         <asp:TableRow>
            <asp:TableCell>Klient:</asp:TableCell>
            <asp:TableCell>
               <asp:DropDownList
               ID="ddlCustomer"
               DataValueField="CustomerID"
               DataTextField="CompanyName"
               runat="server"
               Width="160" />
            </asp:TableCell>
            <asp:TableCell>Sprzeda poprzez:</asp:TableCell>
            <asp:TableCell>
               <asp:DropDownList
               ID="ddlShipper"
               DataValueField="ShipperID"
               DataTextField="CompanyName"
               runat="server"
               Width="120" />
            </asp:TableCell>
            <asp:TableCell>Produkt:</asp:TableCell>
            <asp:TableCell>
               <asp:DropDownList
               ID="ddlProduct"
               DataValueField="ProductID"
               DataTextField="ProductName"
               runat="server"
               Width="160px" />
            </asp:TableCell>
         </asp:TableRow>

         <asp:TableRow>
            <asp:TableCell>Cena jednostkowa:</asp:TableCell>
            <asp:TableCell>
               <asp:TextBox ID="txtUnitPrice" runat="server" Width="48px" />
            </asp:TableCell>
            <asp:TableCell>Ilo:</asp:TableCell>
            <asp:TableCell>
               <asp:TextBox ID="txtQuantity" runat="server" Width="48px" />
            </asp:TableCell>
            <asp:TableCell>Rabat:</asp:TableCell>
            <asp:TableCell>
               <asp:TextBox ID="txtDiscount" runat="server" Width="48px" />
            </asp:TableCell>
         </asp:TableRow>
         <asp:TableRow>
         <asp:TableCell ColumnSpan="4">
            <asp:RadioButtonList
            ID="rbTransactionType"
            runat="server"
            RepeatDirection="Horizontal">
               <asp:ListItem Value="DB" Selected="true">
                  Transakcja bazy danych</asp:ListItem>
               <asp:ListItem Value="Connection">
                  Transakcja na podstawie poczenia</asp:ListItem>
            </asp:RadioButtonList>
         </asp:TableCell>
         <asp:TableCell>
            <asp:Button
            ID="btnAdd"
            runat="server"
            Text="Dodaj"
            OnClick="btnAdd_Click"/>
         </asp:TableCell>
         <asp:TableCell>
            <asp:Label ID="lblNewOrderID" runat="server" Text="" />
         </asp:TableCell>
      </asp:TableRow>
   </asp:Table>

   </div>
   </form>
</body>
</html>
