public ActionResult UpdataJJ(ChuLi entity) { if (entity != null && ModelState.IsValid) { string returnValue = string.Empty; if (m_BLL.EditState(ref validationErrors, entity, "已拒绝")) { LogClassModels.WriteServiceLog(Suggestion.UpdateSucceed + ",信息的Id为" + entity.Id, "拒绝" );//写入日志 return Content("成功");//提示更新成功 } else { if (validationErrors != null && validationErrors.Count > 0) { validationErrors.All(a => { returnValue += a.ErrorMessage; return true; }); } LogClassModels.WriteServiceLog(Suggestion.UpdateFail + ",信息的Id为" + entity.Id + "," + returnValue, "拒绝" );//写入日志 return Content(Suggestion.UpdateFail + returnValue); //提示更新失败 } } return Content(Suggestion.InsertFail + ",请核对输入的数据的格式"); //提示输入的数据的格式不对 }
public ActionResult UpdataAnPai(ChuLi entity) { if (entity != null && ModelState.IsValid) { if (string.IsNullOrWhiteSpace(entity.Anpai)) { return Content("请选择维修人员"); } string returnValue = string.Empty; if (m_BLL.EditAndShenQing(ref validationErrors, entity)) { LogClassModels.WriteServiceLog(Suggestion.UpdateSucceed + ",信息的Id为" + entity.Id, "安排" );//写入日志 return Content("成功");//提示更新成功 } else { if (validationErrors != null && validationErrors.Count > 0) { validationErrors.All(a => { returnValue += a.ErrorMessage; return true; }); } LogClassModels.WriteServiceLog(Suggestion.UpdateFail + ",信息的Id为" + entity.Id + "," + returnValue, "安排" );//写入日志 return Content(Suggestion.UpdateFail + returnValue); //提示更新失败 } } return Content(Suggestion.InsertFail + ",请核对输入的数据的格式"); //提示输入的数据的格式不对 }
public ActionResult Comment(string id, ChuLi entity) { SuggestionRes response = new SuggestionRes(); #region 各种校验 if (!Validator.IsNumber(entity.DaFen.GetString())) { response.errorCode = 2; return Json(response); } if (string.IsNullOrWhiteSpace(entity.PingLun)) { response.errorCode = 4; return Json(response); } #endregion string currentPerson = GetCurrentPerson(); string returnValue = string.Empty; IChuLiBLL m_BLL = new ChuLiBLL(); if (!m_BLL.Comment(ref validationErrors, entity)) { if (validationErrors != null && validationErrors.Count > 0) { validationErrors.All(a => { returnValue += a.ErrorMessage; return true; }); } response.errorCode = 1; response.content = returnValue; return Json(response); } response.errorCode = 0; return Json(response); }
/// <summary> /// 创建一个维修处理 /// </summary> /// <param name="validationErrors">返回的错误信息</param> /// <param name="db">数据库上下文</param> /// <param name="entity">一个维修处理</param> /// <returns></returns> public bool Create(ref ValidationErrors validationErrors, ChuLi entity) { try { repository.Create(entity); return true; } catch (Exception ex) { validationErrors.Add(ex.Message); ExceptionsHander.WriteExceptions(ex); } return false; }