public ActionResult New(int customerNo) { Customer customer = this.customerService.FindCustomerBy(customerNo); if (customer == null) { return HttpNotFound(); } var model = new NewSaleModel() { Customer = customer, CustomerNo = customer.CustomerNo, AvailableServiceTypes = GetAvailableServiceTypes() }; return View(model); }
public ActionResult New(NewSaleModel model) { if (ModelState.IsValid) { this.saleService .MakeNewSale( model.CustomerNo, model.SelectedServiceTypeId, model.Amount, model.SalesPersonAccountNo); this.AddSuccessMessage("Sale has been entered."); return RedirectToRoute("admin.sales.index_page"); } return View(model); }