Beispiel #1
0
 public ActionResult SaveForm(string keyValue, AssessmentPlanEntity entity, [System.Web.Http.FromBody] string dataJson)
 {
     if (string.IsNullOrEmpty(keyValue))//新增
     {
         entity.Status = "进行中";
         entity.IsLock = "锁定";
     }
     assessmentplanbll.SaveForm(keyValue, entity);
     //保存关联的从表记录
     if (dataJson.Length > 0)
     {
         AssessmentSumBLL           safeproductPbll = new AssessmentSumBLL();
         List <AssessmentSumEntity> list            = Newtonsoft.Json.JsonConvert.DeserializeObject <List <AssessmentSumEntity> >(dataJson);
         foreach (AssessmentSumEntity data in list)
         {
             if (string.IsNullOrEmpty(keyValue))
             {
                 data.Reserve     = "未筛选"; //筛选状态
                 data.GradeStatus = "未评分"; //评分状态
                 safeproductPbll.SaveForm("", data);
             }
             else
             {
                 var sumentity = safeproductPbll.GetEntity(data.ChapterID);//修改时,sumid为自评总结主键id
                 sumentity.DutyName = data.DutyName;
                 sumentity.DutyID   = data.DutyID;
                 safeproductPbll.SaveForm(sumentity.Id, sumentity);
             }
         }
     }
     return(Success("操作成功。"));
 }
 public ActionResult SaveForm(string keyValue, AssessmentSumEntity entity)
 {
     assessmentsumbll.SaveForm(keyValue, entity);
     return(Success("操作成功。"));
 }