public ViewResult CreateCustomer() { var viewModel = new EditCustomerViewModel() { Customer = this.session.Repository<Customer>().Create() }; return View("EditCustomer", viewModel); }
public ActionResult EditCustomer(EditCustomerViewModel viewModel) { if (!this.ModelState.IsValid) return View(viewModel); this.SaveEntity(viewModel.Customer); return RedirectToAction("Customers"); }
public ViewResult EditCustomer(int id) { var viewModel = new EditCustomerViewModel() { Customer = this.session.Repository<Customer>().Get(id) }; return View(viewModel); }