public ActionResult DeleteConfirmed(Guid id) { StatePower statePower = db.StatePowers.Find(id); db.StatePowers.Remove(statePower); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "StatePowerId,StatePowerName,DateEntered,DateModified,CreatedByUserId,ModifiedByUserId,AssignedToUserId")] StatePower statePower) { if (ModelState.IsValid) { db.Entry(statePower).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(statePower)); }
public ActionResult Create([Bind(Include = "StatePowerId,StatePowerName,DateEntered,DateModified,CreatedByUserId,ModifiedByUserId")] StatePower statePower) { if (ModelState.IsValid) { statePower.StatePowerId = Guid.NewGuid(); db.StatePowers.Add(statePower); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(statePower)); }
// GET: StatePowers/Delete/5 public ActionResult Delete(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StatePower statePower = db.StatePowers.Find(id); if (statePower == null) { return(HttpNotFound()); } return(View(statePower)); }
// GET: StatePowers/Details/5 public ActionResult Details(Guid?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StatePower statePower = db.StatePowers.Find(id); if (statePower == null) { return(HttpNotFound()); } ViewBag.Institutions = db.Institutions.Where(i => i.StatePowerId == id).OrderBy(i => i.InstitutionName).ToList(); return(View(statePower)); }