public ActionResult Edit(Customer customer) { try { // TODO: Add update logic here var customerEntities = new CustomerDB(); customerEntities.Update(customer); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Delete(int id, FormCollection collection) { try { var customerEntities = new CustomerDB(); customerEntities.Delete(id); return RedirectToAction("Index"); } catch { return View(); } }
public ActionResult Create(Customer customer) { try { //TODO: add insert logic here var customEntities = new CustomerDB(); customEntities.Create(customer); return RedirectToAction("Index"); } catch (Exception) { return View(); } }
// // GET: /Customer/ public ActionResult Index() { var customEntities = new CustomerDB(); return View(customEntities.GetCustomers()); }
public ActionResult Edit(int id) { var customerEntities = new CustomerDB(); return View(customerEntities.GetCustomerById(id)); }