Exemple #1
0
        public static CouponInfo UseCoupon(decimal orderAmount, string claimCode)
        {
            CouponInfo result;

            if (string.IsNullOrEmpty(claimCode))
            {
                result = null;
            }
            else
            {
                CouponInfo coupon = ShoppingProcessor.GetCoupon(claimCode);
                if (coupon != null && ((coupon.Amount.HasValue && coupon.Amount > 0m && orderAmount >= coupon.Amount.Value) || ((!coupon.Amount.HasValue || coupon.Amount == 0m) && orderAmount > coupon.DiscountValue)))
                {
                    result = coupon;
                }
                else
                {
                    result = null;
                }
            }
            return(result);
        }
Exemple #2
0
 public static DataTable UseCoupon(decimal orderAmount)
 {
     return(ShoppingProcessor.GetCoupon(orderAmount));
 }