public ActionResult ExecuteImportScheme(string templateId, string fileId, int chunks, string ext) { UserInfo userInfo = LoginUserInfo.Get(); string path = annexesFileIBLL.SaveAnnexes(fileId, fileId + "." + ext, chunks, userInfo); if (!string.IsNullOrEmpty(path)) { // 读取导入文件 string data = DirFileHelper.ReadText(path); // 删除临时文件 DirFileHelper.DeleteFile2(path); if (!string.IsNullOrEmpty(data)) { NWFSchemeModel nWFSchemeModel = data.ToObject <NWFSchemeModel>(); // 验证流程编码是否重复 NWFSchemeInfoEntity schemeInfoEntityTmp = nWFSchemeIBLL.GetInfoEntityByCode(nWFSchemeModel.info.F_Code); if (schemeInfoEntityTmp != null) { nWFSchemeModel.info.F_Code = Guid.NewGuid().ToString(); } nWFSchemeIBLL.SaveEntity("", nWFSchemeModel.info, nWFSchemeModel.scheme, nWFSchemeModel.authList); } return(Success("导入成功")); } else { return(Fail("导入模板失败!")); } }
public ActionResult SaveForm(string keyValue, string schemeInfo, string shcemeAuth, string scheme, int type) { NWFSchemeInfoEntity schemeInfoEntity = schemeInfo.ToObject <NWFSchemeInfoEntity>(); List <NWFSchemeAuthEntity> nWFSchemeAuthList = shcemeAuth.ToObject <List <NWFSchemeAuthEntity> >(); NWFSchemeEntity schemeEntity = new NWFSchemeEntity(); schemeEntity.F_Content = scheme; schemeEntity.F_Type = type; // 验证流程编码是否重复 NWFSchemeInfoEntity schemeInfoEntityTmp = nWFSchemeIBLL.GetInfoEntityByCode(schemeInfoEntity.F_Code); if (schemeInfoEntityTmp != null && schemeInfoEntityTmp.F_Id != keyValue) { return(Fail("流程编码重复")); } nWFSchemeIBLL.SaveEntity(keyValue, schemeInfoEntity, schemeEntity, nWFSchemeAuthList); return(Success("保存成功!")); }
public void ExportScheme(string code) { NWFSchemeInfoEntity schemeInfoEntity = nWFSchemeIBLL.GetInfoEntityByCode(code); if (schemeInfoEntity != null) { NWFSchemeEntity schemeEntity = nWFSchemeIBLL.GetSchemeEntity(schemeInfoEntity.F_SchemeId); var nWFSchemeAuthList = nWFSchemeIBLL.GetAuthList(schemeInfoEntity.F_Id); var jsonData = new { info = schemeInfoEntity, scheme = schemeEntity, authList = nWFSchemeAuthList }; string data = jsonData.ToJson(); FileDownHelper.DownLoadString(data, schemeInfoEntity.F_Name + ".lrscheme"); } }
public ActionResult GetFormData(string code) { NWFSchemeInfoEntity schemeInfoEntity = nWFSchemeIBLL.GetInfoEntityByCode(code); if (schemeInfoEntity == null) { return(Success(new { })); } NWFSchemeEntity schemeEntity = nWFSchemeIBLL.GetSchemeEntity(schemeInfoEntity.F_SchemeId); var nWFSchemeAuthList = nWFSchemeIBLL.GetAuthList(schemeInfoEntity.F_Id); var jsonData = new { info = schemeInfoEntity, scheme = schemeEntity, authList = nWFSchemeAuthList }; return(Success(jsonData)); }