public ActionResult SaveForm(string planid, string smallchaperid, NoSuitableDetailEntity entity) { NoSuitableDetailEntity resultEntity = nosuitabledetailbll.GetNoSuitByPlanOrChapID(planid, smallchaperid); if (resultEntity != null) { resultEntity.NSuitReason = entity.NSuitReason;//不适宜项原因 nosuitabledetailbll.SaveForm(resultEntity.Id, resultEntity); } else { resultEntity = new NoSuitableDetailEntity(); resultEntity.NSuitReason = entity.NSuitReason;//不适宜项原因 resultEntity.AssessmentPlanID = planid; resultEntity.ChapterID = smallchaperid; nosuitabledetailbll.SaveForm("", resultEntity); } //如果是不适宜项.看扣分表中是否存在此要素的数据,如果存在,就删除 KScoreDetailEntity kentity = kscoredetailbll.GetKScoreByPlanOrChapID(planid, smallchaperid); if (kentity != null) { kscoredetailbll.RemoveForm(resultEntity.Id); } return(Success("操作成功。")); }
public ActionResult RemoveForm(string planid, string smallchaperid) { KScoreDetailEntity resultEntity = kscoredetailbll.GetKScoreByPlanOrChapID(planid, smallchaperid); if (resultEntity != null) { kscoredetailbll.RemoveForm(resultEntity.Id); } return(Success("删除成功。")); }
/// <summary> /// 保存表单(新增、修改) /// </summary> /// <param name="keyValue">主键值</param> /// <param name="entity">实体对象</param> /// <returns></returns> public void SaveForm(string keyValue, KScoreDetailEntity entity) { try { service.SaveForm(keyValue, entity); } catch (Exception) { throw; } }
public ActionResult SaveForm(string planid, string smallchaperid, KScoreDetailEntity entity) { KScoreDetailEntity resultEntity = kscoredetailbll.GetKScoreByPlanOrChapID(planid, smallchaperid); if (resultEntity != null) { resultEntity.kScore = entity.kScore; //扣分 resultEntity.Measure = entity.Measure; //整改措施 resultEntity.kScoreReason = entity.kScoreReason; //扣分原因 kscoredetailbll.SaveForm(resultEntity.Id, resultEntity); } else { resultEntity = new KScoreDetailEntity(); resultEntity.kScore = entity.kScore; //扣分 resultEntity.Measure = entity.Measure; //整改措施 resultEntity.kScoreReason = entity.kScoreReason; //扣分原因 resultEntity.kScoreDate = DateTime.Now; resultEntity.AssessmentPlanID = planid; resultEntity.ChapterID = smallchaperid; kscoredetailbll.SaveForm("", resultEntity); } return(Success("操作成功。")); }
public ActionResult GetFormJson(string planid, string smallchaperid) { KScoreDetailEntity resultEntity = kscoredetailbll.GetKScoreByPlanOrChapID(planid, smallchaperid); return(ToJsonResult(resultEntity)); }