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