예제 #1
0
        //Страница бронирования мест
        //Id - это id сеанса(Schedule)
        public IActionResult OnGet(int id)
        {
            Id = id;
            //Не авторизован - на главную станицу
            if (!_authService.IsAuthenticated)
            {
                return(Redirect(Url.Content("~/")));
            }
            var schedule = ScheduleDAO.GetSchedule($"id_schedule = {id}").FirstOrDefault();

            schedule.Hall = ScheduleDAO.GetHallByScheduleId(id);

            var bookings = BookingDAO.GetBookingByScheduleId(id);

            foreach (var booking in bookings)
            {
                booking.Schedule = schedule;
            }

            BookingPageViewModel = new BookingPageViewModel
            {
                //Передаем сеанс с указаным id
                Schedule = schedule,
                //Передаем все бронирования на этот сеанс
                BookingsInSchedule = bookings
            };
            return(Page());
        }
 public BookingPage(List <Spot> selectedSpots, Seance seance, string selectedHour)
 {
     InitializeComponent();
     _viewModel       = new BookingPageViewModel(selectedSpots, seance, selectedHour);
     this.DataContext = _viewModel;
 }
 public BookingPage()
 {
     this.InitializeComponent();
     this.bookingPageViewModel = new BookingPageViewModel();
     tempUser = LogInViewModel.User;
 }
예제 #4
0
 public BookingPage()
 {
     InitializeComponent();
     BindingContext = ViewModel = new BookingPageViewModel(Navigation);
 }