//WalkupTotals //Parameters: walkupOrder – object that contains the values for the walkup order public IActionResult WalkupTotals(WalkupOrder walkupOrder) { TryValidateModel(walkupOrder); if (ModelState.IsValid == false) { return(View("CheckoutWalkup", walkupOrder)); } else { walkupOrder.customerType = CustomerType.Walkup; walkupOrder.CalcTotals(); return(View("WalkupTotals", walkupOrder)); } }
//Checks validation for walkup and returns Walkup total values and view public IActionResult WalkupTotals(WalkupOrder Walkuporder) { TryValidateModel(Walkuporder); if (ModelState.IsValid == false) //something is wrong { return(View("CheckoutWalkup", Walkuporder)); } //sets the given customer type Walkuporder.Customertype = CustomerType.Walkup; //calculates all preliminary prices and total Walkuporder.CalcTotals(); //Move to walkup totals return(View("WalkupTotals", Walkuporder)); }
public IActionResult WalkupTotals(WalkupOrder walkupOrder) { TryValidateModel(walkupOrder); if (ModelState.IsValid == false) { return(View("CheckoutWalkup", walkupOrder)); } //if it makes it to here then it's valid //set customer type walkupOrder.CustomerType = CustomerType.Walkup; //call calulate totals method from walkuporder walkupOrder.CalcTotals(); //display walkuptotals view return(View("WalkupTotals", walkupOrder)); }