<%@ Page language="c#" Codebehind="OrderList.aspx.cs" AutoEventWireup="false" Inherits="wqeshop.Admin.OrderList" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>OrderList</title>
		<LINK href="inc/style.css" type="text/css" rel="stylesheet">
		<style type="text/css">
body {margin:0px; height:768px}
</style>
			<script language="javascript">
			function ChangeManager(cid)
			{
				alret("haha");
			}
			function CheckDelBox(box)    
			{
					for (var i=0;i<document.Form1.elements.length;i++)
				{
					var e = document.Form1.elements[i];
					if ( (e.type=='checkbox') )
					{
			            
							var o=e.name.lastIndexOf('deleteCheckbox');
			                
							if(o!=-1)
							{
								e.checked = box.checked;
							}
			        
					}
				}
			}
			</script>
	</HEAD>
	<body>
		<form id="Form1" method="post" runat="server">
<table width="99%" height="550" style="border:1px #619ADF solid; border-left:0;margin-top:6px; margin-right:7px;background:#F2F7FD;" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top">
<div class="top1">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="tl"></td>
		<td class="tm"><span class="tt">后台管理 &gt;&gt;订单管理<asp:Label id="lblTitleInfo" runat="server"></asp:Label></span></td>
		<td class="tm2"><span class="tt"><a href="http://www.wangqi.com" target="_blank"><img src="Images/admin_help.gif" border="0" alt="帮助"></a></span></td>
		<td class="tr"></td>
	</tr>
</table>
</div>
<div class="mframe1">
<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="tl"></td>
		<td class="tm"><div class="tt">&nbsp; 订单管理</div></td>
		<td class="tr"></td>
	</tr>
</table>
<table width="780" border="0" cellspacing="0" cellpadding="0">
  <tr>
      <td class="ml"></td>
    <td  class="mm" align="left" valign="top">

<table width="100%"  cellspacing="0" cellpadding="0">
	<tr>
		<td class="ml1"></td>
		<td class="mm1">
<table cellSpacing="0" cellPadding="0" width="95%" align="center">
    <tr height="25">
	    <td align="right">关键字：</td>
	    <td><asp:dropdownlist id="ddlKeyType" Runat="server">
		    <asp:ListItem Selected="True" Value="OrderNo">订单号</asp:ListItem>
		    <asp:ListItem Value="Name">会员帐户</asp:ListItem>
		    </asp:dropdownlist><asp:textbox id="txtKeyword" CssClass="input" runat="server"></asp:textbox>
		</td>
	</tr>
	<tr height="25">
		<td align="right">订单状态：</td>
		<td><asp:dropdownlist id="ddlConfirmed" Runat="server">
			    <asp:ListItem Selected="True" Value="All">是否已确认</asp:ListItem>
			    <asp:ListItem Value="1">已确认</asp:ListItem>
			    <asp:ListItem Value="0">未确认</asp:ListItem>
			</asp:dropdownlist><asp:dropdownlist id="ddlPayed" Runat="server">
			    <asp:ListItem Selected="True" Value="All">是否已付款</asp:ListItem>
			    <asp:ListItem Value="2">已付款</asp:ListItem>
			    <asp:ListItem Value="0">未付款</asp:ListItem>
			</asp:dropdownlist>
			<asp:dropdownlist id="ddlShipped" Runat="server">
			    <asp:ListItem Selected="True" Value="All">是否已发货</asp:ListItem>
			    <asp:ListItem Value="2">已发货</asp:ListItem>
			    <asp:ListItem Value="0">未发货</asp:ListItem>
			</asp:dropdownlist><asp:dropdownlist id="ddlFinished" Runat="server">
				<asp:ListItem Selected="True" Value="All">是否已归档</asp:ListItem>
				<asp:ListItem Value="1">已归档</asp:ListItem>
				<asp:ListItem Value="0">未归档</asp:ListItem>
			</asp:dropdownlist><asp:dropdownlist id="ddlCancelled" Runat="server">
			    <asp:ListItem Selected="True" Value="All">是否已取消</asp:ListItem>
				<asp:ListItem Value="1">已取消</asp:ListItem>
				<asp:ListItem Value="0">未取消</asp:ListItem>
			</asp:dropdownlist>
		</td>
	</tr>
	<tr height="25">
		<td align="right">时间：</td>
		<td>从<asp:textbox id="txtDateFrom" CssClass="input" runat="server"></asp:textbox>到<asp:textbox id="txtDateTo" CssClass="input" runat="server"></asp:textbox>(请填写正确的时间格式,比如:2005/05/07,2008-5-7)</td>
	</tr>
	<tr height="25">
		<td align="right"></td>
		<td><asp:button id="btnSearch" CssClass="btn" runat="server" Text="搜索"></asp:button></td>
	</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="35">
	<asp:button id="btnUpdateManagers" runat="server" CssClass="btn1" Text="更新跟单员"></asp:button>
	<asp:Button id="btnDelete" runat="server"  CssClass="btn1" Text="删除订单"></asp:Button>&nbsp;&nbsp;&nbsp;<INPUT id="Hidden1" type="hidden" name="Hidden1" runat="server">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<asp:Button id="bt_print" runat="server"  CssClass="btn1" Text="打印订单"></asp:Button></td>
  </tr>
</table>
            <asp:datagrid id="dgOrderList" 
			    runat="server" 
				HeaderStyle-CssClass="summary-title" 
				HorizontalAlign="Center"
				Width="100%" 
				DataKeyField="OrderID" 
				AutoGenerateColumns="False" 
				PagerStyle-Mode="NumericPages"
				PageSize="10" 
				AllowPaging="True">
			<HeaderStyle Font-Bold="True" CssClass="summary-title"></HeaderStyle>
			<Columns>
			<asp:TemplateColumn>
			<ItemStyle HorizontalAlign="Center" Width="20"></ItemStyle>
			<HeaderTemplate>
			<input type="checkbox" id="checkDel" onClick="CheckDelBox(this)" />
			</HeaderTemplate>
			<ItemTemplate>
			<asp:CheckBox id="deleteCheckbox" runat="server" AutoPostBack="False"></asp:CheckBox>
			</ItemTemplate>
			</asp:TemplateColumn>
			<asp:TemplateColumn HeaderText="跟单员" ItemStyle-Width="60px">
			<ItemTemplate>
			<asp:DropDownList ID="ddlManagers" Runat="server"></asp:DropDownList>
			</ItemTemplate>
			</asp:TemplateColumn>
			<asp:TemplateColumn HeaderText="单号">
			<HeaderStyle HorizontalAlign="Left"></HeaderStyle>
			<ItemStyle HorizontalAlign="Left" Width="70"></ItemStyle>
			<ItemTemplate>
			<%# DataBinder.Eval(Container.DataItem, "OrderNo") %>
			</ItemTemplate>
			</asp:TemplateColumn>
			<asp:BoundColumn DataField="OrderTime" HeaderText="下订时间" DataFormatString="{0:d}">
			<ItemStyle HorizontalAlign="Center" Width="50px"></ItemStyle>
			</asp:BoundColumn>
			
			<asp:TemplateColumn HeaderText="实际应付款">
			<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
			<ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
			<ItemTemplate>
			<%# GetPay(DataBinder.Eval(Container.DataItem, "TotalPrice").ToString(),DataBinder.Eval(Container.DataItem, "AdvancePayment").ToString())%>
			</ItemTemplate>
			</asp:TemplateColumn>
			<asp:TemplateColumn HeaderText="配送方式">
			<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
			<ItemStyle HorizontalAlign="Center" Width="50px"></ItemStyle>
			<ItemTemplate>
			<%# GetShippingName(DataBinder.Eval(Container.DataItem, "ShippingType").ToString()) %>
			</ItemTemplate>
			</asp:TemplateColumn>
			<asp:TemplateColumn HeaderText="支付方式">
			<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
			<ItemStyle HorizontalAlign="Center" Width="50px"></ItemStyle>
			<ItemTemplate>
			<%# GetPaymentName(DataBinder.Eval(Container.DataItem, "PaymentType").ToString()) %>
			</ItemTemplate>
			</asp:TemplateColumn>
			<asp:TemplateColumn HeaderText="购物会员">
			<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
			<ItemStyle HorizontalAlign="Center" Width="40px"></ItemStyle>
			<ItemTemplate>
			<%# GetMemberName(DataBinder.Eval(Container.DataItem, "MemberID").ToString()) %>
			</ItemTemplate>
			</asp:TemplateColumn>
			<asp:TemplateColumn HeaderText="收货人">
			<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
			<ItemStyle HorizontalAlign="Center" Width="40px"></ItemStyle>
			<ItemTemplate>
			<%# DataBinder.Eval(Container.DataItem, "ReceiverName") %>
			</ItemTemplate>
			</asp:TemplateColumn>
			<asp:TemplateColumn HeaderText="联系电话">
			<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
			<ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
			<ItemTemplate>
			<%# DataBinder.Eval(Container.DataItem, "ReceiverPhone") %>
			</ItemTemplate>
			</asp:TemplateColumn>
			<asp:TemplateColumn HeaderText="订单状态">
			<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
			<ItemStyle HorizontalAlign="Center" Width="50px"></ItemStyle>
			<ItemTemplate>
			<%# GetStatus(DataBinder.Eval(Container.DataItem, "OrderID").ToString())%>
			</ItemTemplate>
			</asp:TemplateColumn>
			<asp:TemplateColumn>
			<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
			<ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
			<ItemTemplate>
			<a href='OrderModify.aspx?OrderID=<%# DataBinder.Eval(Container.DataItem, "OrderID") %>'>管理</a>
			</ItemTemplate>
			</asp:TemplateColumn>
			
			</Columns>
			<PagerStyle Mode="NumericPages"></PagerStyle>
			</asp:datagrid>
<TABLE id="tablePage" cellSpacing="0" cellPadding="0" width="100%" align="center">
	<TR>
		<TD vAlign="middle"><asp:label id="lblPager" Runat="server"></asp:label></TD>
		<TD vAlign="middle" align="right"><INPUT id="controlID" type="hidden" name="controlID" runat="server">
			<asp:textbox id="txtPage" Runat="server" Width="30px" BorderColor="Black" BackColor="White" BorderWidth="1px"></asp:textbox>&nbsp;&nbsp;
			<asp:button id="btnJump" Runat="server" Text=" Go "></asp:button>
		</TD>
	</TR>
</TABLE>
		</td>
		
		<td class="mr1"></td>
	</tr>
</table>

<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="bl"></td>
		<td class="bm">&nbsp;</td>
		<td class="br"></td>
	</tr>
</table>
</td>
    <td  class="mr"></td>
  </tr>
</table>
<table width="100%" align="center" cellspacing="0" cellpadding="0">
	<tr>
		<td class="bl"></td>
		<td class="bm">&nbsp;</td>
		<td class="br"></td>
	</tr>
</table>
</div>
    </td>
  </tr>
</table>
		</form>
	</body>
</HTML>
