<%@ Page language="c#" Codebehind="Supplier.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.Supplier" validateRequest="false"%>
<%@	Register TagPrefix="ftb" Namespace="FreeTextBoxControls" Assembly="FreeTextBox"	%>
<!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>Supplier</title>
		<script type="text/javascript" src="inc/Supplier.js"></script>
		<script type="text/javascript" src="inc/commond.js"></script>
		<script src="inc/ui.datepicker.cn.js" type="text/javascript"></script>
		<link type="text/css" rel="stylesheet" href="style/ui.datepicker.css" />
	</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="lbTitle" 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="100%" align="center" border="0">
				        <tr>
					        <td height="23" class="forumRowHighlight">
						        <asp:datagrid id="dgList" runat="server" AllowPaging="False" PagerStyle-Mode="NumericPages" AutoGenerateColumns="False"
							        DataKeyField="SupplierID" Width="100%" HorizontalAlign="Center" HeaderStyle-CssClass="summary-title">
							        <HeaderStyle Font-Bold="True" Height="20px"></HeaderStyle>
							        <Columns>
								        <asp:TemplateColumn HeaderText="商家编号">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Center" Width="8%"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "SupplierID") %>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:TemplateColumn HeaderText="商家名称">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="15%"></ItemStyle>
									        <ItemTemplate>
										        <a href="<%=webSite%>store/default.aspx?sid=<%# DataBinder.Eval(Container.DataItem, "SupplierID") %>" target="_blank"><%# DataBinder.Eval(Container.DataItem, "SupplierName") %></a>
									        </ItemTemplate>
								        </asp:TemplateColumn>
                                        <asp:TemplateColumn HeaderText="Logo">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Center" Width="12%"></ItemStyle>
									        <ItemTemplate>
										        <img src="../Upload/Supplier/<%# DataBinder.Eval(Container.DataItem, "SupplierID") %>/<%# DataBinder.Eval(Container.DataItem, "Logo") %>" width="30" />
									        </ItemTemplate>
								        </asp:TemplateColumn>
                                        <asp:TemplateColumn HeaderText="简单描述" Visible="false">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="15%"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "Description") %>
									        </ItemTemplate>
								        </asp:TemplateColumn>
                                        <asp:TemplateColumn HeaderText="地址">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="15%"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "Address") %>
									        </ItemTemplate>
								        </asp:TemplateColumn>
                                        <asp:TemplateColumn HeaderText="电话">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Left" Width="10%"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "Phone") %>
									        </ItemTemplate>
								        </asp:TemplateColumn>
                                        <asp:TemplateColumn HeaderText="联系人">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Center" Width="10%"></ItemStyle>
									        <ItemTemplate>
										        <%# DataBinder.Eval(Container.DataItem, "Contacter") %>
									        </ItemTemplate>
								        </asp:TemplateColumn>
                                        <asp:TemplateColumn HeaderText="修改">
									        <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									        <ItemStyle HorizontalAlign="Center"></ItemStyle>
									        <ItemTemplate>
										        <a href='Supplier.aspx?Action=Modify&SupplierID=<%# DataBinder.Eval(Container.DataItem, "SupplierID") %>'>修改</a>
									        </ItemTemplate>
								        </asp:TemplateColumn>
								        <asp:ButtonColumn  HeaderText="删除" Text="&lt;div id=&quot;de&quot; onclick=&quot;javascript:return confirm('确认删除吗？')&quot;&gt;删除&lt;/div&gt;"
									        CommandName="Delete">
									        <ItemStyle HorizontalAlign="Center"></ItemStyle>
								        </asp:ButtonColumn>
							        </Columns>
							        <PagerStyle Mode="NumericPages"></PagerStyle>
						        </asp:datagrid>
					        </td>
				        </tr>
			        </table>
                    <% }else{%>
		            <table class="tableBorder" id="Table2" cellSpacing="1" cellPadding="1" width="100%" align="center" border="0">
				        <tr>
					        <td>
						        <table class="ptable" cellspacing="0" cellpadding="0">
<%--                                    <tr>
								        <th class="tl">会员帐号：
								        </th>
								        <td class="tr"><asp:textbox id="txtMemberName" runat="server" Width="190" MaxLength="50"></asp:textbox><FONT color="red">*</FONT></td>
							        </tr>--%>
							        <tr>
								        <th class="tl">商家名称：
								        </th>
								        <td class="tr"><asp:textbox id="txtName" runat="server" MaxLength="50"></asp:textbox><FONT color="red">*</FONT></td>
							        </tr>
							        <tr>
					                    <th class="tl">商家密码：
					                    </th>
					                    <td class="tr"><asp:textbox id="txtPassword" runat="server"  MaxLength="50"></asp:textbox><FONT color="red">*此处非空将会重置密码
                                            </FONT></td>
				                    </tr>
				                    <tr>
					                    <th class="tl">密码(确认)：
					                    </th>
					                    <td class="tr"><asp:textbox id="txtPassword2" runat="server" MaxLength="50"></asp:textbox><FONT color="red">*</FONT></td>
				                    </tr>
							        <tr>
								        <th class="tl">截止时间：
								        </th>
								        <td class="tr"><asp:textbox id="txtExpireTime" runat="server" MaxLength="50"></asp:textbox><FONT color="red">*</FONT></td>
							        </tr>
							        <tr>
								        <th class="tl">所属分类：
								        </th>
								        <td class="tr"><asp:DropDownList  ID="ddlCategoryNo" runat="server" AutoPostBack=true
                                                onselectedindexchanged="ddlCategoryNo_SelectedIndexChanged">
                                            </asp:DropDownList><FONT color="red">*</FONT></td>
							        </tr>
							        
							        <tr>
								        <th class="tl">佣金比率：
								        </th>
								        <td class="tr"><asp:textbox id="txtRate" runat="server" MaxLength="50"></asp:textbox><FONT color="red">*</FONT></td>
							        </tr>
				                    <tr>
					                    <th class="tl">开户银行名称：
					                    </th>
					                    <td class="tr"><asp:textbox id="txtBankName" runat="server" Size="20" MaxLength="50"></asp:textbox></td>
				                    </tr>
				                    <tr>
					                    <th class="tl">银行账户名：
					                    </th>
					                    <td class="tr"><asp:textbox id="txtBankAccount" runat="server" Size="20" MaxLength="10"></asp:textbox></td>
				                    </tr>
				                    <tr>
					                    <th class="tl">银行账号：
					                    </th>
					                    <td class="tr"><asp:textbox id="txtBankNo" runat="server" Size="20" MaxLength="30"></asp:textbox></td>
				                    </tr>
				                    <tr>
					                    <th class="tl">开户银行所在地：
					                    </th>
					                    <td class="tr"><asp:textbox id="txtBankAddress" runat="server" Size="20" MaxLength="50"></asp:textbox></td>
				                    </tr>							        <tr>
								        <th class="tl">商家Banner：
								        </th>
								        <td class="tr"><input id="fileBanner" type="file" name="fileBanner" class="file" runat="server" size="20"/>
				                        <img  onload="this.width=this.width>200?200:this.width;" src="../upload/Supplier/<%=supplierInfo.SupplierID%>/<%=supplierInfo.Banner%>" />
                                        <span class="input-remark">(商家Banner的宽度为998px,高度152px)</span>
								        </td>
							        </tr>
							        <tr>
								        <th class="tl">Logo：
								        </th>
								        <td class="tr"><input id="fileLogo" type="file" name="fileLogo" class="file" runat="server" size="20"/>
				                        <img  onload="this.width=this.width>200?200:this.width;" src="../upload/Supplier/<%=supplierInfo.SupplierID%>/<%=supplierInfo.Logo%>" />
				                        <span class="input-remark">(商家Logo的宽度为100px)</span>
								        </td>
							        </tr>
			                        <tr>
				                        <th class="tl">店铺首页广告：
				                        </th>
				                        <td class="tr"><FTB:FREETEXTBOX id="ftbTopAD" runat="Server" Width="520" AutoConfigure="XpShopUI" ToolbarType="OfficeXP"
					                    ButtonPath="images/ftb/officeXP/" ButtonDownImage="True" ButtonOverImage="True"></FTB:FREETEXTBOX>
                                        <span class="input-remark">(顶部广告宽度为998px,高度自适应)</span>
                                        </td>
			                        </tr>
			                        <tr>
								        <th class="tl">简介：
								        </th>
								        <td class="tr"><FTB:FREETEXTBOX id="ftbContent" runat="Server"	Width="520"	ImageGalleryPath="Upload/" ToolbarType="OfficeXP"
									ButtonPath="images/ftb/officeXP/" ButtonDownImage="True" ButtonOverImage="True"></FTB:FREETEXTBOX></td>
							        </tr>
							        <tr>
								        <th class="tl">联系方式：
								        </th>
								        <td class="tr"><FTB:FREETEXTBOX id="ftbContact" runat="Server"	Width="520"	ImageGalleryPath="Upload/" ToolbarType="OfficeXP"
									ButtonPath="images/ftb/officeXP/" ButtonDownImage="True" ButtonOverImage="True"></FTB:FREETEXTBOX></td>
							        </tr>
							        <tr>
								        <th class="tl">地址：
								        </th>
								        <td class="tr"><asp:textbox id="txtAddress" runat="server" Width="190" MaxLength="80"></asp:textbox><FONT color="red">*</FONT>
									    </td>
							        </tr>
							        <tr>
								        <th class="tl">电话：
								        </th>
								        <td class="tr"><asp:textbox id="txtPhone" runat="server" Width="190" MaxLength="100"></asp:textbox><FONT color="red">*</FONT></td>
							        </tr>
							        <tr>
								        <th class="tl">联系人：
								        </th>
								        <td class="tr"><asp:textbox id="txtContacter" runat="server" Width="190" MaxLength="100"></asp:textbox><FONT color="red">*</FONT></td>
							        </tr>
							        <tr>
								        <th class="tl">备注：</th>
								        <td class="tr">
								            <asp:textbox id="txtRemark" runat="server" Width="190" MaxLength="100"></asp:textbox>
								        </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>
					        </td>
				        </tr>
			        </table>
                    <%}%>
		        </div>
	        </div>
		</form>
		</div>
		</div>
		</div>
	</body>
</HTML>
