public ActionResult SetPrices(int hotelID) { var info = hotelRepository.GetHotelInfo(hotelID, SessionHelper.CurrentEntity.EntityID); if (info == null) { return(RedirectBackWithError("Hotel does not exist!")); } if (info.HotelRights.CanSetPrices == false) { return(RedirectBackWithError("You cannot manage prices in this hotel!")); } var price = hotelRepository.GetGotelPrice(hotelID); var vm = new HotelPricesViewModel(price, info); return(View(vm)); }
public ActionResult SetPrices(int hotelID, decimal?price1, decimal?price2, decimal?price3, decimal?price4, decimal?price5) { var info = hotelRepository.GetHotelInfo(hotelID, SessionHelper.CurrentEntity.EntityID); if (info == null) { return(RedirectBackWithError("Hotel does not exist!")); } if (info.HotelRights.CanSetPrices == false) { return(RedirectBackWithError("You cannot manage prices in this hotel!")); } hotelService.SetPrices(hotelID, price1, price2, price3, price4, price5); AddSuccess("Prices has been set!"); var price = hotelRepository.GetGotelPrice(hotelID); var vm = new HotelPricesViewModel(price, info); return(View(vm)); }