public ActionResult Edit(int id, officerRoom room) { try { // TODO: Add update logic here db.Entry(room).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Create(officerRoom room) { try { // TODO: Add insert logic here room.isActive = true; db.Entry(room).State = System.Data.Entity.EntityState.Added; db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }