public ActionResult DeleteConfirmed( Int32?PermissionID ) { Permission Permission = new Permission(); Permission.PermissionID = System.Convert.ToInt32(PermissionID); Permission = PermissionData.Select_Record(Permission); bool bSucess = false; bSucess = PermissionData.Delete(Permission); if (bSucess == true) { return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Can Not Delete"); } return(null); }
// GET: /Permission/Delete/<id> public ActionResult Delete( Int32?PermissionID ) { if ( PermissionID == null ) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Permission Permission = new Permission(); Permission.PermissionID = System.Convert.ToInt32(PermissionID); Permission = PermissionData.Select_Record(Permission); if (Permission == null) { return(HttpNotFound()); } return(View(Permission)); }
public ActionResult Edit(Permission Permission) { Permission oPermission = new Permission(); oPermission.PermissionID = System.Convert.ToInt32(Permission.PermissionID); oPermission = PermissionData.Select_Record(Permission); if (ModelState.IsValid) { bool bSucess = false; bSucess = PermissionData.Update(oPermission, Permission); if (bSucess == true) { return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Can Not Update"); } } return(View(Permission)); }