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

            DirectSalesOrderFilter DirectSalesOrderFilter = ConvertFilterDirectSalesOrder(Contact_DirectSalesOrderFilterDTO);

            DirectSalesOrderFilter = await DirectSalesOrderService.ToFilter(DirectSalesOrderFilter);

            int count = await DirectSalesOrderService.Count(DirectSalesOrderFilter);

            return(count);
        }
Exemplo n.º 2
0
        public async Task <ActionResult <List <Contact_DirectSalesOrderDTO> > > ListDirectSalesOrder([FromBody] Contact_DirectSalesOrderFilterDTO Contact_DirectSalesOrderFilterDTO)
        {
            if (UnAuthorization)
            {
                return(Forbid());
            }
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }

            DirectSalesOrderFilter DirectSalesOrderFilter = ConvertFilterDirectSalesOrder(Contact_DirectSalesOrderFilterDTO);

            DirectSalesOrderFilter = await DirectSalesOrderService.ToFilter(DirectSalesOrderFilter);

            List <DirectSalesOrder> DirectSalesOrders = await DirectSalesOrderService.List(DirectSalesOrderFilter);

            List <Contact_DirectSalesOrderDTO> Contact_DirectSalesOrderDTOs = DirectSalesOrders
                                                                              .Select(c => new Contact_DirectSalesOrderDTO(c)).ToList();

            return(Contact_DirectSalesOrderDTOs);
        }