public async Task <ActionResult <List <RepairTicket_DirectSalesOrderDTO> > > SingleListDirectSalesOrder([FromBody] RepairTicket_DirectSalesOrderFilterDTO RepairTicket_DirectSalesOrderFilterDTO) { if (UnAuthorization) { return(Forbid()); } if (!ModelState.IsValid) { throw new BindException(ModelState); } DirectSalesOrderFilter DirectSalesOrderFilter = new DirectSalesOrderFilter(); DirectSalesOrderFilter.Skip = 0; DirectSalesOrderFilter.Take = int.MaxValue; DirectSalesOrderFilter.Take = 20; DirectSalesOrderFilter.OrderBy = DirectSalesOrderOrder.Id; DirectSalesOrderFilter.OrderType = OrderType.ASC; DirectSalesOrderFilter.Selects = DirectSalesOrderSelect.ALL; DirectSalesOrderFilter.Code = RepairTicket_DirectSalesOrderFilterDTO.Code; List <DirectSalesOrder> DirectSalesOrderes = await DirectSalesOrderService.List(DirectSalesOrderFilter); List <RepairTicket_DirectSalesOrderDTO> RepairTicket_DirectSalesOrderDTOs = DirectSalesOrderes .Select(x => new RepairTicket_DirectSalesOrderDTO(x)).ToList(); return(RepairTicket_DirectSalesOrderDTOs); }
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); }