public async Task <ActionResult <List <RepairTicket_CustomerSalesOrderDTO> > > SingleListCustomerSalesOrder([FromBody] RepairTicket_CustomerSalesOrderFilterDTO RepairTicket_CustomerSalesOrderFilterDTO) { if (UnAuthorization) { return(Forbid()); } if (!ModelState.IsValid) { throw new BindException(ModelState); } CustomerSalesOrderFilter CustomerSalesOrderFilter = new CustomerSalesOrderFilter(); CustomerSalesOrderFilter.Skip = 0; CustomerSalesOrderFilter.Take = int.MaxValue; CustomerSalesOrderFilter.Take = 20; CustomerSalesOrderFilter.OrderBy = CustomerSalesOrderOrder.Id; CustomerSalesOrderFilter.OrderType = OrderType.ASC; CustomerSalesOrderFilter.Selects = CustomerSalesOrderSelect.ALL; CustomerSalesOrderFilter.Code = RepairTicket_CustomerSalesOrderFilterDTO.Code; List <CustomerSalesOrder> CustomerSalesOrderes = await CustomerSalesOrderService.List(CustomerSalesOrderFilter); List <RepairTicket_CustomerSalesOrderDTO> RepairTicket_CustomerSalesOrderDTOs = CustomerSalesOrderes .Select(x => new RepairTicket_CustomerSalesOrderDTO(x)).ToList(); return(RepairTicket_CustomerSalesOrderDTOs); }
public async Task <ActionResult <Contact_CustomerSalesOrderDTO> > GetCustomerSalesOrder([FromBody] Contact_CustomerSalesOrderDTO Contact_CustomerSalesOrderDTO) { if (UnAuthorization) { return(Forbid()); } if (!ModelState.IsValid) { throw new BindException(ModelState); } CustomerSalesOrder CustomerSalesOrder = await CustomerSalesOrderService.Get(Contact_CustomerSalesOrderDTO.Id); return(new Contact_CustomerSalesOrderDTO(CustomerSalesOrder)); }
public async Task <ActionResult <int> > CountCustomerSalesOrder([FromBody] Contact_CustomerSalesOrderFilterDTO Contact_CustomerSalesOrderFilterDTO) { if (UnAuthorization) { return(Forbid()); } if (!ModelState.IsValid) { throw new BindException(ModelState); } CustomerSalesOrderFilter CustomerSalesOrderFilter = ConvertFilterCustomerSalesOrder(Contact_CustomerSalesOrderFilterDTO); CustomerSalesOrderFilter = await CustomerSalesOrderService.ToFilter(CustomerSalesOrderFilter); int count = await CustomerSalesOrderService.Count(CustomerSalesOrderFilter); return(count); }
public async Task <ActionResult <List <Contact_CustomerSalesOrderDTO> > > ListCustomerSalesOrder([FromBody] Contact_CustomerSalesOrderFilterDTO Contact_CustomerSalesOrderFilterDTO) { if (UnAuthorization) { return(Forbid()); } if (!ModelState.IsValid) { throw new BindException(ModelState); } CustomerSalesOrderFilter CustomerSalesOrderFilter = ConvertFilterCustomerSalesOrder(Contact_CustomerSalesOrderFilterDTO); CustomerSalesOrderFilter = await CustomerSalesOrderService.ToFilter(CustomerSalesOrderFilter); List <CustomerSalesOrder> CustomerSalesOrders = await CustomerSalesOrderService.List(CustomerSalesOrderFilter); List <Contact_CustomerSalesOrderDTO> Contact_CustomerSalesOrderDTOs = CustomerSalesOrders .Select(c => new Contact_CustomerSalesOrderDTO(c)).ToList(); return(Contact_CustomerSalesOrderDTOs); }