<%@ Page language="c#" AutoEventWireup="false" EnableViewState="false" Inherits="SocoShop.Page.UserCouponAjax" %>
<%@ Import namespace="SocoShop.Entity" %>
<%@ Import namespace="SocoShop.Business" %>
<%@ Import namespace="SocoShop.Common" %>
<%@ Import namespace="SkyCES.EntLib" %>
<%@ Import namespace="System.Diagnostics" %>
<script runat="server">
protected override void OnInit(EventArgs e)
{
	/* 
		本页面代码由天易模板生成于 2011/3/6 19:11:38.
	*/
	Stopwatch sw = new Stopwatch();
	sw.Start();
	base.OnInit(e);
	sw.Stop();
	 decimal processTime=Convert.ToDecimal(sw.ElapsedMilliseconds) / 1000;
	StringBuilder document = new StringBuilder();
	switch(action)
{
	case "NotUse":
	case "HasUse":
	document.Append("    <table class=\"listTable\" cellpadding=\"0\" cellpadding=\"0\">\r\n");
	document.Append("        <tr class=\"listTableHead\">                               \r\n");
	document.Append("            <td width=\"30%\" style=\"text-align:left;padding-left:5px;\">卡号</td>\r\n");
	document.Append("            <td width=\"10%\">面值(元)</td>\r\n");
	document.Append("            <td width=\"20%\">单次最低消费(元)</td>\r\n");
	document.Append("            <td width=\"20%\">有效时间</td>\r\n");
	document.Append("            <td width=\"20%\">消费状态</td>\r\n");
	document.Append("        </tr>\r\n");
	foreach(UserCouponInfo userCoupon in userCouponList)
{
	
            CouponInfo coupon=CouponBLL.ReadCouponByCouponList(couponList,userCoupon.CouponID);
        
	document.Append("        <tr class=\"listTableMain\">                             \r\n");
	document.Append("            <td style=\"text-align:left;padding-left:5px;\">"+userCoupon.Number +"</td>\r\n");
	document.Append("            <td>"+coupon.Money +"</td>\r\n");
	document.Append("            <td>"+coupon.UseMinAmount +"</td>\r\n");
	document.Append("            <td>"+coupon.UseStartDate.ToString("yyyy-MM-dd")+" 到 "+coupon.UseEndDate.ToString("yyyy-MM-dd")+"</td>            \r\n");
	document.Append("            <td>\r\n");
	if(userCoupon.IsUse==1)
{
	document.Append("已消费\r\n");
	}
else
{
	document.Append("未消费\r\n");
	 }
	document.Append("</td>\r\n");
	document.Append("        </tr>\r\n");
	}
	document.Append("    </table>\r\n");
	document.Append("    <div class=\"height10\"></div>\r\n");
	document.Append("    <div>"+ajaxPagerClass.ShowPage()+"</div>\r\n");
	break;
	case "AddCoupon":
	document.Append("    <div class=\"sendMsg\">\r\n");
	document.Append("        <dl>\r\n");
	document.Append("            <dt>卡号</dt>\r\n");
	document.Append("            <dd><input type=\"text\" class=\"input\" style=\"width:200px\" id=\"Number\" /></dd>\r\n");
	document.Append("        </dl>\r\n");
	document.Append("        <dl>\r\n");
	document.Append("            <dt>密码</dt>\r\n");
	document.Append("            <dd><input type=\"password\" class=\"input\" style=\"width:200px\" id=\"Password\" /></dd>\r\n");
	document.Append("        </dl>\r\n");
	document.Append("        <dl>\r\n");
	document.Append("            <dt>&nbsp;</dt>\r\n");
	document.Append("            <dd><input type=\"button\" class=\"button\" value=\"确定\" onclick=\"addUserCoupon()\" /></dd>\r\n");
	document.Append("        </dl>\r\n");
	document.Append("    </div>\r\n");
	break;
	default:
	break;
	
 }
	Response.Write(document.ToString());
}
</script>