public IActionResult Index(PriceQuotationModel model) { if (ModelState.IsValid) { ViewBag.discount = model.CalculateDiscount(); ViewBag.total = model.CalculateTotal(); } else { ViewBag.discount = 0; ViewBag.total = 0; } return(View(model)); }
public IActionResult Index(PriceQuotationModel model) // this Index will take FutureValueModel, process data here { if (ModelState.IsValid) { ViewBag.DiscountAmount = model.CalculateDiscountAmount(); ViewBag.Total = model.CalculateTotal(); } else { ViewBag.DiscountAmount = 0; ViewBag.Total = 0; } return(View(model)); }