<%@ Page language="c#" Codebehind="Agent.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.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/jquery.form.js"></script>
        <script src="inc/jquery.validate.js" type="text/javascript"></script>
	    <script src="inc/messages_cn.js" type="text/javascript"></script>
	    <script src="inc/Agent.js" type="text/javascript"></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" />
		<% 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:DropDownList ID="ddlSearch" runat="server">
                                        <asp:ListItem Value="0">选择搜索条件</asp:ListItem>
                                        <asp:ListItem Value="1">会员帐号</asp:ListItem>
                                        <asp:ListItem Value="2">推广员名称</asp:ListItem>
                                       <%-- <asp:ListItem Value="3">推广员等级</asp:ListItem>--%>
                                    </asp:DropDownList>
                                    <asp:TextBox ID="txtKeyword" runat="server"></asp:TextBox>                                    
                                    <asp:Button ID="btnSearch" OnClick="btnSearch_Click" runat="server" Text="搜索" CssClass="inputbtn"></asp:Button>
                                </span>
                                <span style="width:260px;"></span>
                                <asp:Button ID="btnExcel" OnClick="btnExcel_Click" runat="server" Text="导出到Excel文件" CssClass="inputbtn"></asp:Button>
                                <asp:Button ID="btnUpdate" OnClick="btnUpdate_Click" runat="server" Text="更新推广员的等级" CssClass="inputbtn"></asp:Button>
							</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" Width="100px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "AgentName") %>
									        </ItemTemplate>
								        </asp:TemplateColumn>						
								        <asp:TemplateColumn HeaderText="会员账号">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="80px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "MemberName")%>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="地址">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="150px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "AgentAddress")%>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="电话">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="100px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "AgentPhone")%>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="开户行">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="100px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "BankName")%>
									        </ItemTemplate>
								        </asp:TemplateColumn>	
								        <asp:TemplateColumn HeaderText="银行账号">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="100px"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "BankAccount")%>
									        </ItemTemplate>
								        </asp:TemplateColumn>								        
								        <asp:TemplateColumn HeaderText="下级会员">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="100"></ItemStyle>
									        <ItemTemplate>
										        <a href='AgentMember.aspx?mid=<%# DataBinder.Eval(Container.DataItem, "MemberID")%>&MemberName=<%# DataBinder.Eval(Container.DataItem, "MemberName")%>'>点击查看</a>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="状态">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="100"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "Status").ToString() == "1" ? "启用" : DataBinder.Eval(Container.DataItem, "Status").ToString() == "-1"?"禁用":"未处理"%>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="操作">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Center" Width="160px"></ItemStyle>
									        <ItemTemplate>
									             <a href="AgentDrawing.aspx?type=1&keyword=<%# DataBinder.Eval(Container.DataItem, "MemberName")%>">结算记录</a> 
                                                 <a  href="Agent.aspx?action=Modify&aid=<%# DataBinder.Eval(Container.DataItem, "AgentID")%>">修改</a>
                                                 <a  href="Agent.aspx?action=Delete&aid=<%# DataBinder.Eval(Container.DataItem, "AgentID")%>">删除</a>
									        </ItemTemplate>
								        </asp:TemplateColumn>
							        </Columns>
							        <PagerStyle Mode="NumericPages"></PagerStyle>
						        </asp:datagrid>
					        </td>
				        </tr>
			        </table>
			        <%}if(this.Request.QueryString["Action"] == "Add" | this.Request.QueryString["Action"] == "Modify"){%>
			        <table class="ptable" cellspacing="0" cellpadding="0">
				        <tr>
					        <th class="tl">
						        会员名：
					        </th>
					        <td class="tr">
						        <asp:TextBox id="txtMemberName" runat="server" TabIndex="1" Font-Size="11"></asp:TextBox>
						        <span id="nameNotExist" style="display:none;">此用户不存在,请重新输入</span>
						        <span id="nameIsAgent" style="display:none;">此用户已申请为推广员,请重新输入</span>
						        <em>*</em>请输入系统会员名称
					        </td>
				        </tr>
						<tr>
					        <th class="tl">
						        所属等级：
					        </th>
					        <td class="tr">
						        <asp:DropDownList id="ddlAgentLevel" name="ddlAgentLevel" runat="server" Width="130" TabIndex="2" Font-Size="11"></asp:DropDownList><em>*</em>
					        </td>
				        </tr>
<%--				        <tr>
				            <th class="tl">访问推广链接跳转到：</th>
				            <td class="tr"><asp:TextBox id="txtJumpUrl" runat="server"></asp:TextBox>如果跳转到首页，则不需要填</td>
				        </tr>--%>
				        <tr>
                            <th class="tl">姓名：</th>
                            <td class="tr">
                                <asp:TextBox id="txtAgentName"   runat="server" TabIndex="3" Font-Size="11"/><em>*</em>(必需填写真实信息)
                            </td>
                        </tr>
                        <tr>
                            <th class="tl">联系电话：</th>
                            <td class="tr">
                                <asp:TextBox id="txtAgentPhone"   runat="server" TabIndex="4" Font-Size="11"/>
                            </td>
                        </tr>
                        <tr>
                            <th class="tl">联系手机：</th>
                            <td class="tr">
                                <asp:TextBox id="txtAgentMobile"   runat="server" TabIndex="5" Font-Size="11"/>
                            </td>
                        </tr>
                        <tr>
                            <th class="tl">联系地址：</th>
                            <td class="tr">
                                <asp:TextBox id="txtAgentAddress"   runat="server" TabIndex="6" Font-Size="11"/><span style="color:#ccc;"></span>
                            </td>
                        </tr>
                        <tr>
                            <th class="tl">EMAIL：</th>
                            <td class="tr">
                                <asp:TextBox id="txtAgentEmail"   runat="server" TabIndex="7" Font-Size="11"/>
                            </td>
                        </tr>
                        <tr>
                            <th class="tl">访问推广链接跳转到：</th>
                            <td class="tr">
                                <asp:TextBox id="txtJumpUrl"   runat="server" TabIndex="8" Font-Size="11"/>(默认跳转到首页)
                            </td>
                        </tr>
                        <tr>
                            <th class="tl">QQ：</th>
                            <td class="tr">
                                <asp:TextBox id="txtAgentQQ"   runat="server" TabIndex="9" Font-Size="11" />
                            </td>
                        </tr>
                        <tr>
                            <th class="tl">MSN：</th>
                            <td class="tr">
                                <asp:TextBox id="txtAgentMSN"   runat="server" TabIndex="10" Font-Size="11"/>
                            </td>
                        </tr>
                        <tr>
                            <th class="tl">邮政编码：</th>
                            <td class="tr">
                                <asp:TextBox id="txtPostalcode"   runat="server" TabIndex="11" Font-Size="11"/>
                            </td>
                        </tr>
                        <tr>
                            <th class="tl">身份证号：</th>
                            <td class="tr">
                                <asp:TextBox  id="txtIDCartNo"    runat="server" TabIndex="12" Font-Size="11" />
                            </td>
                        </tr>
                        <tr>
                            <th class="tl">公司名称：</th>
                            <td class="tr">
                                <asp:TextBox id="txtCompanyName"   runat="server" TabIndex="13" Font-Size="11"/>
                            </td>
                        </tr>
                        <tr>
                            <th class="tl">网站名称：</th>
                            <td class="tr">
                                <asp:TextBox id="txtSiteName"   runat="server" TabIndex="14" Font-Size="11"/>
                            </td>
                        </tr>       
                        <tr>
                            <th class="tl">网站网址：</th>
                            <td class="tr">
                                <asp:TextBox id="txtSiteUrl"   runat="server" TabIndex="15" Font-Size="11"/>
                            </td>
                        </tr>          
                        <tr>
                        <th class="tl">网站类型：</th>
                            <td class="tr">
                            <asp:TextBox id="txtSiteType"   runat="server" TabIndex="16" Font-Size="11"/>
                        </td>
                        </tr>
                        <tr>
                            <th class="tl">网站简介：</th>
                            <td class="tr">
                                <asp:TextBox id="txtSiteAbstruct"   runat="server" TabIndex="17" Font-Size="11"/>
                            </td>
                        </tr>
                        <tr>
                        <th class="tl">账户名：</th>
                            <td class="tr">
                            <asp:TextBox id="txtAccountName" runat="server" TabIndex="18" Font-Size="11"/><em>*</em>(必需填写真实信息)
                        </td>
                        </tr>
                        <tr>
                        <th class="tl">账  号：</th>
                            <td class="tr">
                            <asp:TextBox id="txtBankAccount"   runat="server" TabIndex="19" Font-Size="11"/><em>*</em>(必需填写真实信息)
                            </td>
                        </tr>						        
				        <tr>
					        <th class="tl">
						        开户行：
					        </th>
					        <td class="tr">
					            <asp:TextBox id="txtBankName" runat="server" TabIndex="20" Font-Size="11"/><em>*</em>(必需填写真实信息)
					        </td>
				        </tr>
                        <tr>
					        <th class="tl">
						        推广链接：
					        </th>
					        <td class="tr">
					            <asp:TextBox id="txtAgentLink" runat="server" TabIndex="21" Font-Size="11" Width="500px"/>(自动生成)
					        </td>
				        </tr>					
				        <tr>
					        <th class="tl">
						        状态：
					        </th>
					        <td class="tr">
			                    <asp:RadioButtonList runat="server" ID="rblStatus" RepeatDirection="horizontal" TabIndex="22" Font-Size="11">
			                        <asp:ListItem Text="正常" Value="1" Selected="true"></asp:ListItem>
			                        <asp:ListItem Text="禁用" Value="-1"></asp:ListItem>
			                        <asp:ListItem Text="未处理" Value="0"></asp:ListItem>
			                    </asp:RadioButtonList>
                            </td>
				        </tr>
				        <tr>
					        <th class="tl"></th>
						    <td class="tr"><asp:Button id="btnSave" OnClick="btnSave_Click" runat="server" Text="保存" CssClass="inputbtn"></asp:Button>
						        <asp:Button id="btnCancel" OnClick="btnCancel_Click" runat="server" Text="取消" CausesValidation="False" CssClass="inputbtn"></asp:Button></td>
				        </tr>
			        </table>
			        <%}%>
		        </div>
	        </div>
		</form>
		</div>
		</div>
		</div>
	</body>
</html>
