예제 #1
0
 public void ProcessVoucher(IVoucher voucher, IBasket basket, IBasketVoucher basketVoucher)
 {
     if (voucher.MinSpend > basket.BasketTotal())
     {
         basketVoucher.Value              = voucher.Value;
         basketVoucher.VoucherCode        = voucher.VoucherCode;
         basketVoucher.VoucherDescription = voucher.VoucherDescription;
         basketVoucher.VoucherId          = voucher.VoucherId;
         basket.AddBasketVoucher(basketVoucher);
     }
 }
예제 #2
0
 public void ProcessVoucher(IVoucher voucher, IBasket basket, IBasketVoucher basketVoucher)
 {
     if (voucher.MinSpend < basket.BasketTotal())
     {
         basketVoucher.Value = voucher.Value;
         basketVoucher.VoucherCode = voucher.VoucherCode;
         basketVoucher.VoucherDescription = voucher.VoucherDescription;
         basketVoucher.VoucherId = voucher.VoucherId;
         basket.AddBasketVoucher(basketVoucher);
     }  
 }
 public void ProcessVoucher(IVoucher vc, IBasket bkt, IBasketVoucher bv)
 {
     if (vc.MinSpend < bkt.BasketTotal())
     {
         bv.Value              = -vc.Value;
         bv.VoucherCode        = vc.VoucherCode;
         bv.VoucherDescription = vc.VoucherDescription;
         bv.VoucherId          = vc.VoucherId;
         bkt.AddBasketVoucher(bv);
     }
 }
예제 #4
0
        public void ProcessVoucher(IVoucher voucher, IBasket basket, IBasketVoucher basketVoucher)
        {
            decimal basketTotal = basket.BasketTotal();

            if (voucher.MinSpend < basketTotal)
            {
                basketVoucher.Value              = voucher.Value * (basketTotal / 100) - 1;
                basketVoucher.VoucherCode        = voucher.VoucherCode;
                basketVoucher.VoucherDescription = voucher.VoucherDescription;
                basketVoucher.VoucherId          = voucher.VoucherId;
                basket.AddBasketVoucher(basketVoucher);
            }
        }
예제 #5
0
        public void ProcessVoucher(IVoucher vc, IBasket bkt, IBasketVoucher bv)
        {
            decimal basketTotal = bkt.BasketTotal();

            if (vc.MinSpend < basketTotal)
            {
                bv.Value              = -vc.Value * (basketTotal / 100);
                bv.VoucherCode        = vc.VoucherCode;
                bv.VoucherDescription = vc.VoucherDescription;
                bv.VoucherId          = vc.VoucherId;
                bkt.AddBasketVoucher(bv);
            }
        }
예제 #6
0
 public void AddBasketVoucher(IBasketVoucher voucher)
 {
     _basketVouchers.Add((BasketVoucher)voucher);
 }
예제 #7
0
파일: Basket.cs 프로젝트: Robooto/eCommerce
 public void AddBasketVoucher(IBasketVoucher voucher)
 {
     _basketVouchers.Add((BasketVoucher) voucher);
 }