Exemplo n.º 1
0
 /// <summary>
 /// 输出模型
 /// </summary>
 /// <param name="AttachmentInfoDto"></param>
 /// <param name="AttachmentInfo"></param>
 public AttachmentOut(PagedResultDto <AttachmentService> AttachmentInfoDto, AttachmentIn AttachmentInfo)
 {
     Items          = AttachmentInfoDto.Items;
     TotalCount     = AttachmentInfoDto.TotalCount;
     TotalPage      = AttachmentInfoDto.TotalCount / AttachmentInfo.MaxResultCount;
     SkipCount      = AttachmentInfo.SkipCount;
     MaxResultCount = AttachmentInfo.MaxResultCount;
 }
Exemplo n.º 2
0
        public async Task <IList <ReplyDetail> > ReplyDetailList(AttachmentIn AttachmentIn)
        {
            var query     = _repository.GetAll().Where(t => !t.IsDelete);
            var querylist = from a in query
                            where  a.ConsultNumber == AttachmentIn.ConsultNumber
                            select new ReplyDetail
            {
                ReplyId            = a.ServiceID,
                ConsultNumber      = a.ConsultNumber,
                ReplyNumber        = a.ServiceNumber,
                FileName           = a.Filename,
                FileSize           = a.FileSize.ToString(),
                Mediatype          = a.FileType,
                ConsultID          = a.ConsultID,
                ServiceType        = a.FileFrom,
                CreatedOn          = a.CreatedOn,
                Message            = a.FileAddress,
                FileContentAddress = a.FileContentAddress,
                FileTotalTime      = a.FileTotalTime,
                Id = a.Id
            };

            return(await querylist.ToListAsync());
        }
Exemplo n.º 3
0
        public async Task <PagedResultDto <AttachmentService> > AttachmentServicePage(AttachmentIn AttachmentInfo)
        {
            //初步过滤
            var query = _repository.GetAll().OrderByDescending(a => a.CreatedOn).Where(AttachmentInfo.Expression);
            //获取总数
            var tasksCount = query.Count();
            //获取总数
            var totalpage      = tasksCount / AttachmentInfo.MaxResultCount;
            var AttachmentList = await query.PageBy(AttachmentInfo.SkipTotal, AttachmentInfo.MaxResultCount).ToListAsync();

            return(new PagedResultDto <AttachmentService>(tasksCount, AttachmentList.MapTo <List <AttachmentService> >()));
        }
Exemplo n.º 4
0
        public async Task <IList <AttachmentService> > AttachmentList(AttachmentIn AttachmentsInfo)
        {
            var Attachments = await _repository.GetAllListAsync(AttachmentsInfo.Expression);

            return(Attachments.ToList());
        }