// GET: /UserMaster/Delete/<id> public ActionResult Delete( Int64?UserId ) { if ( UserId == null ) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } UserMaster UserMaster = new UserMaster(); UserMaster.UserId = System.Convert.ToInt32(UserId); UserMaster = UserMasterData.Select_Record(UserMaster); if (UserMaster == null) { return(HttpNotFound()); } return(View(UserMaster)); }
public ActionResult DeleteConfirmed( Int64?UserId ) { UserMaster UserMaster = new UserMaster(); UserMaster.UserId = System.Convert.ToInt32(UserId); UserMaster = UserMasterData.Select_Record(UserMaster); bool bSucess = false; bSucess = UserMasterData.Delete(UserMaster); if (bSucess == true) { TempData["success"] = "Successfully deleted."; return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Can Not Delete"); } return(null); }
public ActionResult Edit(UserMaster UserMaster) { UserMaster oUserMaster = new UserMaster(); oUserMaster.UserId = System.Convert.ToInt32(UserMaster.UserId); oUserMaster = UserMasterData.Select_Record(UserMaster); if (ModelState.IsValid) { bool bSucess = false; bSucess = UserMasterData.Update(oUserMaster, UserMaster); if (bSucess == true) { return(RedirectToAction("Index")); } else { ModelState.AddModelError("", "Can Not Update"); } } return(View(UserMaster)); }