Example #1
0
        public ActionResult Index()
        {
            var model = new GetT_EstimateInput {
                FilterText = Request.QueryString["filterText"]
            };

            return(View(model));
        }
Example #2
0
        public async Task <FileDto> GetT_EstimateToExcel(GetT_EstimateInput input)
        {
            var auditLogs = await _t_EstimateRepository.GetAll().WhereIf(input.FK_ClassId >= 1, o => o.FK_ClassId == input.FK_ClassId)
                            .AsNoTracking()
                            .OrderByDescending(al => al.Id)
                            .ToListAsync();

            // var auditLogListDtos = ConvertToAuditLogListDtos(auditLogs);
            var exportList = auditLogs.MapTo <List <ExportListDto> >();

            return(excelExporter.ExportToFile(auditLogs.MapTo <List <T_EstimateListDto> >()));
        }
Example #3
0
        /// <summary>
        /// 根据查询条件获取老师评价结果表分页列表
        /// </summary>
        public async Task <PagedResultDto <T_EstimateListDto> > GetPagedT_EstimatesAsync(GetT_EstimateInput input)
        {
            var query = _t_EstimateRepository.GetAll().WhereIf(input.FK_ClassId >= 1, _ => _.FK_ClassId == input.FK_ClassId);
            //TODO:根据传入的参数添加过滤条件

            var t_EstimateCount = await query.CountAsync();

            var t_Estimates = await query
                              .OrderBy(input.Sorting)
                              .PageBy(input)
                              .ToListAsync();

            var t_EstimateListDtos = t_Estimates.MapTo <List <T_EstimateListDto> >();

            if (t_EstimateListDtos.Count >= 1)
            {
                List <T_EstimateListDto> output = new List <T_EstimateListDto>();
                for (int index = 0; index <= t_EstimateListDtos.Count - 1; index++)
                {
                    output.Add(new T_EstimateListDto()
                    {
                        vContent     = t_EstimateListDtos[index].T_Content.Content,
                        ContentCount = t_EstimateListDtos[index].ContentCount,
                        vGrade       = t_EstimateListDtos[index].T_Grade.Grade
                    });
                }
                return(new PagedResultDto <T_EstimateListDto>(
                           t_EstimateCount, output
                           ));
            }

            return(new PagedResultDto <T_EstimateListDto>(t_EstimateCount, t_EstimateListDtos));
        }