<%@ 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">
        &nbsp;&nbsp;<asp:Literal ID="ltrProType" runat="server"></asp:Literal>商家订单管理</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="-1">已退货 </asp:ListItem>
                    <asp:ListItem Value="-2">退货完毕</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:ListItem Value="4">交易取消</asp:ListItem>
                    <asp:ListItem Value="5">等待评价</asp:ListItem>
                    <asp:ListItem Value="6">已评价</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="3" Selected="True">近3天的订单</asp:ListItem>
                    <asp:ListItem Value="10">近十天的订单</asp:ListItem>
                    <asp:ListItem Value="30">本月的订单</asp:ListItem>
                    <asp:ListItem Value="0">所有订单</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
    </table>
    <br />
    <asp:Repeater ID="rptOrderInfo" runat="server">
        <ItemTemplate>
            <table class="ShopOrderStyle" style="text-align: center; margin-bottom: 6px;" id="tab_Repeater">
                <caption>
                    <asp:HiddenField ID="hfTradeTypeID" runat="server" Value='<%#Eval("TradeType")%>' />
                    类型：<%# HoWave.Web.Shop.TextFormat.GetProductType(Eval("TradeType").ToString())%>&nbsp;&nbsp;订单编号：<span><a
                        href='<%# "shop_buyorder.aspx?OrderFormNum="+Eval("OrderFormNum") %>'>
                        <%#Eval("OrderFormNum") %><asp:HiddenField ID="hfOrderFormID" runat="server" Value='<%#Eval("OrderFormID") %>' />
                        <asp:HiddenField ID="hfOrderFormNum" runat="server" Value='<%#Eval("OrderFormNum") %>' />
                    </a></span>&nbsp;&nbsp;下单时间：<span><%# Eval("InputTime") == DBNull.Value ? "" : Eval("InputTime")%></span>&nbsp;&nbsp;买家：<%# Eval("BuyerName")%>
                </caption>
                <asp:Repeater ID="rptOrderItem" runat="server">
                    <ItemTemplate>
                        <tr class="ShopProductOrderStyle">
                            <td style="width: 106px; height: 100px;">
                                <asp:Image ID="Product_Image" runat="server" ImageUrl='<%# (Convert.ToString(Eval("ProductSmallImageUrl"))==""?"../Images/show_nopic.gif":"../"+Eval("ProductSmallImageUrl").ToString()) %>'
                                    Height="100px" Width="100px" />
                            </td>
                            <td style="text-align: left; vertical-align: top; width: 30%;">
                                <asp:HiddenField ID="hfPoductID" runat="server" Value='<%#Eval("ProductID") %>' />
                                <asp:HyperLink ID="lbl_Name" NavigateUrl='<%# "../ShowProduct.aspx?ProductID="+Eval("ProductID") %>'
                                    runat="server" Text='<%# Eval("ProductName") %>' Target="_blank" />
                                <br />
                                <asp:Literal ID="Literal1" runat="server" Text='<%#Eval("GuiGe").ToString()=="" ?  "" : "规格："+Eval("GuiGe").ToString()%>' />
                            </td>
                            <td style="width: 100px">
                                <asp:HiddenField ID="hfOldPrice" runat="server" Value='<%#Eval("StandPrice") %>' />
                                <asp:HiddenField ID="hfNeedPresentExp" runat="server" Value='<%# Eval("NeedPresentExp") %>' />
                                <asp:Literal ID="ltr_PriceOrScore" runat="server" Text='<%# Eval("Price") %>' />
                                <asp:Literal ID="ltr_OldPrice" runat="server"></asp:Literal>
                            </td>
                            <td style="width: 10%">
                                <asp:Literal ID="lbl_Quantity" runat="server" Text='<%# Eval("Quantity") %>' />
                                <asp:HiddenField ID="hfitemCount" runat="server" Value='<%# Eval("itemCount") %>' />
                                <asp:HiddenField ID="hfOrderStatus" runat="server" Value='<%# Eval("Status") %>' />
                                <asp:HiddenField ID="hfPayStatus" runat="server" Value='<%# Eval("PayStatus") %>' />
                                <asp:HiddenField ID="hfDeliverStatus" runat="server" Value='<%# Eval("DeliverStatus") %>' />
                            </td>
                            <asp:Panel ID="pnlRowspan" runat="server">
                                <td rowspan='<%#Eval("itemCount") %>'>
                                    订单状态：<asp:HyperLink ID="hlStatus" runat="server" Text='<%# HoWave.Web.Shop.TextFormat.GetOrderStatus(Eval("Status").ToString(),HoWave.Web.Shop.TextFormat.GetReceived(Eval("OrderFormID").ToString())) %>' />
                                    <br />
                                    付款状态：<asp:Label ID="PayStatus_lable" runat="server" Text='<%# HoWave.Web.Shop.TextFormat.GetPayStatus(Eval("PayStatus").ToString()) %>'></asp:Label>
                                    <br />
                                    物流状态：<asp:HyperLink ID="hlDeliverStatus" runat="server" Text='<%# HoWave.Web.Shop.TextFormat.GetDeliverStatus(Eval("DeliverStatus").ToString()) %>'
                                        NavigateUrl='<%# "shop_buyorder.aspx?OrderFormNum="+Eval("OrderFormNum") %>' />
                                </td>
                                <td rowspan='<%#Eval("itemCount") %>' style="width: 120px;">
                                    <a href='<%# "shop_buyorder.aspx?OrderFormNum="+Eval("OrderFormNum") %>'>查看详情</a><br />
                                    <asp:Label ID="lblComment" runat="server" Text='<%#StrCommentStatus(Eval("OrderFormNum").ToString()) %>'></asp:Label>
                                    <br />
                                    <asp:Button ID="btnOrderStatus" runat="server" Visible="false" Text="确认" PostBackUrl='<%# "~/Member/Shop_BuyOrder.aspx?OrderFormNum="+Eval("OrderFormNum") %>'>
                                    </asp:Button>
                                    <asp:Button ID="btnDelOrder" runat="server" Visible="false" CommandName="DelOrder"
                                        CommandArgument='<%# Eval("OrderFormID") %>' OnCommand="Button_Command" Text="删除"
                                        OnClientClick="return confirm('确认删除所选订单吗？')" />
                                    <br />
                                    <asp:Button ID="btnDeliverStatus" runat="server" Visible="false" Text="发货" PostBackUrl='<%# "~/Member/Shop_AddOrderSend.aspx?DeliverType=0&OrderFormNum="+Eval("OrderFormNum") %>'>
                                    </asp:Button><br />
                                    <asp:Button ID="BtnAgreedReturn" runat="server" Visible="false" CommandName="AgreedReturn"
                                        CommandArgument='<%# Eval("OrderFormID") %>' OnCommand="Button_Command" Text="同意退货" />
                                </td>
                            </asp:Panel>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </table>
        </ItemTemplate>
    </asp:Repeater>
    <div style="text-align: center">
        <asp:Literal ID="ltrPagePanel" runat="server"></asp:Literal>
    </div>
    <div>
        <br />
        &nbsp;&nbsp;说明：到订单详情页检查订单信息，信息无误后确认订单
    </div>
    <script type="text/javascript">
        function onConfirm(orderNum) {
            if (confirm("到订单详情页检查订单信息，信息无误后确认订单？")) {
                location.href = "Shop_BuyOrder.aspx?OrderFormNum=" + orderNum;
            }
        }
    </script>
</asp:Content>
