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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
    <link href="images/StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <table width="98%" class="tableBorder" cellspacing="1" cellpadding="3" align="center" border="0">
      <tr>
              <td style="font-size:14px; color:#d6dff7; font-weight:bold; text-align: center;" class="tableHeaderText" height="25px">
              订单管理
               </td>
            </tr>
        <tr><td>
           用户名:
           <asp:TextBox runat="server" ID="usernametb"></asp:TextBox>
           订单状态:
           <asp:DropDownList runat="server" ID="stateddl" AutoPostBack="True" OnSelectedIndexChanged="stateddl_SelectedIndexChanged">
               <asp:ListItem Text="订单状态" Value="5"></asp:ListItem>
               <asp:ListItem Text="取消订单" Value="0"></asp:ListItem>
               <asp:ListItem Text="等待发货" Value="1"></asp:ListItem>
               <asp:ListItem Text="商家已发货" Value="2"></asp:ListItem>
               <asp:ListItem Text="确认收货" Value="3"></asp:ListItem>
               <asp:ListItem Text="完成交易" Value="4"></asp:ListItem>
           </asp:DropDownList>
           <asp:Button runat="server" ID="searchTb" Text="查询" OnClick="searchTb_Click" />
        
        
        <asp:GridView runat="Server" ID="orderlistgv" AllowPaging="True" AutoGenerateColumns="False" OnRowDataBound="orderlistgv_RowDataBound" Width="100%" OnRowCommand="orderlistgv_RowCommand" OnPageIndexChanging="orderlistgv_PageIndexChanging" PageSize="20">
            <Columns>
                <asp:TemplateField HeaderText="订单编号">
                    <ItemTemplate>
                        <asp:Label ID="orderidlabel" runat="server" Text='<%# Bind("orderid") %>'></asp:Label>
                        <asp:Label runat="server" ID="statecodelabel" Text='<%#Bind("state") %>' Visible="false"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="username" HeaderText="用户名" />
                <asp:BoundField DataField="ordertime" HeaderText="下单时间" />
                
                <asp:BoundField HeaderText="订单总额" DataField="orderprice" DataFormatString="{0:c}" />
                <asp:TemplateField HeaderText="订单状态">
                    <ItemTemplate>
                        <asp:Label ID="statelabel" runat="server"></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="delivery" HeaderText="送货方式" />
                <asp:BoundField DataField="payment" HeaderText="付款方式" />
                <asp:TemplateField HeaderText="查看订单">
                    <ItemTemplate>
                       <a title="查看订单" href='../Order_Detail.aspx?oid=<%#Eval("orderid") %>' target="_blank">
                          查看订单
                       </a>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="操作">
                   <ItemTemplate>
                      <asp:LinkButton runat="server" ID="operatelinkbutton" CommandName="operate"></asp:LinkButton>
                   </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <pagersettings FirstPageText="首页" LastPageText="尾页" Mode="NextPreviousFirstLast"
                NextPageText="下一页" PreviousPageText="上一页" />
            <pagerstyle HorizontalAlign="Center" />
        </asp:GridView>
        </td></tr>
        <tr>
              <td style="font-size:14px; color:#d6dff7; font-weight:bold;" class="tableHeaderText" height="25px">
               </td>
            </tr>
     </table>
    </form>
</body>
</html>
