private List <string> _SelectDictionaryListString(string MethodName, List <Class_ParaArray> class_ParaArrays) { List <string> vs = new List <string>(); string ResultValue = class_RestClient.Post(MethodName, class_ParaArrays); return(JsonTools.JsonToObject(ResultValue, vs) as List <string>); }
public ResultVO <T> DownIniDictionary <T>() { ResultVO <T> resultVO = new ResultVO <T>(); string ResultValue = class_RestClient.Post("useAuthorityPageFeign/downIniDictionary", null, null, true); return(JsonTools.JsonToObject(ResultValue, resultVO, true) as ResultVO <T>); }
/// <summary> /// 登录远程方法 /// </summary> /// <typeparam name="T">泛型</typeparam> /// <param name="class_ParaArrays">参数列表</param> /// <returns></returns> public ResultVO <T> UseLogCS <T>(List <Class_ParaArray> class_ParaArrays) where T : class { ResultVO <T> resultVO = new ResultVO <T>(); string ResultValue = class_RestClient.Post("logFeign/useLogCS", class_ParaArrays); return(JsonTools.JsonToObject(ResultValue, resultVO) as ResultVO <T>); }
public Data(string folderPath) { rootPath = folderPath; var path = rootPath + "/" + Consts.AudioContributesJson; string data = File.ReadAllText(path); contributes = JsonTools.JsonToObject <Contributes>(data); }
public ResultVO <T> SelectVersionList <T>(PageVersionListInParam pageVersionListInParam) { ResultVO <T> resultVO = new ResultVO <T>(); string ResultValue = class_RestClient.Post("useAuthorityPageFeign/selectVersionList" , null , JsonTools.ObjectToJson(pageVersionListInParam) , true); return(JsonTools.JsonToObject(ResultValue, resultVO, true) as ResultVO <T>); }
/// <summary> /// 下载指定公司所有用户 /// </summary> /// <typeparam name="T"></typeparam> /// <param name="Company">公司全称</param> /// <param name="Page">当前页数</param> /// <param name="Limit">每页条数</param> /// <returns></returns> public ResultVOPage <T> DownAllUseByCompany <T>(string Company) { ResultVOPage <T> resultVO = new ResultVOPage <T>(); List <Class_ParaArray> class_ParaArrays = new List <Class_ParaArray>(); Class_ParaArray class_ParaArray = new Class_ParaArray(); class_ParaArray.ParaName = "companyName"; class_ParaArray.ParaValue = Company; class_ParaArrays.Add(class_ParaArray); string ResultValue = class_RestClient.Post("useAuthorityPageFeign/downAllUseByCompany", class_ParaArrays, null, true); return(JsonTools.JsonToObject(ResultValue, resultVO, true) as ResultVOPage <T>); }
private ResultVO <T> PrivateUploadFile <T>(string AllPathFileName, string FileName, string Operate, string FolderName) { List <Class_ParaArray> class_ParaArrays = new List <Class_ParaArray>(); try { Class_ParaArray class_ParaArrayFileName = new Class_ParaArray(); class_ParaArrayFileName.ParaName = "fileName"; class_ParaArrayFileName.ParaValue = FileName; class_ParaArrays.Add(class_ParaArrayFileName); if (FolderName != null) { Class_ParaArray class_ParaArrayFolderName = new Class_ParaArray(); class_ParaArrayFolderName.ParaName = "dictionary"; class_ParaArrayFolderName.ParaValue = FolderName; class_ParaArrays.Add(class_ParaArrayFolderName); } byte[] byteArray = FileBinaryConvertHelper.File2Bytes(AllPathFileName); ResultVO <T> resultVO = new ResultVO <T>(); string Url = "useAuthorityPageFeign/uploadFile"; if (FolderName == null) { Url = string.Format("useAuthorityPageFeign/uploadFile{0}", Operate); } string ResultValue = class_RestClient.PostBinary(Url , class_ParaArrays , byteArray, true); return(JsonTools.JsonToObject(ResultValue, resultVO) as ResultVO <T>); } catch (Exception error) { throw error; } finally { class_ParaArrays.Clear(); } }
/// <summary> /// 根据估价对象ID获得实例信息 /// </summary> /// <param name="objectId"></param> /// <param name="templateType"></param> /// <returns></returns> public List <_ChangeSortModel> GetObjectInstanceByProjectId(decimal projectId, EntrustItem businessType, decimal customerId) { List <_ChangeSortModel> result = new List <_ChangeSortModel>(); using (BaseDB dbHelper = new OmpdDBHelper()) { try { Dictionary <string, object> dic = new Dictionary <string, object>(); dic.Add("i_project_id", projectId); dic.Add("i_businessType", (int)businessType); List <_ObjectInstance> lst = dbHelper.ExecuteListProc <_ObjectInstance>("pkg_redas_instance_document.sp_ObjectInstance_Get", dic); string prjStructure = dic["O_PRJ_STRUCTURE"].ToString(); //获得构件的排序 IList <Document_structureModel> lstStructure = new Document_structureLogic().GetByCustomer(customerId, 0, 0); Dictionary <decimal, decimal> dicStructureAndSort = new Dictionary <decimal, decimal>(); //优先考虑项目是否已经保存排序,为保存则读取构件中的排序 List <_ProjectStructrue> lstPrjStructure = new List <_ProjectStructrue>(); //估价对象是否更换模板 bool isChangeMotherSet = false; if (!string.IsNullOrEmpty(prjStructure)) { lstPrjStructure = JsonTools.JsonToObject <List <_ProjectStructrue> >(prjStructure); //如果与数据库的模板不匹配 表示已更换模板,所以排序显示的是构件表中的排序 (多标的物) foreach (var info in lst) { //info.MOTHER_SET_ID if (lstPrjStructure.Where(p => p.MotherSetId == info.MOTHER_SET_ID).Count() <= 0) { isChangeMotherSet = true; break; } } } if (isChangeMotherSet || prjStructure == "") { foreach (var info in lstStructure) { dicStructureAndSort.Add(info.STRUCTURE_ID, info.SORT_NO); } } var sort = 0; foreach (var info in lst) { sort++; //实例中的所有构件 Dictionary <BlockType, List <_DocStructrue> > structureCofig = GetStructureDictionary(info.DOCUMENT_STRUCTURE); foreach (var dicConfig in structureCofig) { foreach (var structure in dicConfig.Value) { _ChangeSortModel model = new _ChangeSortModel(); model.Object_Name = info.OBJECT_NAME; model.StructureName = structure.Name; model.StructureType = ((int)dicConfig.Key).ToString(); model.SturctureId = structure.Key; model.Type = structure.Type; model.Sort = 0; //单标的物就按数据库中的顺序来 if (lst.Count == 1) { model.Sort = sort; } else { //并没有更改模板 且 数据库中已保存排序 if (!isChangeMotherSet && lstPrjStructure.Count > 0) { for (var i = 0; i < lstPrjStructure.Count(); i++) { if (lstPrjStructure[i].Key == structure.Key && lstPrjStructure[i].InstanceId == info.INSTANCE_DOCUMENT_ID) { model.Sort = i; break; } } } else if (model.Type == "Config") //只有用户上传的构件才有排序 { model.Sort = dicStructureAndSort[model.SturctureId]; } } model.Instance_document_id = info.INSTANCE_DOCUMENT_ID; model.MotherSetId = info.MOTHER_SET_ID; result.Add(model); } } } result = result.OrderBy(p => p.StructureType).ThenBy(p => p.Type).ThenBy(p => p.Sort).ToList(); } catch { } } return(result); }