public static CouponModel Get(long id)
        {
            var couponList = Service.GetCouponInfo(id);

            if (couponList == null)
            {
                return(null);
            }
            var record   = Service.GetRecordCountByCoupon(couponList.Id);
            var lmCoupon = new Himall.DTO.CouponModel();

            lmCoupon.CouponName  = couponList.CouponName;
            lmCoupon.Id          = couponList.Id;
            lmCoupon.Num         = couponList.Num;
            lmCoupon.useNum      = record;
            lmCoupon.inventory   = couponList.Num - record;
            lmCoupon.OrderAmount = couponList.OrderAmount == 0 ? "不限制" : "满" + couponList.OrderAmount;
            lmCoupon.Price       = couponList.Id;
            lmCoupon.ShopName    = couponList.ShopName;
            lmCoupon.EndTime     = couponList.EndTime;
            lmCoupon.StartTime   = couponList.StartTime;
            lmCoupon.perMax      = couponList.PerMax;
            lmCoupon.UseArea     = couponList.UseArea;
            lmCoupon.Remark      = couponList.Remark;
            return(lmCoupon);
        }
Beispiel #2
0
        public static CouponModel Get(long id)
        {
            var couponList = _iCouponService.GetCouponInfo(id);

            if (couponList == null)
            {
                return(null);
            }
            var lmCoupon = new Himall.DTO.CouponModel();

            lmCoupon.CouponName  = couponList.CouponName;
            lmCoupon.Id          = couponList.Id;
            lmCoupon.Num         = couponList.Num;
            lmCoupon.useNum      = couponList.Himall_CouponRecord.Count();
            lmCoupon.inventory   = couponList.Num - couponList.Himall_CouponRecord.Count();
            lmCoupon.OrderAmount = couponList.OrderAmount == 0 ? "不限制" : "满" + couponList.OrderAmount;
            lmCoupon.Price       = couponList.Id;
            lmCoupon.ShopName    = couponList.ShopName;
            lmCoupon.EndTime     = couponList.EndTime;
            lmCoupon.StartTime   = couponList.StartTime;
            lmCoupon.perMax      = couponList.PerMax;
            return(lmCoupon);
        }