public ActionResult Form(Sys_Organize model) { if (model.Id == 0) { var primaryKey = OrganizeService.Insert(model); return(primaryKey > 0 ? Success() : Error()); } else { int row = OrganizeService.Update(model); return(row > 0 ? Success() : Error()); } }
public IHttpActionResult GetOrganizeInfo(sys_organize entry) { try { OrganizeService os = new OrganizeService(); int cnt = os.Update(entry); return(cnt > 0? Json(new { code = 1, msg = "ok" }): Json(new { code = 0, msg = "error" })); } catch (Exception e) { return(Json(new { code = 0, msg = e.Message })); } }