public ActionResult DeleteConfirmed(int id) { GrantPermissions grantPermissions = db.GrantPermissions.Find(id); db.GrantPermissions.Remove(grantPermissions); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "PermissionID,PemissionName,Descrpition,UserID")] GrantPermissions grantPermissions) { if (ModelState.IsValid) { db.Entry(grantPermissions).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.UserID = new SelectList(db.Administrators, "UserID", "UserName", grantPermissions.UserID); return(View(grantPermissions)); }
// GET: Admin/GrantPermissions/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GrantPermissions grantPermissions = db.GrantPermissions.Find(id); if (grantPermissions == null) { return(HttpNotFound()); } return(View(grantPermissions)); }
// GET: Admin/GrantPermissions/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } GrantPermissions grantPermissions = db.GrantPermissions.Find(id); if (grantPermissions == null) { return(HttpNotFound()); } ViewBag.UserID = new SelectList(db.Administrators, "UserID", "UserName", grantPermissions.UserID); return(View(grantPermissions)); }