Esempio n. 1
0
 public static decimal GetDiscountAmount(this tbl_Basket table)
 {
     if (table.tbl_Discount != null)
     {
         decimal totalPrice = 0, totalTaxAmount = 0;
         foreach (var content in table.tbl_BasketContent)
         {
             Tuple <decimal, decimal> priceAndTax = PriceManager.GetPriceAndTaxAmounts(content.tbl_ProductPrice, content.BC_Quantity);
             totalPrice     += priceAndTax.Item1;
             totalTaxAmount += priceAndTax.Item2;
         }
         return(PriceManager.GetDiscountAmount(table.tbl_Discount, totalPrice, totalTaxAmount, table.B_DomainID));
     }
     return(0);
 }