public JsonResult DeleteOrigin(int Id) { var dao = new OriginDAO(); bool check = dao.CheckUsed(Id); int result = 2; if (check == false) { result = dao.DeleteOrigin(Id); return(Json(new { res = result })); } return(Json(new { res = result })); }
public JsonResult ChangeStatus(int Id) { var dao = new OriginDAO(); bool check = dao.CheckUsed(Id); if (check == false) { bool?res = dao.ChangeStatus(Id); return(Json(new { res = res, used = check, })); } else { return(Json(new { used = check, })); } }