public ActionResult Create(Client model) { try { if (ModelState.IsValid) { viverbembd.Client.Add(model); viverbembd.SaveChanges(); return RedirectToAction("Index"); } return View(); } catch (Exception ex) { return View(); } }
public ActionResult Edit(Client model) { try { if (ModelState.IsValid) { viverbembd.Entry(model).State = System.Data.Entity.EntityState.Modified; viverbembd.SaveChanges(); return RedirectToAction("Index"); } return View(); } catch (Exception ex) { return View(); } }
public ActionResult Delete(Client model) { try { viverbembd.Entry(model).State = System.Data.Entity.EntityState.Deleted; viverbembd.SaveChanges(); return RedirectToAction("Index"); } catch (Exception ex) { return View(); } }