Ejemplo n.º 1
0
        public async Task <ActionResult <int> > CountActivity([FromBody] Opportunity_OpportunityActivityFilterDTO Opportunity_OpportunityActivityFilterDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }

            OpportunityActivityFilter OpportunityActivityFilter = ConvertFilterDTOToFilterEntity(Opportunity_OpportunityActivityFilterDTO);

            OpportunityActivityFilter = await OpportunityActivityService.ToFilter(OpportunityActivityFilter);

            int count = await OpportunityActivityService.Count(OpportunityActivityFilter);

            return(count);
        }
Ejemplo n.º 2
0
        public async Task <ActionResult <List <Opportunity_OpportunityActivityDTO> > > ListActivity([FromBody] Opportunity_OpportunityActivityFilterDTO Opportunity_OpportunityActivityFilterDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }

            OpportunityActivityFilter OpportunityActivityFilter = ConvertFilterDTOToFilterEntity(Opportunity_OpportunityActivityFilterDTO);

            OpportunityActivityFilter = await OpportunityActivityService.ToFilter(OpportunityActivityFilter);

            List <OpportunityActivity> OpportunityActivities = await OpportunityActivityService.List(OpportunityActivityFilter);

            List <Opportunity_OpportunityActivityDTO> Opportunity_OpportunityActivityDTOs = OpportunityActivities
                                                                                            .Select(c => new Opportunity_OpportunityActivityDTO(c)).ToList();

            return(Opportunity_OpportunityActivityDTOs);
        }