/// <summary> /// 修改资质模型 /// </summary> /// <param name="certificateEdit"></param> /// <returns></returns> public ActionResult <bool> EditDocCertificate(DocCertificateEdit certificateEdit) { try { var dbdc = _rpsdc.GetModel(certificateEdit.ID); if (dbdc == null) { throw new Exception("未找到所需修改的资质模型"); } var check = _rpsdc.Any(p => p.ID != certificateEdit.ID && p.Name == certificateEdit.Name && p.TypeID == certificateEdit.TypeID && p.Owner == certificateEdit.Owner); if (check) { throw new Exception("该资质类型下已存在该资质"); } dbdc = certificateEdit.CopyTo <Doc_Certificate>(dbdc); //电子文档 srvFile.DelFileByBusinessId(dbdc.ID); var files = new AttachFileSave { BusinessID = dbdc.ID, files = from f in certificateEdit.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); } _rpsdc.Update(dbdc); _work.Commit(); return(new ActionResult <bool>(true)); } catch (Exception ex) { return(new ActionResult <bool>(ex)); } }
public ActionResult <bool> EditDocCertificate(DocCertificateEdit certificateEdit) { LogContent = "修改了资质模型,参数源:" + JsonConvert.SerializeObject(certificateEdit); return(bll.EditDocCertificate(certificateEdit)); }