public ActionResult Deletemsg(int id) { message prod = mss.GetById(id); mss.Delete(prod); mss.SaveChange(); return(RedirectToAction("ListMessage")); }
public JsonResult Delete(string recordId) { try { bool result = MessageServices.Delete(recordId); if (!result) { throw new MyException("删除失败"); } return(Json(MyResult.Success())); } catch (MyException ex) { return(Json(MyResult.Error(ex.Message))); } catch (Exception ex) { ExceptionsServices.AddExceptions(ex, "删除信息失败"); return(Json(MyResult.Error("删除失败"))); } }