Пример #1
0
        private async void _parameters_defined(object sender, BookingParametersViewModel bookingParametersVM)
        {
            try
            {
                ParametersValidated = true;
                DateRange dateRange = new DateRange
                {
                    Start = _parameters.Start,
                    End   = _parameters.End
                };

                Options = await OptionsViewModel.CreateAsync(_booking, dateRange);

                RoomChoices = await RoomsChoiceViewModel.CreateAsync(dateRange);

                RoomChoices.AvailableRoomChoiceEntitiesView.Filter = _mustShowRoomChoice;

                _newClientCommand.ChangeCanExecute();
                _searchClientCommand.ChangeCanExecute();
                _validateBookingCommand.ChangeCanExecute();
            }
            catch (Exception ex)
            {
                Logger.Log(ex);
            }
        }
Пример #2
0
        private async Task _validateParameters()
        {
            try
            {
                _parametersValidated = true;
                bool newClientCanExecute       = _newClientCommand.CanExecute(null);
                bool searchClientCanExecute    = _searchClientCommand.CanExecute(null);
                bool validateBookingCanExecute = _validateBookingCommand.CanExecute(null);

                _handleCommandStates(newClientCanExecute, searchClientCanExecute, validateBookingCanExecute);

                DateRange dateRange = new DateRange
                {
                    Start = _parameters.Start,
                    End   = _parameters.End
                };
                Options = await OptionsViewModel.CreateAsync(_booking, dateRange);

                RoomChoices = await RoomsChoiceViewModel.CreateAsync(dateRange);

                RoomChoices.AvailableRoomChoiceEntitiesView.Filter = _mustShowRoomChoice;

                _updateOptionChoicesEntities();

                Dictionary <RoomKind, int> takenRoomKind = new Dictionary <RoomKind, int>();

                _countTakenRooms(takenRoomKind);

                _setRoomChoiceEntitiesCounts(takenRoomKind);
            }
            catch (Exception ex)
            {
                Logger.Log(ex);
            }
        }