<%@ Page language="c#" Codebehind="VoucherManage.aspx.cs" AutoEventWireup="True" Inherits="DreamerShop.Admin.VoucherManage" %>
<%@ Register TagPrefix="uc1" TagName="LanguagesDeal" Src="LanguagesDeal.ascx" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>
			<%=myLanguagesDeal.GetMyString("TextVoucherManage")%>
			－<%=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/VoucherManage.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%" align="center" border="0">
				<tr>
					<td vAlign="top" height="262">
						<table cellSpacing="0" cellPadding="0" width="100%" border="0">
							<tr>
								<td vAlign="top" bgColor="#ffffff" height="300"><FONT face="宋体"><asp:panel id="Pan1" runat="server">
											<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
												<TR>
													<TD class="p12black"><SPAN class="p9orange"><IMG height="11" src="IMAGES/icon_1.gif" width="12" align="absMiddle">&nbsp;<%=myLanguagesDeal.GetMyString("TextExtendSale")%>--&gt;<%=myLanguagesDeal.GetMyString("TextVoucherManage")%></SPAN>
														<IMG language="javascript" id="imgHelp" style="CURSOR: pointer" onClick="return imgHelp_onclick()"
															src="../Images/Admin/helpicon.gif"></TD>
													<TD>
														<asp:ImageButton id="btAddNew" runat="server" ImageUrl="../Images/Admin/fb-new.gif" onclick="btAddNew_Click"></asp:ImageButton><%=myLanguagesDeal.GetMyString("VoucherTextAddNew")%></TD>
													<TD>
														<asp:ImageButton id="ibtDeleteAll" runat="server" ImageUrl="../Images/Admin/fb-delete.gif" onclick="ibtDeleteAll_Click"></asp:ImageButton><%=myLanguagesDeal.GetMyString("TextDeteleSelect")%></TD>
												</TR>
											</TABLE>
											<HR noShade SIZE="1">
											<TABLE cellSpacing="2" cellPadding="1" border="0">
												<TR>
													<TD>
														<asp:DropDownList id="drlFindKeyType" 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:ListItem Value="4">金额></asp:ListItem>
															<asp:ListItem Value="5">金额&lt;</asp:ListItem>
															<asp:ListItem Value="6">金额=</asp:ListItem>
														</asp:DropDownList>
														<asp:TextBox id="txtFindKey" runat="server" CssClass="wenbenkuang" Width="150px"></asp:TextBox></TD>
													<TD>
														<asp:DropDownList id="drlFindUsedType" runat="server">
															<asp:ListItem Value="0">全部</asp:ListItem>
															<asp:ListItem Value="1">未使用</asp:ListItem>
															<asp:ListItem Value="2">已使用</asp:ListItem>
														</asp:DropDownList></TD>
													<TD>
														<asp:Button id="btFind" runat="server" CssClass="go-wenbenkuang" Text=" 查 找 " onclick="btFind_Click"></asp:Button></TD>
												</TR>
											</TABLE>
											<asp:datagrid id="dgList" runat="server" CssClass="table-shangxia" Width="100%" AllowPaging="True"
												AutoGenerateColumns="False" DataKeyField="VoucherID">
												<HeaderStyle HorizontalAlign="Center" BackColor="#F1F1F1"></HeaderStyle>
												<Columns>
													<asp:BoundColumn DataField="VoucherTitle" HeaderText="VoucherTextFindKeyType2">
														<HeaderStyle></HeaderStyle>
														<ItemStyle HorizontalAlign="Center"></ItemStyle>
													</asp:BoundColumn>
													<asp:BoundColumn DataField="VoucherNum" HeaderText="VoucherTextNumber">
														<HeaderStyle></HeaderStyle>
														<ItemStyle HorizontalAlign="Center"></ItemStyle>
													</asp:BoundColumn>
													<asp:BoundColumn DataField="VoucherPass" HeaderText="VoucherTextPassWord">
														<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
														<ItemStyle HorizontalAlign="Center"></ItemStyle>
													</asp:BoundColumn>
													<asp:BoundColumn DataField="flVoucherMoney" HeaderText="VoucherTextMoney">
														<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
														<ItemStyle HorizontalAlign="Center"></ItemStyle>
													</asp:BoundColumn>
													<asp:BoundColumn DataField="OFTimes" HeaderText="VoucherTextOFTimes">
														<HeaderStyle></HeaderStyle>
														<ItemStyle HorizontalAlign="Center"></ItemStyle>
													</asp:BoundColumn>
													<asp:BoundColumn DataField="intUserCount" HeaderText="VoucherTextUseLimit">
														<HeaderStyle></HeaderStyle>
														<ItemStyle HorizontalAlign="Center"></ItemStyle>
													</asp:BoundColumn>
													<asp:BoundColumn DataField="intUseTime" HeaderText="VoucherTextUserUseLimit">
														<HeaderStyle></HeaderStyle>
														<ItemStyle HorizontalAlign="Center"></ItemStyle>
													</asp:BoundColumn>
													<asp:TemplateColumn HeaderText="TextOperation">
														<HeaderStyle></HeaderStyle>
														<ItemStyle HorizontalAlign="Center"></ItemStyle>
														<ItemTemplate>
															<asp:Button id="btDelete" Text="删除" CssClass="go-wenbenkuang" CommandName="Delete" Runat="server"></asp:Button>
														</ItemTemplate>
													</asp:TemplateColumn>
													<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" id="Table1" 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" CssClass="wenbenkuang" Width="30px" MaxLength="3"></asp:textbox>
														<asp:CompareValidator id="CompareValidator2" runat="server" Operator="DataTypeCheck" Type="Integer" ControlToValidate="txtPageNum"
															Display="Dynamic" ErrorMessage="输入数字" 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 width="100%" align="center" border="0">
												<TR align="center">
													<TD>
														<asp:LinkButton id="lkbToExcel" runat="server" Text="导出礼券到Excel" ForeColor="Red" onclick="lkbToExcel_Click"></asp:LinkButton></TD>
												</TR>
											</TABLE>
										</asp:panel>
									</FONT>
									<asp:panel id="Pan2" runat="server" Visible="False">
										<TABLE class="p9black" cellSpacing="0" cellPadding="0" width="100%" border="0">
											<TR>
												<TD>
													<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
														<TR>
															<TD class="p12black" align="left"><SPAN class="p9orange"><IMG height="11" src="IMAGES/icon_1.gif" width="12" align="absMiddle">&nbsp;<%=myLanguagesDeal.GetMyString("TextExtendSale")%>--&gt;
																	<asp:Label id="lbMessage" runat="server"></asp:Label></SPAN><IMG language="javascript" id="imgHelp" style="CURSOR: pointer" onClick="return imgHelp_onclick()"
																	src="../Images/Admin/helpicon.gif"></TD>
															<TD align="right" width="50"><!--BUTTON_BEGIN-->
																<TABLE>
																	<TR>
																		<TD vAlign="bottom" noWrap>
																			<asp:ImageButton id="ibtReturn" runat="server" ImageUrl="../Images/Admin/fb-cancel.gif" CausesValidation="False" onclick="ibtReturn_Click"></asp:ImageButton><%=myLanguagesDeal.GetMyString("TextReturn")%></TD>
																	</TR>
																</TABLE> <!--BUTTON_END--></TD>
														</TR>
													</TABLE>
												</TD>
											</TR>
										</TABLE>
										<HR noShade SIZE="1">
										<TABLE cellSpacing="1" cellPadding="5" width="720" align="center" bgColor="#cccccc" border="0">
											<TR bgColor="#ffffff">
												<TD align="right"><%=myLanguagesDeal.GetMyString("TextStartDateTime")%><%=myLanguagesDeal.GetMyString("TextColonCharacter")%><!--启用时间：--></TD>
												<TD class="pad">
													<asp:TextBox id="txtStartTime" runat="server" CssClass="wenbenkuang"></asp:TextBox>(<%=myLanguagesDeal.GetMyString("TextFormat")%><%=myLanguagesDeal.GetMyString("TextColonCharacter")%>yyyy-mm-dd 
													hh:mm:ss)
													<asp:RegularExpressionValidator id="RegularExpressionValidator1" runat="server" ControlToValidate="txtStartTime"
														Display="Dynamic" ErrorMessage="请输入指定格式时间" ValidationExpression="[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}" ForeColor="#FF0000"></asp:RegularExpressionValidator></TD>
											</TR>
											<TR bgColor="#ffffff">
												<TD align="right"><%=myLanguagesDeal.GetMyString("TextEndTimeTime")%><%=myLanguagesDeal.GetMyString("TextColonCharacter")%><!--结束时间：--></TD>
												<TD class="pad">
													<asp:TextBox id="txtEndTime" runat="server" CssClass="wenbenkuang"></asp:TextBox>(<%=myLanguagesDeal.GetMyString("TextFormat")%><%=myLanguagesDeal.GetMyString("TextColonCharacter")%>yyyy-mm-dd 
													hh:mm:ss)
													<asp:RegularExpressionValidator id="Regularexpressionvalidator2" runat="server" ControlToValidate="txtEndTime" Display="Dynamic"
														ErrorMessage="请输入指定格式时间" ValidationExpression="[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}" ForeColor="#FF0000"></asp:RegularExpressionValidator></TD>
											</TR>
											<TR bgColor="#ffffff">
												<TD align="right" width="25%"><%=myLanguagesDeal.GetMyString("VoucherTextMoney")%><%=myLanguagesDeal.GetMyString("TextColonCharacter")%><!--礼券金额：--></TD>
												<TD class="pad" width="75%">
													<asp:TextBox id="txtMoney" runat="server" CssClass="wenbenkuang" Width="100px" MaxLength="20"
														EnableViewState="False"></asp:TextBox>
													<asp:RequiredFieldValidator id="Requiredfieldvalidator6" runat="server" ControlToValidate="txtMoney" Display="Dynamic"
														ErrorMessage="请输入礼券金额" ForeColor="#FF0000"></asp:requiredfieldvalidator>
													<asp:CompareValidator id="Comparevalidator6" runat="server" Operator="DataTypeCheck" Type="Double" ControlToValidate="txtMoney"
														Display="Dynamic" ErrorMessage="请输入数字" ForeColor="#FF0000"></asp:CompareValidator></TD>
											</TR>
											<TR bgColor="#ffffff">
												<TD align="right" width="25%"><%=myLanguagesDeal.GetMyString("VoucherTextLimit")%><%=myLanguagesDeal.GetMyString("TextColonCharacter")%><!--最低消费要求：--></TD>
												<TD class="pad" width="75%">
													<asp:TextBox id="txtOFLimit" runat="server" CssClass="wenbenkuang" Width="100px" MaxLength="20"
														EnableViewState="False"></asp:TextBox>
													<asp:RequiredFieldValidator id="Requiredfieldvalidator5" runat="server" ControlToValidate="txtOFLimit" Display="Dynamic"
														ErrorMessage="请输入最低消费要求" ForeColor="#FF0000"></asp:requiredfieldvalidator>
													<asp:CompareValidator id="CompareValidator5" runat="server" Operator="DataTypeCheck" Type="Double" ControlToValidate="txtOFLimit"
														Display="Dynamic" ErrorMessage="请输入数字" ForeColor="#FF0000"></asp:CompareValidator></TD>
											</TR>
											<TR bgColor="#ffffff">
												<TD align="right" width="25%"><%=myLanguagesDeal.GetMyString("VoucherTextPasswordKey")%><%=myLanguagesDeal.GetMyString("TextColonCharacter")%><!--密码Key：--></TD>
												<TD class="pad" width="75%">
													<asp:TextBox id="txtVoucherKey" runat="server" CssClass="wenbenkuang" Width="100px" MaxLength="20"
														EnableViewState="False"></asp:TextBox>
													<asp:RequiredFieldValidator id="RequiredFieldValidator1" runat="server" ControlToValidate="txtVoucherKey" Display="Dynamic"
														ErrorMessage="请输入密码Key" ForeColor="#FF0000"></asp:requiredfieldvalidator></TD>
											</TR>
											<TR bgColor="#ffffff">
												<TD align="right" width="25%"><%=myLanguagesDeal.GetMyString("VoucherTextAmount")%><%=myLanguagesDeal.GetMyString("TextColonCharacter")%><!--礼券数量：--></TD>
												<TD class="pad" width="75%">
													<asp:TextBox id="txtCount" runat="server" CssClass="wenbenkuang" Width="100px" MaxLength="4"
														EnableViewState="False"></asp:TextBox>
													<asp:CompareValidator id="CompareValidator1" runat="server" Operator="DataTypeCheck" Type="Integer" ControlToValidate="txtCount"
														Display="Dynamic" ErrorMessage="请输入礼券数量" ForeColor="#FF0000"></asp:CompareValidator>
													<asp:RequiredFieldValidator id="RequiredFieldValidator2" runat="server" ControlToValidate="txtCount" Display="Dynamic"
														ErrorMessage="请输入礼券数量" ForeColor="#FF0000"></asp:requiredfieldvalidator></TD>
											</TR>
											<TR bgColor="#ffffff">
												<TD align="right" width="25%"><%=myLanguagesDeal.GetMyString("VoucherTextUseLimit")%><%=myLanguagesDeal.GetMyString("TextColonCharacter")%><!--一券可使用人数：--></TD>
												<TD class="pad" width="75%">
													<asp:TextBox id="txtUserCount" runat="server" CssClass="wenbenkuang" Width="100px" MaxLength="20"
														EnableViewState="False"></asp:TextBox>(<%=myLanguagesDeal.GetMyString("VoucherTextExplainMsg1")%>)
													<asp:RequiredFieldValidator id="RequiredFieldValidator3" runat="server" ControlToValidate="txtUserCount" Display="Dynamic"
														ErrorMessage="请输入可使用人数" ForeColor="#FF0000"></asp:requiredfieldvalidator>
													<asp:CompareValidator id="CompareValidator3" runat="server" Operator="DataTypeCheck" Type="Integer" ControlToValidate="txtUserCount"
														Display="Dynamic" ErrorMessage="请输入整数" ForeColor="#FF0000"></asp:CompareValidator></TD>
											</TR>
											<TR bgColor="#ffffff">
												<TD align="right" width="25%"><%=myLanguagesDeal.GetMyString("VoucherTextUserUseLimit")%><%=myLanguagesDeal.GetMyString("TextColonCharacter")%><!--一一人可使用次数：--></TD>
												<TD class="pad" width="75%">
													<asp:TextBox id="txtUseTime" runat="server" CssClass="wenbenkuang" Width="100px" MaxLength="20"
														EnableViewState="False"></asp:TextBox>(<%=myLanguagesDeal.GetMyString("VoucherTextExplainMsg1")%>)
													<asp:CompareValidator id="CompareValidator4" runat="server" Operator="DataTypeCheck" Type="Integer" ControlToValidate="txtUseTime"
														Display="Dynamic" ErrorMessage="请输入一人可使用次数" ForeColor="#FF0000"></asp:CompareValidator>
													<asp:RequiredFieldValidator id="RequiredFieldValidator4" runat="server" ControlToValidate="txtUseTime" Display="Dynamic"
														ErrorMessage="请输入整数" ForeColor="#FF0000"></asp:requiredfieldvalidator></TD>
											</TR>
											<TR bgColor="#ffffff">
												<TD align="right"><%=myLanguagesDeal.GetMyString("VoucherTextPassWordLength")%><%=myLanguagesDeal.GetMyString("TextColonCharacter")%><!--排序号：--></TD>
												<TD class="pad">
													<asp:textbox id="txtPassLen" runat="server" CssClass="wenbenkuang" Width="50px" MaxLength="2"></asp:textbox>
													<asp:CompareValidator id="cpvPassLen" runat="server" Operator="DataTypeCheck" Type="Integer" ControlToValidate="txtPassLen"
														Display="Dynamic" ErrorMessage="请输入整数" ForeColor="#FF0000"></asp:CompareValidator></TD>
											</TR>
											<TR bgColor="#ffffff">
												<TD align="right"><%=myLanguagesDeal.GetMyString("VoucherTextFindKeyType2")%><%=myLanguagesDeal.GetMyString("TextColonCharacter")%><!--标题：--></TD>
												<TD class="pad">
													<asp:textbox id="txtTitle" runat="server" CssClass="wenbenkuang" Width="200px" MaxLength="50"></asp:textbox></TD>
											</TR>
											<TR bgColor="#ffffff">
												<TD align="right"><%=myLanguagesDeal.GetMyString("VoucherTextUseProductArea")%><%=myLanguagesDeal.GetMyString("TextColonCharacter")%><!--位置：--></TD>
												<TD class="pad" width="540">
													<asp:DropDownList id="drlProductArea" runat="server" AutoPostBack="True" onselectedindexchanged="drlProductArea_SelectedIndexChanged">
														<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:Panel id="PanAreaID" runat="server" Visible="False">
														<TABLE border="0">
															<TR>
																<TD>
																	<asp:ListBox id="lbLeft" runat="server" CssClass="wenbenkuang" Width="221px" Height="208px" SelectionMode="Multiple"></asp:ListBox></TD>
																<TD vAlign="middle" align="center">
																	<TABLE width="100" align="center" border="0">
																		<TR>
																			<TD align="center">
																				<asp:Button id="btAreaJoin" runat="server" CssClass="go-wenbenkuang" Text=" 添加 >> " CausesValidation="False" onclick="btAreaJoin_Click"></asp:Button><BR>
																				<BR>
																			</TD>
																		</TR>
																		<TR>
																			<TD align="center">
																				<asp:Button id="btAreaDelete" runat="server" CssClass="go-wenbenkuang" Text=" 删除 << "  CausesValidation="False" onclick="btAreaDelete_Click"></asp:Button></TD>
																		</TR>
																	</TABLE>
																</TD>
																<TD>
																	<asp:ListBox id="lbRight" runat="server" CssClass="wenbenkuang" Width="221px" Height="208px"
																		SelectionMode="Multiple"></asp:ListBox></TD>
															</TR>
														</TABLE>
													</asp:Panel></TD>
											</TR>
											<TR bgColor="#ffffff">
												<TD align="right"><%=myLanguagesDeal.GetMyString("TextRemark")%><%=myLanguagesDeal.GetMyString("TextColonCharacter")%><!--备注：--></TD>
												<TD class="pad">
													<asp:TextBox id="txtRemark" runat="server" CssClass="wenbenkuang" Width="300px" MaxLength="50"
														EnableViewState="False"></asp:TextBox></TD>
											</TR>
											<TR bgColor="#ffffff">
												<TD align="right" width="20%"></TD>
												<TD class="pad">&nbsp;
													<asp:button id="btSubmit" runat="server" CssClass="go-wenbenkuang" Text="提交信息" onclick="btSubmit_Click"></asp:button></TD>
											</TR>
										</TABLE>
										<P align="center">
											<asp:Label id="lbInfo" runat="server" ForeColor="Red"></asp:Label></P>
									</asp:panel></td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</form>
	</body>
</HTML>
