// GET: CustomerController/Edit/5 public ActionResult Edit(int id) { Dozen2Models.Customer customer = _customerBL.GetCustomerByID(id); CustomerEditVM customerEditVM = _mapper.Map <CustomerEditVM>(customer); return(View(customerEditVM)); }
public IActionResult ConfirmOrder(OrderIndexVM orderIndexVM) { string drinkOrderString = TempData["DrinkOrders"].ToString(); orderIndexVM.DrinkOrders = JsonConvert.DeserializeObject <List <DrinkOrderVM> >(drinkOrderString); var customer = _customerBL.GetCustomerByID(orderIndexVM.CustomerID); if (customer != null) { orderIndexVM.CustomerName = customer.Name; } var location = _locationBL.GetSpecifiedLocation(orderIndexVM.LocationID); if (location != null) { orderIndexVM.LocationName = location.LocationName; orderIndexVM.State = location.State; } orderIndexVM.Total = GetTotal(orderIndexVM.DrinkOrders); return(View(orderIndexVM)); }