public ActionResult DeleteConfirmed(int id) { PhoneExt phoneext = db.PhoneExts.Find(id); db.PhoneExts.Remove(phoneext); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /Extension/Details/5 public ActionResult Details(int id = 0) { PhoneExt phoneext = db.PhoneExts.Find(id); if (phoneext == null) { return(HttpNotFound()); } return(View(phoneext)); }
public ActionResult Edit(PhoneExt phoneext) { if (ModelState.IsValid) { db.Entry(phoneext).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Department = new SelectList(db.Deparments, "Id", "Name", phoneext.Department); return(View(phoneext)); }
// // GET: /Extension/Edit/5 public ActionResult Edit(int id = 0) { PhoneExt phoneext = db.PhoneExts.Find(id); if (phoneext == null) { return(HttpNotFound()); } ViewBag.Department = new SelectList(db.Deparments, "Id", "Name", phoneext.Department); return(View(phoneext)); }
public ActionResult Create(PhoneExt phoneext) { if (ModelState.IsValid) { db.PhoneExts.Add(phoneext); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Department = new SelectList(db.Deparments, "Id", "Name", phoneext.Department); return(View(phoneext)); }