public ActionResult EditOtherBuildings(Other_Buildings other_Buildings) { if (ModelState.IsValid) { if (User.IsInRole("Admin")) { db.Entry(other_Buildings).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(RedirectToAction("Index")); } return(View(other_Buildings)); }
public ActionResult OtherBuildingsDetails(int?id) { if (id == null) { return(RedirectToAction("Index", "Home")); } Other_Buildings other_Buildings = db.Other_Buildings.Find(id); if (other_Buildings == null) { return(View("Error")); } return(View(other_Buildings)); }
// GET: Faculty_Buildings/Create public ActionResult CreateOtherBuildings(Other_Buildings other_Buildings) { if (ModelState.IsValid) { if (User.IsInRole("Admin")) { db.Other_Buildings.Add(other_Buildings); db.SaveChanges(); return(RedirectToAction("Index")); } } return(View(other_Buildings)); }