<%@ Page language="c#" Codebehind="AgentOrders.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.AgentOrders" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
	    <!--#include file="inc/head.inc"-->
		<title>Agent</title>
        <%--<script type="text/javascript" src="../inc/calendar.js"></script>--%>
        <script src="inc/ui.datepicker.cn.js" type="text/javascript"></script>
		<script src="inc/agent.js" type="text/javascript"></script>
        <link type="text/css" rel="stylesheet" href="style/ui.datepicker.css" />
        <script type="text/javascript">
        	$(document).ready(function(){
				$("#txtDateFrom").datepicker();
				$("#txtDateTo").datepicker();
			});
        </script>
	</head>
	<body>
	    <div class="container">
		<div class="sub_container">
		<div class="sub_container_title"><a href="<%=AdminDefault%>" target="_top">桌面</a><img src="images/admin_title.jpg" height=9px width=8px align="absmiddle" />
		查看订单</div>
		<div class="sub_container_content">
		<form id="Form1" method="post" runat="server">
		    <div class="frame">
		        <div class="frame_title"><asp:Label id="lblAction" runat="server" CssClass="tableHeaderText"></asp:Label></div>
		        <div class="frame_content">
			        <table class="tableBorder" cellspacing="0" cellpadding="0" width="98%" align="center" border="0">
				        <tr>
                            <td align="Left">
                                <span>搜索：
                                    <asp:TextBox ID="txtKeyword" runat="server"></asp:TextBox>
                                    <asp:DropDownList ID="ddlSearch" runat="server" style="display:none;">
                                        <asp:ListItem Value="0">选择搜索条件</asp:ListItem>
                                        <asp:ListItem Value="MemberName" Selected="true">会员帐户</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:Button ID="btnSearch" OnClick="btnSearch_Click" runat="server" Text="GO" CssClass="inputbtn"></asp:Button>
                                </span>
                                <span style="width:260px;"></span>
                                <span style="display:none">
                                    <%=GetResourceString("Time")%>
                                    ：<%=GetResourceString("From")%>
                                    <asp:textbox id="txtDateFrom" runat="server" style="height:18px;line-height:18px;background-image:url(images/calendar.gif);background-repeat:no-repeat;padding-left:20px;"></asp:textbox>
                                    <%=GetResourceString("To")%>
                                    <asp:textbox id="txtDateTo" runat="server" style="height:18px;line-height:18px;background-image:url(images/calendar.gif);background-repeat:no-repeat;padding-left:20px;"></asp:textbox>
                                    <asp:Button ID="btnExcel" OnClick="btnExcel_Click" runat="server" Text="导出到Excel文件" CssClass="inputbtn"></asp:Button>
                                </span>
                            </td>
				        </tr>
				        <tr>
					        <td height="23" class="forumRowHighlight">
						        <asp:datagrid id="dgList" runat="server" AllowPaging="False" PagerStyle-Mode="NumericPages" AutoGenerateColumns="False"
							        DataKeyField="AgentID" Width="100%" HorizontalAlign="Center" HeaderStyle-CssClass="summary-title">
							        <HeaderStyle Font-Bold="True"></HeaderStyle>
							        <Columns>
								        <asp:TemplateColumn HeaderText="会员帐号">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="100px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "MemberName") %>
									        </ItemTemplate>
								        </asp:TemplateColumn>						
								        <asp:TemplateColumn HeaderText="经销商身份">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="80px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "AgentLevelName")%>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="地址">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="150px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "Address")%>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="电话">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="100px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "Mobile")%>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="Email">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="150px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "Email")%>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="QQ">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Center" Width="100px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "QQ")%>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="MSN">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="150px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "MSN")%>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="备注">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="250px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "Remark")%>
									        </ItemTemplate>
								        </asp:TemplateColumn>
										<asp:TemplateColumn HeaderText="总业绩">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Center" Width="60px"></ItemStyle>
									        <ItemTemplate>
												<a href=""><%# GetAgentResults(DataBinder.Eval(Container.DataItem, "AgentID").ToString(),DataBinder.Eval(Container.DataItem, "AgentIdentify").ToString())%></a>
										    </ItemTemplate>
								        </asp:TemplateColumn>
								        <%--<asp:TemplateColumn HeaderText="查看业绩">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Center" Width="60px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "AgentIdentify").ToString() == "1" ? ("<a href=SubAchievements.aspx?MemberID=" + DataBinder.Eval(Container.DataItem, "MemberID") + "><u>下级业绩</u></a>") : ("<a href=Achievements.aspx?MemberID=" + DataBinder.Eval(Container.DataItem, "MemberID") + "><u>个人业绩</u></a>")%>
									        </ItemTemplate>
								        </asp:TemplateColumn>--%>
								        <asp:TemplateColumn HeaderText="下　级经销商">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Center" Width="50px"></ItemStyle>
									        <ItemTemplate>
												<%# (DataBinder.Eval(Container.DataItem, "subcount").ToString() != "0") ? ("<a href='Agent.aspx?Action=Manage&AgentID=" + DataBinder.Eval(Container.DataItem, "AgentID") + "'><u>查看</u></a>") : "--"%>
										    </ItemTemplate>
								        </asp:TemplateColumn>
								        <%--<asp:TemplateColumn>
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
									        <ItemTemplate>
										        <a href='Agent.aspx?Action=Modify&AgentID=<%# DataBinder.Eval(Container.DataItem, "AgentID")%>'>
											        修改</a>
									        </ItemTemplate>
								        </asp:TemplateColumn>	--%>							
								        <%--<asp:ButtonColumn Text="&lt;div id=&quot;de&quot; onclick=&quot;javascript:return confirm('确认删除吗？')&quot;&gt;删除&lt;/div&gt;"
									        CommandName="Delete">
									        <ItemStyle HorizontalAlign="Center" Width="30px"></ItemStyle>
								        </asp:ButtonColumn>--%>
							        </Columns>
							        <PagerStyle Mode="NumericPages"></PagerStyle>
						        </asp:datagrid>
					        </td>
				        </tr>
			        </table>
		        </div>
	        </div>
		</form>
		</div>
		</div>
		</div>
	</body>
</HTML>
