Beispiel #1
0
        public async Task <IActionResult> GetProductsAsync(Int32?pageSize = 10, Int32?pageNumber = 1)
        {
            Logger?.LogInformation("{0} has been invoked", nameof(GetProductsAsync));

            var response = await ProductionBusinessObject.GetProductsAsync((Int32)pageSize, (Int32)pageNumber);

            return(response.ToHttpResponse());
        }
        public async Task <IActionResult> GetCreateOrderRequestAsync()
        {
            Logger?.LogInformation("{0} has been invoked", nameof(GetCreateOrderRequestAsync));

            var response = new SingleModelResponse <CreateOrderViewModel>() as ISingleModelResponse <CreateOrderViewModel>;

            var customersResponse = await SalesBusinessObject.GetCustomersAsync();

            response.Model.Customers = customersResponse.Model.Select(item => new CustomerViewModel(item));

            var employeesResponse = await HumanResourcesBusinessObject.GetEmployeesAsync();

            response.Model.Employees = employeesResponse.Model.Select(item => new EmployeeViewModel(item));

            var shippersResponse = await SalesBusinessObject.GetShippersAsync();

            response.Model.Shippers = shippersResponse.Model.Select(item => new ShipperViewModel(item));

            var productsResponse = await ProductionBusinessObject.GetProductsAsync();

            response.Model.Products = productsResponse.Model.Select(item => new ProductViewModel(item));

            return(response.ToHttpResponse());
        }