// POST: UserType/Delete/5 public ActionResult Delete(int id) { try { // TODO: Add delete logic here if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } else { UserType usertype = UsertypeService.GetByID(id); if (usertype == null) { return(HttpNotFound()); } UsertypeService.Delete(usertype); UsertypeService.SaveChange(); return(RedirectToAction("Index")); } } catch { return(RedirectToAction("Index")); } }
/// <summary> /// 删除一条数据 /// </summary> public void Delete(string UserType) { dal.Delete(UserType); }