<%@ Register TagPrefix="ftb" Namespace="FreeTextBoxControls" Assembly="FreeTextBox" %>
<%@ Page language="c#" Codebehind="GiftAdd.aspx.cs" AutoEventWireup="true" Inherits="XpShop.Manage.GiftAdd" validateRequest="false" %>
<!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>GiftAdd</title>
		<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
		<meta name="CODE_LANGUAGE" Content="C#">
		<meta name="vs_defaultClientScript" content="JavaScript">
		<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
		<script src="inc/jquery.validate.js" type="text/javascript"></script>
	    <script src="inc/messages_cn.js" type="text/javascript"></script>
	<script type="text/javascript">
	    jQuery.validator.addMethod("telphoneValid", function(value, element) { 
            var tel = /^(130|131|132|133|134|135|136|137|138|139|150|153|157|158|159|180|187|188|189)\d{8}$/; 
            return tel.test(value) || this.optional(element); 
        }, "请输入正确的手机号码");
		$(document).ready(function(){
			$("#Form1").validate({
		    event: "keyup",
		    rules: {
			    txtProductNo: {
				    required: true,
				    maxlength:100
			    },
			    txtGiftName: {
			        required:true,
				    maxlength:100
			    },
			    txtScore: {
				    required: true,
				    digits:true
			    },
			    txtStorage: {
				    required: true,
				    digits:true
			    },
    			txtLimitedNumber:{
				    required: true,
    			    digits:true
    			}
		    },
		
		    messages: {
			    txtProductNo: {
				    required: "请输入商品编号",
				    maxlength: "最大长度只能在(100个字符)以内"
			    },
			    txtGiftName: {
                    required: "请输入礼品名称",
				    strlen: "最大长度只能在(100个字符)以内"
			    },
			    txtScore: {
				    required: "请输入兑换礼品所需积分",
				    digits: "积分必须为正整数"
			    },
			    txtStorage: {
				    required: "请输入可兑换的礼品数量",
				    digits: "库存必须为正整数"
			    },
    			txtLimitedNumber:{
				    required: "请输入会员可兑换的最大数量",
    			    digits:"会员可兑换数必须为正整数"
    			}
		    },
		    debug:"false",
		    submitHandler:function(form){
			    form.submit();
		    }
	    });
});

		
		</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" />礼品添加</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">礼品添加</asp:Label></div>
		        <div class="frame_content">
		            <table class="ptable" cellspacing="0" cellpadding="0">
                        <tr style="display:none">
							<th class="tl">商品ID：
							</th>
							<td class="tr"><asp:textbox id="txtProductID" runat="server" Width="150px"></asp:textbox><em>*</em>
                            </td>
						</tr>
                        <tr>
							<th class="tl">商品编号：
							</th>
							<td class="tr"><asp:textbox id="txtProductNo" runat="server" Width="150px" CssClass="required"></asp:textbox><em>*</em>
                            </td>
						</tr>
						<tr>
							<th class="tl">礼品名称：
							</th>
							<td class="tr"><asp:textbox id="txtGiftName" runat="server" Width="150px" CssClass="required"></asp:textbox><em>*</em></td>
						</tr>
						<tr style="display:none">
							<th class="tl">礼品分类：
							</th>
							<td class="tr"><asp:DropDownList ID="ddlGiftCat" runat=server></asp:DropDownList><em>*</em></td>
						</tr>						<tr>
							<th class="tl">兑换积分：
							</th>
							<td class="tr"><asp:textbox id="txtScore" runat="server" Width="150px" CssClass="required"></asp:textbox><em>*</em></td>
						</tr>
						<tr>
							<th class="tl">礼品数量：
							</th>
							<td class="tr"><asp:textbox id="txtStorage" runat="server" Width="150px" CssClass="required"></asp:textbox><em>*</em></td>
						</tr>
						<tr>
							<th class="tl">会员可兑换数量：
							</th>
							<td class="tr"><asp:textbox id="txtLimitedNumber" runat="server" Width="150px"></asp:textbox><em>*</em>(值为0,表示不限制会员的兑换数)</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>
