// GET: Customer/Edit/5 public ActionResult Edit(int id) { CustomerViewModel cvm = new CustomerViewModel(); cvm.Customer = facade.GetCustomerGateway().Get(id); cvm.SelectedList = cvm.Customer.Address.Id.ToString(); return View(cvm); }
public ActionResult Create(CustomerViewModel item) { try { item.Customer.Address = facade.GetAddressGateway().Get(int.Parse( item.SelectedList)); facade.GetCustomerGateway().Add(item.Customer); return RedirectToAction("Index"); } catch { return View(); } }
// GET: Customer/Create public ActionResult Create() { CustomerViewModel mvc = new CustomerViewModel(); return View(mvc); }