示例#1
0
        public async Task <ActionResult <List <CustomerGrouping_CustomerTypeDTO> > > FilterListCustomerType([FromBody] CustomerGrouping_CustomerTypeFilterDTO CustomerGrouping_CustomerTypeFilterDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }

            CustomerTypeFilter CustomerTypeFilter = new CustomerTypeFilter();

            CustomerTypeFilter.Skip      = 0;
            CustomerTypeFilter.Take      = 20;
            CustomerTypeFilter.OrderBy   = CustomerTypeOrder.Id;
            CustomerTypeFilter.OrderType = OrderType.ASC;
            CustomerTypeFilter.Selects   = CustomerTypeSelect.ALL;
            CustomerTypeFilter.Id        = CustomerGrouping_CustomerTypeFilterDTO.Id;
            CustomerTypeFilter.Code      = CustomerGrouping_CustomerTypeFilterDTO.Code;
            CustomerTypeFilter.Name      = CustomerGrouping_CustomerTypeFilterDTO.Name;

            List <CustomerType> CustomerTypes = await CustomerTypeService.List(CustomerTypeFilter);

            List <CustomerGrouping_CustomerTypeDTO> CustomerGrouping_CustomerTypeDTOs = CustomerTypes
                                                                                        .Select(x => new CustomerGrouping_CustomerTypeDTO(x)).ToList();

            return(CustomerGrouping_CustomerTypeDTOs);
        }
        public async Task <List <TicketReport_CustomerTypeDTO> > FilterListCustomerType([FromBody] TicketReport_CustomerTypeFilterDTO TicketReport_CustomerTypeFilterDTO)
        {
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }

            CustomerTypeFilter CustomerTypeFilter = new CustomerTypeFilter();

            CustomerTypeFilter.Skip      = 0;
            CustomerTypeFilter.Take      = 20;
            CustomerTypeFilter.OrderBy   = CustomerTypeOrder.Id;
            CustomerTypeFilter.OrderType = OrderType.ASC;
            CustomerTypeFilter.Selects   = CustomerTypeSelect.ALL;
            CustomerTypeFilter.Id        = TicketReport_CustomerTypeFilterDTO.Id;
            CustomerTypeFilter.Name      = TicketReport_CustomerTypeFilterDTO.Name;
            CustomerTypeFilter.Code      = TicketReport_CustomerTypeFilterDTO.Code;

            List <CustomerType> CustomerTypes = await CustomerTypeService.List(CustomerTypeFilter);

            List <TicketReport_CustomerTypeDTO> TicketReport_CustomerTypeDTOs = CustomerTypes
                                                                                .Select(x => new TicketReport_CustomerTypeDTO(x)).ToList();

            return(TicketReport_CustomerTypeDTOs);
        }