Exemple #1
0
        public async Task <ActionResult> AdjustPrice(
            AdjustPriceViewModel adjustPriceViewModel)
        {
            var rental = GetRental(adjustPriceViewModel.Rental.Id);

            rental.AdjustPrice(adjustPriceViewModel.AdjustPrice);
            await Context.Rentals
            .ReplaceOneAsync(r => r.Id == adjustPriceViewModel.Rental.Id, rental);

            return(RedirectToAction("Index"));
        }
Exemple #2
0
        public ActionResult AdjustPrice(string id)
        {
            return(View(new AdjustPriceViewModel {
                Rental = GetRental(id),
                AdjustPrice = new AdjustPrice()
            }));

            var model = new AdjustPriceViewModel
            {
                Rental = GetRental(id)
            };

            return(View(model));
        }