Пример #1
0
 public void Apply(ProductViewModel productViewModel)
 {
     decimal price = productViewModel.Price;
     if (price >= moneyRequire)
     {
         productViewModel.SellingPrice = price - Math.Floor(price / moneyRequire) * moneyReturn;
         productViewModel.Discount = Math.Round(productViewModel.SellingPrice / productViewModel.Price, 2);
         productViewModel.Point = 0m;
     }
 }
Пример #2
0
 public void Apply(ProductViewModel productViewModel)
 {
     decimal price = productViewModel.Price;
     if (price >= moneyRequire)
     {
         productViewModel.Point = Math.Floor(price * returnRate);
         productViewModel.SellingPrice = productViewModel.Price;
         productViewModel.Discount = 0m;
     }
 }
Пример #3
0
 public void Apply(ProductViewModel productViewModel)
 {
     productViewModel.Discount = this.discount;
     productViewModel.SellingPrice = productViewModel.Price * this.discount;
     productViewModel.Point = 0m;
 }