public async Task <ProjetoFluxoTrabalhoStatus> GetById(ProjetoFluxoTrabalhoStatusFilter model)
        {
            var _projetofluxotrabalhostatus = await this.SingleOrDefaultAsync(this.GetAll(this.DataAgregation(model))
                                                                              .Where(_ => _.ProjetoId == model.ProjetoId).Where(_ => _.FluxoTrabalhoStatusId == model.FluxoTrabalhoStatusId));

            return(_projetofluxotrabalhostatus);
        }
        public async Task <dynamic> GetDataCustom(ProjetoFluxoTrabalhoStatusFilter filters)
        {
            var querybase = await this.ToListAsync(this.GetBySimplefilters(filters).Select(_ => new
            {
                Id = _.ProjetoId,
            }));

            return(querybase);
        }
        public IQueryable <ProjetoFluxoTrabalhoStatus> GetBySimplefilters(ProjetoFluxoTrabalhoStatusFilter filters)
        {
            var querybase = this.GetAll(this.DataAgregation(filters))
                            .WithBasicFilters(filters)
                            .WithCustomFilters(filters)
                            .OrderByDomain(filters)
                            .OrderByProperty(filters);

            return(querybase);
        }
        public async Task <IActionResult> Get([FromQuery] ProjetoFluxoTrabalhoStatusFilter filters)
        {
            var result = new HttpResult <ProjetoFluxoTrabalhoStatusDto>(this._logger);

            try
            {
                var searchResult = await this._app.GetByFilters(filters);

                return(result.ReturnCustomResponse(this._app, searchResult, filters));
            }
            catch (Exception ex)
            {
                return(result.ReturnCustomException(ex, "Target.Pendencias - ProjetoFluxoTrabalhoStatus", filters));
            }
        }
        public async Task <IActionResult> Get(int id, [FromQuery] ProjetoFluxoTrabalhoStatusFilter filters)
        {
            var result = new HttpResult <ProjetoFluxoTrabalhoStatusDto>(this._logger);

            try
            {
                filters.ProjetoId = id;
                var returnModel = await this._app.GetOne(filters);

                return(result.ReturnCustomResponse(this._app, returnModel));
            }
            catch (Exception ex)
            {
                return(result.ReturnCustomException(ex, "Target.Pendencias - ProjetoFluxoTrabalhoStatus", id));
            }
        }
예제 #6
0
        public async Task <IActionResult> Get([FromQuery] ProjetoFluxoTrabalhoStatusFilter filters)
        {
            var result = new HttpResult <dynamic>(this._logger);

            try
            {
                if (filters.FilterBehavior == FilterBehavior.GetDataItem)
                {
                    var searchResult = await this._rep.GetDataItem(filters);

                    return(result.ReturnCustomResponse(searchResult, filters));
                }

                if (filters.FilterBehavior == FilterBehavior.GetDataCustom)
                {
                    var searchResult = await this._rep.GetDataCustom(filters);

                    return(result.ReturnCustomResponse(searchResult, filters));
                }

                if (filters.FilterBehavior == FilterBehavior.GetDataListCustom)
                {
                    var searchResult = await this._rep.GetDataListCustom(filters);

                    return(result.ReturnCustomResponse(searchResult, filters));
                }

                if (filters.FilterBehavior == FilterBehavior.Export)
                {
                    var searchResult = await this._rep.GetDataListCustom(filters);

                    var export = new ExportExcelCustom <dynamic>(filters);
                    var file   = export.ExportFile(this.Response, searchResult, "ProjetoFluxoTrabalhoStatus");
                    return(File(file, export.ContentTypeExcel(), export.GetFileName()));
                }

                throw new InvalidOperationException("invalid FilterBehavior");
            }
            catch (Exception ex)
            {
                return(result.ReturnCustomException(ex, "Target.Pendencias - ProjetoFluxoTrabalhoStatus", filters));
            }
        }
예제 #7
0
        public static IQueryable <ProjetoFluxoTrabalhoStatus> WithBasicFilters(this IQueryable <ProjetoFluxoTrabalhoStatus> queryBase, ProjetoFluxoTrabalhoStatusFilter filters)
        {
            var queryFilter = queryBase;

            if (filters.ProjetoId.IsSent())
            {
                queryFilter = queryFilter.Where(_ => _.ProjetoId == filters.ProjetoId);
            }
            if (filters.FluxoTrabalhoStatusId.IsSent())
            {
                queryFilter = queryFilter.Where(_ => _.FluxoTrabalhoStatusId == filters.FluxoTrabalhoStatusId);
            }


            return(queryFilter);
        }
        public static IQueryable <ProjetoFluxoTrabalhoStatus> WithCustomFilters(this IQueryable <ProjetoFluxoTrabalhoStatus> queryBase, ProjetoFluxoTrabalhoStatusFilter filters)
        {
            var queryFilter = queryBase;


            return(queryFilter);
        }
        public virtual Task <PaginateResult <ProjetoFluxoTrabalhoStatus> > GetByFiltersPaging(ProjetoFluxoTrabalhoStatusFilter filters)
        {
            var queryBase = this._rep.GetBySimplefilters(filters);

            return(this._rep.PagingAndDefineFields(filters, queryBase));
        }
        public virtual async Task <IEnumerable <ProjetoFluxoTrabalhoStatus> > GetByFilters(ProjetoFluxoTrabalhoStatusFilter filters)
        {
            var queryBase = this._rep.GetBySimplefilters(filters);

            return(await this._rep.ToListAsync(queryBase));
        }
 public virtual async Task <ProjetoFluxoTrabalhoStatus> GetOne(ProjetoFluxoTrabalhoStatusFilter filters)
 {
     return(await this._rep.GetById(filters));
 }
 public static IQueryable <ProjetoFluxoTrabalhoStatus> OrderByDomain(this IQueryable <ProjetoFluxoTrabalhoStatus> queryBase, ProjetoFluxoTrabalhoStatusFilter filters)
 {
     return(queryBase.OrderBy(_ => _.ProjetoId).ThenBy(_ => _.FluxoTrabalhoStatusId));
 }