<%@ page language="C#" enableeventvalidation="false" masterpagefile="MyShopMasterPage.master" autoeventwireup="true" inherits="Shop_Member_Shop_ManageOrder, WebApp_deploy" title="订单列表" %>  
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> 
<script src="../Js/checkBox.js" type="text/javascript">

</script> 
<div class="pageTitle">商家订单管理</div>
<br />
    <table class="SearchTableStyle">
        <tr>
            <td>付款状态：</td>
            <td><asp:DropDownList ID="DroPayStatic" runat="server" AutoPostBack="True" OnSelectedIndexChanged="search">
                    <asp:ListItem Value="">所有状态</asp:ListItem>
                    <asp:ListItem Value="0">等待付款</asp:ListItem>
                    <asp:ListItem Value="1">已付定金</asp:ListItem>
                    <asp:ListItem Value="2">已经付清</asp:ListItem>
                </asp:DropDownList>
                </td>
            <td>物流状态：</td>
            <td><asp:DropDownList ID="DropDeliverStatus" runat="server" AutoPostBack="True" OnSelectedIndexChanged="search">
                    <asp:ListItem Value="">所有状态</asp:ListItem>
                    <asp:ListItem Value="0">等待发货</asp:ListItem>
                    <asp:ListItem Value="1">已发货</asp:ListItem>
                    <asp:ListItem Value="2">已签收</asp:ListItem>
                    <asp:ListItem Value="4">交易取消</asp:ListItem>
                </asp:DropDownList></td>
            <td>订单状态：</td>
            <td><asp:DropDownList ID="DroOrderStatic" runat="server" AutoPostBack="True" OnSelectedIndexChanged="search">
                    <asp:ListItem Value="">所有状态</asp:ListItem>
                    <asp:ListItem Value="0">等待确认</asp:ListItem>
                    <asp:ListItem Value="1">已经确认</asp:ListItem>
                    <asp:ListItem Value="2">交易失败</asp:ListItem>
                </asp:DropDownList></td>
        </tr>
        <tr>
            <td>订单编号：</td>
            <td><asp:TextBox ID="TxtOrderNum" runat="server" Height="16px"/></td>
            <td>起始日期：</td>
            <td><asp:TextBox ID="TxtBeginDate" runat="server" Height="16px"/></td>
            <td>结束日期：</td>
            <td><asp:TextBox ID="TxtEndDate" runat="server" Height="16px"/></td>
            
        </tr>
        <tr>
            <td>买家名称：</td>
            <td><asp:TextBox ID="TxtCusName" runat="server" Height="16px"/></td>
            <td>金额从：</td>
            <td><asp:TextBox ID="TxtBeginMoney" runat="server" Height="16px"/></td>
            <td>至：</td>
            <td><asp:TextBox ID="TxtEndMoney" runat="server" Height="16px"/></td>
            
        </tr>
        <tr>
            <td>商品名称：</td>
            <td><asp:TextBox ID="TxtProductName" runat="server" Height="16px"/></td>    
            <td colspan="4">&nbsp;&nbsp;<asp:Button ID="QuickSearchButton" runat="server" Text=" 查 询 " OnClick="search" /></td>
                   
        </tr>
        </table>
        <br />
        <table class="SearchTableStyle">
        <tr><td>
        你现在查看的是：<asp:DropDownList ID="DropMoment" runat="server"  AutoPostBack="True" OnSelectedIndexChanged="search">
                <asp:ListItem Value="1">今天的订单</asp:ListItem>
                <asp:ListItem Value="10">近十天的订单</asp:ListItem>
                <asp:ListItem Value="30">近一个月的订单</asp:ListItem>
                <asp:ListItem Value="">所有订单</asp:ListItem>
            </asp:DropDownList></td></tr>
         </table>
         <br />         
         
         <asp:GridView ID="GridView1"  runat="server" AutoGenerateColumns="False" ForeColor="Black" AllowPaging="True" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" DataKeyNames="OrderFormID" CssClass="tableHead">
             <Columns>
                <asp:TemplateField>
                     <ItemTemplate>
                        <asp:CheckBox ID="CheckBox1" runat="server"  />
                     </ItemTemplate> 
                     <ItemStyle Width="4%" />                        
                 </asp:TemplateField>
                <asp:HyperLinkField DataNavigateUrlFields="OrderFormNum" DataNavigateUrlFormatString="shop_buyorder.aspx?OrderFormNum={0}" DataTextField="OrderFormNum" HeaderText="编号" >
                    <HeaderStyle Width="15%" />
                </asp:HyperLinkField>
                <asp:TemplateField HeaderText="购买产品">
                    <ItemTemplate>
                         <div style="width:100%; overflow:hidden;"><asp:HyperLink ID="ProductName" NavigateUrl='<%# "../ShowProduct.aspx?ProductID="+Eval("ProductID") %>' Target="_blank" ToolTip='<%# Eval("ProductName") %>' Text='<%# Eval("ProductName") %>' runat="server" /></div>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="类型">
                    <ItemTemplate>
                         <asp:Literal ID="TradeType" Text='<%# HoWave.Web.Shop.TextFormat.GetProductType(Eval("TradeType").ToString()) %>' runat="server" />
                    </ItemTemplate>
                    <HeaderStyle Width="7%" />
                </asp:TemplateField>
                <asp:BoundField DataField="InputTime" DataFormatString="{0:yy-MM-dd}" HeaderText="时间" >
                    <HeaderStyle Width="13%" />
                </asp:BoundField>
                <asp:BoundField DataField="MoneyTotal" HeaderText="金额" >
                    <HeaderStyle Width="7%" />
                </asp:BoundField>
                <asp:BoundField DataField="MoneyReceipt" HeaderText="已收金额" >
                    <HeaderStyle Width="9%" />
                </asp:BoundField>                       
                <asp:TemplateField HeaderText="订单状态">
                    <ItemTemplate>
                       <asp:Label ID="Status_lable" runat="server" Text='<%# HoWave.Web.Shop.TextFormat.GetOrderStatus(Eval("Status").ToString()) %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle Width="8%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="付款状态">
                    <HeaderStyle Width="8%" />
                    <ItemTemplate>
                        <asp:Label ID="PayStatus_lable" runat="server" Text='<%# HoWave.Web.Shop.TextFormat.GetPayStatus(Eval("PayStatus").ToString()) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="物流状态">
                    <HeaderStyle Width="8%" />
                    <ItemTemplate>
                        <asp:Label ID="DeliverStatus_lable" runat="server" Text='<%# HoWave.Web.Shop.TextFormat.GetDeliverStatus(Eval("DeliverStatus").ToString()) %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="操作"> 
                  <ItemTemplate>
                      <asp:HyperLink ID="xx" runat="server" Text="详细" NavigateUrl='<%# "Shop_BuyOrder.aspx?OrderFormNum="+Eval("OrderFormNum") %>' />
                  </ItemTemplate>
                <ItemStyle Width="6%" />
                </asp:TemplateField> 
              </Columns>
              <EmptyDataTemplate>        <table class="tableHeader" style="width:98%"><tr><th>编号</th><th>购买产品</th><th>类型</th><th>时间</th><th>金额</th><th>已收金额</th><th>订单状态</th><th>付款状态</th><th>物流状态</th><th>操作</th>
                    <tr><td colspan="10">没有符合查询条件的记录！</td></tr>
                    </table></EmptyDataTemplate>
              <PagerStyle CssClass="productPageStyle" />
      </asp:GridView> 
      
                <div style="clear:both; width:98%; text-align:center; margin-top:10px;">
                    <input type="button" value=" 全 选 "  onclick="check_all();"/>
                    <input type="button" value=" 反 选 " onclick="check_rev();"/>
                    <asp:Button ID="Button5" runat="server" OnClick="Button5_Click" Text=" 删 除 " OnClientClick="return confirm('确认删除所选订单吗？')"/>
                </div>
                
        
</asp:Content>

