<%@ Page language="c#" Codebehind="Agent.aspx.cs" AutoEventWireup="false" Inherits="XpShop.WebUI.Admin.Agent" %>
<!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>
	</head>
	<body>
	    <div class="container">
		<div class="sub_container">
		<div class="sub_container_title"><a href="../default.aspx" target="_blank">桌面</a><img src="images/admin_title.jpg" height=9px width=8px align="absmiddle" />
		<% if(this.Request.QueryString["Action"] == "Manage"){%>负责人管理<%}if(this.Request.QueryString["Action"] == "Add" | this.Request.QueryString["Action"] == "Modify"){%>代理添加<%}%></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">
			        <% if(this.Request.QueryString["Action"] == "Manage"){%>
			        <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">
                                        <asp:ListItem Value="0">选择搜索条件</asp:ListItem>
                                        <asp:ListItem Value="MemberName">会员帐户</asp:ListItem>
                                        <asp:ListItem Value="AgentNo">代理号</asp:ListItem>
                                    </asp:DropDownList>
                                    <asp:Button ID="btnSearch" runat="server" Text="GO"></asp:Button>
                                </span>
                                <span style="width:260px;"></span>
                                <span>
                                    <%=GetResourceString("Time")%>
                                    ：<%=GetResourceString("From")%>
                                    <asp:TextBox ID="txtDateFrom" runat="server" onmouseover="window.status='Date Picker';return true;"
                                        onmouseout="window.status='';return true;" onClick="javascript:show_calendar('Form1.txtDateFrom');"
                                        Width="100px"></asp:TextBox>
                                    <%=GetResourceString("To")%>
                                    <asp:TextBox ID="txtDateTo" runat="server" onmouseover="window.status='Date Picker';return true;"
                                        onmouseout="window.status='';return true;" onClick="javascript:show_calendar('Form1.txtDateTo');"
                                        Width="100px"></asp:TextBox>
                                    <asp:Button ID="btnExcel" runat="server" Text="导出到Excel文件"></asp:Button>
                                </span>
                            </td>
				        </tr>
				        <tr>
					        <td height="23" class="forumRowHighlight">
						        <asp:datagrid id="dgAgent" 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"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "MemberName") %>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="审批通过">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Center" Width="60px"></ItemStyle>
									        <ItemTemplate>
										        <a href='Actions.aspx?Action=ChangeAgent&AgentID=<%# DataBinder.Eval(Container.DataItem, "AgentID") %>&IsAgent=<%# DataBinder.Eval(Container.DataItem, "Status").ToString() == "1" ? "false" : "true" %><% if(Request.QueryString["AgentID"] != null){%>&SubAgentID=<%=Request.QueryString["AgentID"] %><%} %>'>
											        <img src='images/publish_<%# DataBinder.Eval(Container.DataItem, "Status") %>.png' border="0"/></a>
									        </ItemTemplate>
								        </asp:TemplateColumn>								
								        <asp:TemplateColumn HeaderText="代理号">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="80px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "AgentNo")%>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="地址">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="100px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "Address")%>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="电话">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "PhoneNumber")%>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="Email">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="100px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "Email")%>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="QQ">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Center"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "QQ")%>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="MSN">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "MSN")%>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="备注">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="150px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "Remark")%>
									        </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="30px"></ItemStyle>
									        <ItemTemplate>
										        <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>
			        <%}if(this.Request.QueryString["Action"] == "Add" | this.Request.QueryString["Action"] == "Modify"){%>
			        <table class="tableBorder" cellSpacing="0" cellPadding="0" width="98%" align="center" border="0">
				        <tr>
					        <td height="23">
						        <table class="tableBorder" cellSpacing="0" cellPadding="0" width="95%" align="center" border="0">
							        <tr>
								        <td align="right">
									        会员名：
								        </td>
								        <td>
									        <asp:TextBox id="txtMemberAccount" runat="server"></asp:TextBox><font color="red">*请输入系统会员名称</font>
								        </td>
							        </tr>
							        <tr>
								        <td align="right">
									        父级代理负责人：
								        </td>
								        <td>
									        <asp:DropDownList id="ddlParentAgent" runat="server"></asp:DropDownList>
								        </td>
							        </tr>
							        <tr>
								        <td align="right">
									        代理号：
								        </td>
								        <td>
									        <asp:TextBox id="txtAgentNo" runat="server"></asp:TextBox><font color="red">*</font>
								        </td>
							        </tr>
							        <tr>
							            <td align="right">链接地址：</td>
							            <td><asp:TextBox id="txtUrl" runat="server"></asp:TextBox>为空则链接到首页</td>
							        </tr>
							        <tr>
								        <td align="right">
									        地址：
								        </td>
								        <td>
									        <asp:TextBox id="txtAddress" runat="server"></asp:TextBox><font color="red">*</font>
								        </td>
							        </tr>
							        <tr>
								        <td align="right">
									        电话号码：
								        </td>
								        <td>
									        <asp:TextBox id="txtPhoneNo" runat="server"></asp:TextBox><font color="red">*</font>
								        </td>
							        </tr>
							        <tr>
								        <td align="right">
									        Email：
								        </td>
								        <td>
									        <asp:TextBox id="txtEmail" runat="server"></asp:TextBox>
								        </td>
							        </tr>
							        <tr>
								        <td align="right">
									        QQ：
								        </td>
								        <td>
									        <asp:TextBox id="txtQQ" runat="server"></asp:TextBox>
								        </td>
							        </tr>
							        <tr>
								        <td align="right">
									        MSN：
								        </td>
								        <td>
									        <asp:TextBox id="txtMSN" runat="server"></asp:TextBox>
								        </td>
							        </tr>
							        <tr>
								        <td align="right">
									        备注：
								        </td>
								        <td>
								            <asp:TextBox id="txtRemark" runat="server" Width="150px" Height="80px" TextMode="MultiLine"></asp:TextBox>
								        </td>
							        </tr>
							        <tr>
								        <td align="center" colspan="2"><br />
									        <asp:Button id="btnSave" runat="server" Text="保存"></asp:Button>
									        <asp:Button id="btnCancel" runat="server" Text="取消" CausesValidation="False"></asp:Button></td>
							        </tr>
						        </table>
					        </td>
				        </tr>
			        </table>
			        <%}%>
		        </div>
	        </div>
		</form>
		</div>
		</div>
		</div>
	</body>
</HTML>
