<%@ Page language="c#" Codebehind="ProductPreferential.aspx.cs" AutoEventWireup="True" Inherits="DreamerShop.Admin.ProductPreferential" %>
<%@ Register TagPrefix="uc1" TagName="LanguagesDeal" Src="LanguagesDeal.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>
			<%=myLanguagesDeal.GetMyString("PreferentialTextTitle")%>
			-
			<%=mConfigInf.strWebTitle%>
		</title>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		<META content="<%=mConfigInf.strDescription%>" name=description>
		<META content="<%=mConfigInf.strKeywords%>" name=keywords>
		<LINK href="../StyleSheet1.css" rel="stylesheet">
		<SCRIPT language="javascript" id="clientEventHandlersJS">
		<!--


		function selall()
		{	
			var a = document.getElementsByTagName("input");
		
			var str;
			var len;
			var state;
			for (var i=0; i<a.length; i++)
			{
				if (a[i].type == "checkbox") 
				{
					str=a[i].id;
					len=str.lastIndexOf("ckSelAll");
					if((len * 1)>=1)
					{
						state=a[i].checked;
						break;
						}
				}
			}
			for (var i=0; i<a.length; i++)
			{
				if (a[i].type == "checkbox") 
				{
					str=a[i].id;
					len=str.lastIndexOf("ckSelItem");
					if((len * 1)>=1)
						a[i].checked=state;
				}
			}
		}
		
		function imgHelp_onclick() {
			popUpWin("DSHelp/ProductPreferential.htm","Help",100,100,800,600);
			}
			
		function popUpWin(URLStr,WinName, left, top, width, height)
		{
			var popUpWin=0;
			if(popUpWin)

			{

			if(!popUpWin.closed) popUpWin.close();

			}

			popUpWin = open(URLStr, WinName, 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
		}
		//-->
		</SCRIPT>
	</HEAD>
	<body MS_POSITIONING="GridLayout">
		<form id="Form1" method="post" runat="server">
			<uc1:LanguagesDeal id="myLanguagesDeal" runat="server" Visible="False"></uc1:LanguagesDeal>
			<TABLE cellSpacing="0" cellPadding="0" width="97%" border="0" align="center">
				<TR>
					<TD vAlign="top" align="center" height="100%">
						<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
							<TR>
								<TD vAlign="top" bgColor="#ffffff" height="100%"><FONT face="宋体">
										<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
											<TR>
												<TD class="p12black"><SPAN class="p9orange"><img src="IMAGES/icon_1.gif" width="12" height="11" align="absMiddle">&nbsp;<%=myLanguagesDeal.GetMyString("TextExtendSale")%>
														--&gt;<%=myLanguagesDeal.GetMyString("PreferentialTextTitle")%></SPAN> <IMG language="javascript" id="imgHelp1" style="CURSOR: pointer" onclick="return imgHelp_onclick()"
														alt='<%=myLanguagesDeal.GetMyString("TextHelp")%>' src="../Images/Admin/helpicon.gif"></TD>
												<TD></TD>
												<TD>
													<asp:ImageButton id="ibtDeleteAll" runat="server" ImageUrl="../Images/Admin/fb-delete.gif" onclick="ibtDeleteAll_Click"></asp:ImageButton><%=myLanguagesDeal.GetMyString("TextDeteleAll")%><!--删除所选--></TD>
											</TR>
										</TABLE>
									</FONT>
								</TD>
							</TR>
						</TABLE>
						<hr size="1" noshade>
						<table width="100%" border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td><%=myLanguagesDeal.GetMyString("PreferentialTitle")%><!--特惠标题--><asp:textbox id="txtPreferentialTitle" runat="server" MaxLength="100" CssClass="wenbenkuang"
										Width="150px"></asp:textbox></td>
								<td><%=myLanguagesDeal.GetMyString("PreferentialPrice")%><!--特惠价格--><asp:textbox id="txtPreferentialPrice" runat="server" CssClass="wenbenkuang" Width="40px"></asp:textbox>
									<asp:comparevalidator id="Comparevalidator5" runat="server" ControlToValidate="txtPreferentialPrice" ErrorMessage="请输入数字"
										Display="Dynamic" Type="Double" Operator="DataTypeCheck" ForeColor="#FF0000"></asp:CompareValidator></td>
								<td><%=myLanguagesDeal.GetMyString("PreferentialLimitMoney")%><!--最低消费--><asp:textbox id="txtPreferentialLimit" runat="server" CssClass="wenbenkuang" Width="40px"></asp:textbox>
									<asp:comparevalidator id="CompareValidator1" runat="server" ControlToValidate="txtPreferentialLimit" ErrorMessage="请输入数字"
										Display="Dynamic" Type="Double" Operator="DataTypeCheck" ForeColor="#FF0000"></asp:CompareValidator></td>
								<td><%=myLanguagesDeal.GetMyString("PreferentialMaxBuy")%><!--最多购买--><asp:textbox id="txtPreferentialMaxSum" runat="server" CssClass="wenbenkuang" Width="40px"></asp:textbox>
									<asp:comparevalidator id="Comparevalidator7" runat="server" ControlToValidate="txtPreferentialMaxSum"
										ErrorMessage="请输入数字" Display="Dynamic" Type="Integer" Operator="DataTypeCheck" ForeColor="#FF0000"></asp:CompareValidator></td>
							</tr>
							<tr>
								<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
										<tr>
											<td width="30"><%=myLanguagesDeal.GetMyString("PreferentialTextType")%><!--类型--></td>
											<td><asp:radiobuttonlist id="rblPreferentialSelType" runat="server" RepeatDirection="Horizontal">
													<asp:ListItem Value="0" Selected="true">多选</asp:ListItem>
													<asp:ListItem Value="1">单选</asp:ListItem>
												</asp:radiobuttonlist></td>
										</tr>
									</table>
								</td>
								<td><%=myLanguagesDeal.GetMyString("TextStartDateTime")%><!--启用时间--><asp:textbox id="txtPreferentialStart" runat="server" CssClass="wenbenkuang" Width="120px"></asp:textbox>
									<asp:regularexpressionvalidator id="Regularexpressionvalidator2" runat="server" ControlToValidate="txtPreferentialStart"
										ErrorMessage="请输入指定格式时间" Display="Dynamic" ValidationExpression="[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}" ForeColor="#FF0000"></asp:RegularExpressionValidator><asp:requiredfieldvalidator id="Requiredfieldvalidator3" runat="server" ControlToValidate="txtPreferentialStart"
										ErrorMessage="请输入启用时间" Display="Dynamic" ForeColor="#FF0000"></asp:requiredfieldvalidator></td>
								<td><%=myLanguagesDeal.GetMyString("TextEndTimeTime")%><!--截止时间--><asp:textbox id="txtPreferentialEnd" runat="server" CssClass="wenbenkuang" Width="120px"></asp:textbox>
									<asp:regularexpressionvalidator id="Regularexpressionvalidator3" runat="server" ControlToValidate="txtPreferentialEnd"
										ErrorMessage="请输入指定格式时间" Display="Dynamic" ValidationExpression="[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}" ForeColor="#FF0000"></asp:RegularExpressionValidator><asp:requiredfieldvalidator id="Requiredfieldvalidator4" runat="server" ControlToValidate="txtPreferentialEnd"
										ErrorMessage="请输入截止时间" Display="Dynamic" ForeColor="#FF0000"></asp:requiredfieldvalidator></td>
								<td><asp:button id="btSelJoin" runat="server" CssClass="go-wenbenkuang" Text="加入所选特惠商品" onclick="btSelJoin_Click"></asp:button></td>
							</tr>
						</table>
						<asp:datagrid id="dgList" runat="server" CssClass="table-shangxia" Width="100%" DataKeyField="ProductID"
							AutoGenerateColumns="False" AllowPaging="True">
							<HeaderStyle HorizontalAlign="Center" BackColor="#F1F1F1"></HeaderStyle>
							<Columns>
								<asp:BoundColumn DataField="ProductNumber" HeaderText="商品编号">
									<HeaderStyle></HeaderStyle>
									<ItemStyle HorizontalAlign="Center"></ItemStyle>
								</asp:BoundColumn>
								<asp:BoundColumn DataField="ProductName" HeaderText="商品名称">
									<HeaderStyle></HeaderStyle>
									<ItemStyle HorizontalAlign="Center"></ItemStyle>
								</asp:BoundColumn>
								<asp:BoundColumn DataField="Amount" HeaderText="库存">
									<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
									<ItemStyle HorizontalAlign="Center"></ItemStyle>
								</asp:BoundColumn>
								<asp:BoundColumn DataField="SaleAmount" HeaderText="销售">
									<HeaderStyle></HeaderStyle>
									<ItemStyle HorizontalAlign="Center"></ItemStyle>
								</asp:BoundColumn>
								<asp:BoundColumn DataField="ClickNum" HeaderText="浏览">
									<HeaderStyle></HeaderStyle>
									<ItemStyle HorizontalAlign="Center"></ItemStyle>
								</asp:BoundColumn>
								<asp:BoundColumn DataField="AddTime" HeaderText="上架时间">
									<HeaderStyle></HeaderStyle>
									<ItemStyle HorizontalAlign="Center"></ItemStyle>
								</asp:BoundColumn>
								<asp:TemplateColumn>
									<HeaderStyle></HeaderStyle>
									<HeaderTemplate>
										<asp:CheckBox id="ckSelAll" runat="server" onClick="selall()"></asp:CheckBox>
									</HeaderTemplate>
									<ItemStyle HorizontalAlign="Center"></ItemStyle>
									<ItemTemplate>
										<asp:CheckBox id="ckSelItem" runat="server"></asp:CheckBox>
									</ItemTemplate>
								</asp:TemplateColumn>
							</Columns>
							<PagerStyle Visible="False" NextPageText="下一页" PrevPageText="上一页" HorizontalAlign="Right"></PagerStyle>
						</asp:datagrid>
						<TABLE class="table-zuoyou" width="100%" align="center" border="0">
							<TR align="center" bgColor="#f1f1f1">
								<TD><asp:button id="btFirst" runat="server" CssClass="go-wenbenkuang" Text=" 首 页" BorderStyle="Groove" onclick="btFirst_Click"></asp:button>&nbsp;
									<asp:button id="btPre" runat="server" CssClass="go-wenbenkuang" Text="上一页" BorderStyle="Groove" onclick="btPre_Click"></asp:button>&nbsp;
									<asp:button id="btNext" runat="server" CssClass="go-wenbenkuang" Text="下一页" BorderStyle="Groove" onclick="btNext_Click"></asp:button>&nbsp;
									<asp:button id="btLast" runat="server" CssClass="go-wenbenkuang" Text=" 尾 页" BorderStyle="Groove" onclick="btLast_Click"></asp:button>&nbsp;
									<asp:label id="lbPage" runat="server"></asp:label>&nbsp;
									<%=myLanguagesDeal.GetMyString("TextGotoPage")%>
									<asp:textbox id="txtPageNum" runat="server" MaxLength="3" CssClass="wenbenkuang" Width="30px"></asp:textbox><asp:comparevalidator id="CompareValidator2" runat="server" ControlToValidate="txtPageNum" ErrorMessage="输入数字"
										Display="Dynamic" Type="Integer" Operator="DataTypeCheck" ForeColor="#FF0000"></asp:CompareValidator><%=myLanguagesDeal.GetMyString("TextPages")%>
									<asp:button id="btGo" runat="server" CssClass="go-wenbenkuang" Text="Go" onclick="btGo_Click"></asp:button></TD>
							</TR>
						</TABLE>
						<TABLE class="table-zuoyou" width="100%" align="center" border="0">
							<TR align="center">
								<TD><%=myLanguagesDeal.GetMyString("PreferentialTextMsg1")%><%=myLanguagesDeal.GetMyString("TextColonCharacter")%><!--根据商品编号或名称加入特惠商品，商品编号或名称：-->
									<asp:textbox id="txtProductNumber" runat="server" MaxLength="30" CssClass="wenbenkuang" Width="150px"></asp:textbox><asp:button id="btNumberJoin" runat="server" CssClass="go-wenbenkuang" Text="加入特惠商品" onclick="btNumberJoin_Click"></asp:button><asp:label id="lbNumberMSG" runat="server" ForeColor="Red"></asp:label></TD>
								<td><asp:button id="btSave" runat="server" CssClass="go-wenbenkuang" Text="保存所有特惠信息" onclick="btSave_Click"></asp:button></td>
							</TR>
						</TABLE>
						<asp:datagrid id="dgCorList" runat="server" CssClass="table-shangxia" Width="100%" DataKeyField="ProductID"
							AutoGenerateColumns="False" AllowPaging="False">
							<HeaderStyle HorizontalAlign="Center" BackColor="#F1F1F1"></HeaderStyle>
							<Columns>
								<asp:BoundColumn DataField="ProductNumber" HeaderText="商品编号">
									<ItemStyle HorizontalAlign="Center"></ItemStyle>
								</asp:BoundColumn>
								<asp:TemplateColumn HeaderText="特惠标题">
									<ItemStyle HorizontalAlign="Center"></ItemStyle>
									<ItemTemplate>
										<asp:TextBox id="txtItemPreferentialTitle" runat="server" Width="150px" CssClass="wenbenkuang" MaxLength="100" Text='<%# DataBinder.Eval(Container.DataItem, "PreferentialTitle")%>'>
										</asp:TextBox>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="特惠价格">
									<ItemStyle HorizontalAlign="Center"></ItemStyle>
									<ItemTemplate>
										<asp:TextBox id="txtItemPreferentialPrice" runat="server" Width="40px" CssClass="wenbenkuang" Text='<%# DataBinder.Eval(Container.DataItem, "PreferentialPrice")%>'>
										</asp:TextBox>
										<asp:CompareValidator id="Comparevalidator4" runat="server" Operator="DataTypeCheck" Type="Double" Display="Dynamic"
											ErrorMessage="请输入数字" ControlToValidate="txtItemPreferentialPrice" ForeColor="#FF0000"></asp:CompareValidator>
										<asp:RequiredFieldValidator id="Requiredfieldvalidator6" runat="server" Display="Dynamic" ErrorMessage="请输入特惠价格"
											ControlToValidate="txtItemPreferentialPrice" ForeColor="#FF0000"></asp:requiredfieldvalidator>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="最低消费">
									<ItemStyle HorizontalAlign="Center"></ItemStyle>
									<ItemTemplate>
										<asp:TextBox id="txtItemPreferentialLimit" runat="server" Width="40px" CssClass="wenbenkuang" Text='<%# DataBinder.Eval(Container.DataItem, "PreferentialLimit")%>'>
										</asp:TextBox>
										<asp:CompareValidator id="Comparevalidator3" runat="server" Operator="DataTypeCheck" Type="Double" Display="Dynamic"
											ErrorMessage="请输入数字" ControlToValidate="txtItemPreferentialLimit" ForeColor="#FF0000"></asp:CompareValidator>
										<asp:RequiredFieldValidator id="Requiredfieldvalidator2" runat="server" Display="Dynamic" ErrorMessage="请输入最低消费"
											ControlToValidate="txtItemPreferentialLimit" ForeColor="#FF0000"></asp:requiredfieldvalidator>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="最多购买">
									<ItemStyle HorizontalAlign="Center"></ItemStyle>
									<ItemTemplate>
										<asp:TextBox id="txtItemPreferentialMaxSum" runat="server" Width="40px" CssClass="wenbenkuang" Text='<%# DataBinder.Eval(Container.DataItem, "PreferentialMaxSum")%>'>
										</asp:TextBox>
										<asp:CompareValidator id="Comparevalidator6" runat="server" Operator="DataTypeCheck" Type="Integer" Display="Dynamic"
											ErrorMessage="请输入数字" ControlToValidate="txtItemPreferentialMaxSum" ForeColor="#FF0000"></asp:CompareValidator>
										<asp:RequiredFieldValidator id="Requiredfieldvalidator7" runat="server" Display="Dynamic" ErrorMessage="请输入最多购买"
											ControlToValidate="txtItemPreferentialMaxSum" ForeColor="#FF0000"></asp:requiredfieldvalidator>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="类型">
									<ItemStyle HorizontalAlign="Center"></ItemStyle>
									<ItemTemplate>
										<asp:RadioButtonList id="rblItemPreferentialSelType" runat="server" RepeatDirection="Horizontal" SelectedIndex='<%# DataBinder.Eval(Container.DataItem, "PreferentialSelType")%>'>
											<asp:ListItem Value="0">多选</asp:ListItem>
											<asp:ListItem Value="1">单选</asp:ListItem>
										</asp:RadioButtonList>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="启用时间">
									<ItemStyle HorizontalAlign="Center"></ItemStyle>
									<ItemTemplate>
										<asp:TextBox id="txtItemPreferentialStart" runat="server" Width="120px" CssClass="wenbenkuang" Text='<%# DataBinder.Eval(Container.DataItem, "PreferentialStart")%>'>
										</asp:TextBox>
										<asp:RegularExpressionValidator id="RegularExpressionValidator1" runat="server" ErrorMessage="请输入指定格式时间" Display="Dynamic"
											ControlToValidate="txtItemPreferentialStart" ValidationExpression="[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}" ForeColor="#FF0000"></asp:RegularExpressionValidator>
										<asp:RequiredFieldValidator id="Requiredfieldvalidator1" runat="server" Display="Dynamic" ErrorMessage="请输入时间"
											ControlToValidate="txtItemPreferentialStart" ForeColor="#FF0000"></asp:requiredfieldvalidator>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="截止时间">
									<ItemStyle HorizontalAlign="Center"></ItemStyle>
									<ItemTemplate>
										<asp:TextBox id="txtItemPreferentialEnd" runat="server" Width="120px" CssClass="wenbenkuang" Text='<%# DataBinder.Eval(Container.DataItem, "PreferentialEnd")%>'>
										</asp:TextBox>
										<asp:RegularExpressionValidator id="Regularexpressionvalidator4" runat="server" ErrorMessage="请输入指定格式时间" Display="Dynamic"
											ControlToValidate="txtItemPreferentialEnd" ValidationExpression="[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}" ForeColor="#FF0000"></asp:RegularExpressionValidator>
										<asp:RequiredFieldValidator id="Requiredfieldvalidator5" runat="server" Display="Dynamic" ErrorMessage="请输入时间"
											ControlToValidate="txtItemPreferentialEnd" ForeColor="#FF0000"></asp:requiredfieldvalidator>
									</ItemTemplate>
								</asp:TemplateColumn>
								<asp:TemplateColumn HeaderText="操作">
									<ItemStyle HorizontalAlign="Center"></ItemStyle>
									<ItemTemplate>
										<asp:Button id="btDelete" Text="删除" CssClass="go-wenbenkuang" CommandName="Delete" Runat="server"></asp:Button>
									</ItemTemplate>
								</asp:TemplateColumn>
							</Columns>
							<PagerStyle Visible="False" NextPageText="下一页" PrevPageText="上一页" HorizontalAlign="Right"></PagerStyle>
						</asp:datagrid><asp:label id="lbMsg" runat="server" ForeColor="Red"></asp:label></TD>
				</TR>
			</TABLE>
		</form>
	</body>
</HTML>
