Esempio n. 1
0
        private void GolfClock_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var checkDate = ViewModel.SelectedDate;

            var time    = e.AddedItems[0].ToString();
            int hours   = Convert.ToInt32(time.Substring(0, 2));
            int minutes = Convert.ToInt32(time.Substring(3, 2));

            var dateTime = new DateTime(checkDate.Year, checkDate.Month, checkDate.Day, hours, minutes, 0);

            var roomName = (string)(sender as RadClock).Header;

            var bookingsService = new BookingsService()
            {
                BookedRooms     = ViewModel.RoomBookings,
                BookedCaterings = ViewModel.CateringsBookings,
                BookedGolfs     = ViewModel.GolfBookings
            };

            var _event = bookingsService.GetModelByGolf(roomName, dateTime);

            if (_event != null)
            {
                this.IsEnabled = false;

                var view = new EventDetailsView(new EventModel(_event));
                view.ShowDialog();

                this.IsEnabled = true;

                // ViewModel.Refresh();
            }
        }