/// <summary> /// 得到附件信息(查询) /// </summary> /// <param name="dtolist"></param> /// <returns></returns> public List <AttachFileResultDTO> GetAttachFileList(AttachFileSearchDTO dto) { List <AttachFileResultDTO> result = null; var tcdmse = SingleQueryObject.GetObj(); var pp = tcdmse.common_AttachFileInfo.AsNoTracking().Where(p => p.AttachFileID != null); if (dto.AttachFileID != null) { pp = pp.Where(p => p.AttachFileID == dto.AttachFileID); } else { if (dto.BelongModule != null) { pp = pp.Where(p => p.BelongModule == dto.BelongModule); if (!string.IsNullOrEmpty(dto.BelongModulePrimaryKey)) { pp = pp.Where(p => p.BelongModulePrimaryKey == dto.BelongModulePrimaryKey); } } } result = Mapper.Map <List <common_AttachFileInfo>, List <AttachFileResultDTO> >(pp.ToList()); return(result); }
public static AttachFileResultDTO GetAttachFileList(AttachFileSearchDTO dto) { AttachFileResultDTO result = null; var pp = GetAPI <List <AttachFileResultDTO> >(WebConfiger.MasterDataServicesUrl + "AttachFile?AttachFileSearchDTO=" + TransformHelper.ConvertDTOTOBase64JsonString(dto)); if (pp.Count() > 0) { result = pp.FirstOrDefault(); } return(result); }
public HttpResponseMessage GetAttachFileList(string AttachFileSearchDTO) { List <AttachFileResultDTO> actionresult = new List <AttachFileResultDTO>(); AttachFileSearchDTO dto = TransformHelper.ConvertBase64JsonStringToDTO <AttachFileSearchDTO>(AttachFileSearchDTO); actionresult = _ICommonServices.GetAttachFileList(dto); HttpResponseMessage result = new HttpResponseMessage { Content = new StringContent(JsonConvert.SerializeObject(actionresult), System.Text.Encoding.GetEncoding("UTF-8"), "application/json") }; return(result); }
/// <summary> /// 得到一条用户申请信息 /// </summary> /// <param name="dto"></param> /// <returns></returns> public ActionResult GetOneUserApply(UserApplySearchDTO dto) { ResultData <UserApplyResultDTOModel> result = new ResultData <UserApplyResultDTOModel>(); DistributorSearchDTO disdto = new DistributorSearchDTO(); try { string strSaveDir = this.Server.MapPath("~/Attachments"); result = UserAuthorityProvider.GetOneUserApply(dto); result.SubmitResult = true; string ViewdisNameStr = ""; if (!string.IsNullOrEmpty(result.Object.DistributorIDList)) { //查询经销商ID字符串转List string disString = string.Empty; string Disstr = result.Object.DistributorIDList; List <string> DisList = new List <string>(); Disstr.Split(',').ToList().ForEach(g => { disString = g.Trim(); if (!string.IsNullOrEmpty(disString)) { DisList.Add(disString); } }); //根据经销商ID的List查询到经销商的姓名,并且拼接成字符串 foreach (var q in DisList) { Guid guid = new Guid(q); disdto.DistributorID = guid; disdto.rows = 10000; disdto.page = 1; var OneDisName = DistributorProvider.GetOneDistributor(disdto); var DisName = OneDisName.Object.DistributorName; ViewdisNameStr += DisName + ","; } } result.Object.DistributorIDList = ViewdisNameStr; if (result.Object.BatchID != null) { AttachFileSearchDTO attdto = new AttachFileSearchDTO(); attdto.BelongModule = 2; attdto.BelongModulePrimaryKey = result.Object.BatchID.Value.ToString(); var att = UserAuthorityProvider.GetAttachFileList(attdto); if (att != null) { result.Object.AttName = att.AttachFileName; result.Object.AttSrcName = att.AttachFileSrcName; result.Object.AttExtentionName = att.AttachFileExtentionName; result.Object.IsAtt = true; } } } catch (Exception ex) { result.SubmitResult = false; result.Message = ex.Message; } return(Json(result, JsonRequestBehavior.AllowGet)); }