public ActionResult Delete(int id = -1) { if (id == -1) { return(Json(new { code = 200, message = "暂无可操作数据!" })); } _modeService.Delete(id); return(Json(new { code = 200, message = "操作执行成功!" })); }
public IHttpActionResult Delete(int id) { Mode item = service.Get(id); if (item != null) { service.Delete(item); return(Ok(item)); } return(BadRequest()); }
public ActionResult Delete(Mode model) { try { service.Delete(model); return(RedirectToAction("Index", "Mode")); } catch { return(View(model)); } }