// GET: Rentals/Create
        public async Task <IActionResult> Create()
        {
            var customers = await _customersService.GetAllAsync();

            var books = await _booksService.GetAllAvailableAsync();

            ViewData["BookId"]     = new SelectList(books, "Id", "Title");
            ViewData["CustomerId"] = new SelectList(customers, "Id", "FullName");
            return(View());
        }
Пример #2
0
        public async Task <Page <Customer> > Get([FromQuery] PagingOptions pagingOptions, [FromQuery] bool getVehicles = true, [FromQuery] SearchVehicleStatus vehicleStatus = SearchVehicleStatus.Any)
        {
            //Set default paging options if no paging configuration passed
            pagingOptions.Offset = pagingOptions.Offset ?? _defaultPagingOptions.Offset;
            pagingOptions.Limit  = pagingOptions.Limit ?? _defaultPagingOptions.Limit;

            return(await _customersService.GetAllAsync(pagingOptions, getVehicles, vehicleStatus));
        }
Пример #3
0
        public async Task <IActionResult> SearchAsync()
        {
            try
            {
                var customer = await customersService.GetAllAsync();

                var sales = await salesService.GetAllAsync();

                var result = new
                {
                    Customer = customer,
                    Sales    = sales
                };

                return(Ok(result));
            }
            catch (Exception)
            {
                throw;
            }
        }
 public async Task <IHttpActionResult> get(int pageNum, int pageSize, char type)
 {
     return(Ok(await customerService.GetAllAsync(pageNum, pageSize, type)));
 }
 // GET: Customers
 public async Task <IActionResult> Index()
 {
     return(View(await _customersService.GetAllAsync()));
 }