/// <summary> /// 修改体检模型 /// </summary> /// <param name="docmentEdit"></param> /// <returns></returns> public ActionResult <bool> EditHealRecord(HealRecordsEdit recordsEdit) { try { var dbhr = _rpshr.GetModel(recordsEdit.ID); if (dbhr == null) { throw new Exception("未找到所要修改的体检信息!"); } var check = _rpshr.Any(p => p.ID != recordsEdit.ID && p.RecDate == recordsEdit.RecDate); if (check) { throw new Exception("该人员的体检信息已存在!"); } dbhr = recordsEdit.CopyTo <Heal_Records>(dbhr); //删除自定义项 srvUserDefined.DeleteBusinessValue(dbhr.ID); //自定义项 var definedvalue = new UserDefinedBusinessValue { BusinessID = dbhr.ID, Values = recordsEdit.UserDefineds }; var defined = srvUserDefined.SaveBuisnessValue(definedvalue); if (defined.state != 200) { throw new Exception(defined.msg); } //电子文档 srvFile.DelFileByBusinessId(dbhr.ID); var files = new AttachFileSave { BusinessID = dbhr.ID, files = from f in recordsEdit.AttachFiles select new AttachFileNew { FileTitle = f.FileTitle, FileType = f.FileType, FileUrl = f.FileUrl } }; var fre = srvFile.SaveFiles(files); if (fre.state != 200) { throw new Exception(fre.msg); } _rpshr.Update(dbhr); _work.Commit(); return(new ActionResult <bool>(true)); } catch (Exception ex) { return(new ActionResult <bool>(ex)); } }
public ActionResult <bool> EditHealRecord(HealRecordsEdit recordsEdit) { LogContent = "修改了体检信息,参数源:" + JsonConvert.SerializeObject(recordsEdit); return(bll.EditHealRecord(recordsEdit)); }