示例#1
0
 public UseCoupons(Couponss item)
 {
     couponsType = CouponsType.GetName(item.couponsType);
     if (item.couponsType == CouponsType.DiscountedVolume)
     {
         describe = "折扣券";
         amount   = string.Format("<span>{0}</span>折<br>", Convert.ToInt32(item.discount * 10).ToString());
     }
     else if (item.couponsType == CouponsType.FullVolumeReduction)
     {
         describe = string.Format("满{0}减{1}", item.fullAmount, item.reduceAmount);
         amount   = string.Format("¥<span>{0}</span><br>", Convert.ToInt32(item.reduceAmount).ToString());
     }
     else if (item.couponsType == CouponsType.OffsetRoll)
     {
         describe = "抵扣券";
         amount   = string.Format("¥<span>{0}</span><br>", Convert.ToInt32(item.deductibleAmount).ToString());
     }
     else
     {
         describe = "";
     }
     if (item.validity.HasValue)
     {
         validity = item.validity.Value.ToString("yyyy-MM-dd");
     }
     else
     {
         validity = "永久有效";
     }
     useScope  = string.IsNullOrWhiteSpace(item.useScope) ? "所有门店" : item.shopName;
     CouponsId = item.id;
 }
示例#2
0
 public CouponsModel(Couponss item) : base(item)
 {
 }