Exemple #1
0
        public async void UnSubParticipant(object parameter)
        {
            await RegiSing.RemoveRegistration(ShownEvent, (Participant)parameter);

            IsSubed = Participants.Contains(ViewModel.IsParticipant);
            ChangeSubButton();
            OnPropertyChanged(nameof(RemainingSpots));
            OnPropertyChanged(nameof(TakenSpots));
        }
Exemple #2
0
        public async void Clear()
        {
            bool ok = await MessageDialogUtil.InputDialogAsync("Er du sikker?", "Er du sikker på at du vil afmelde alle deltagere fra denne begivenhed");

            if (ok)
            {
                await RegiSing.ClearRegistration(ShownEvent);
            }
            IsSubed = false;
            ChangeSubButton();
            OnPropertyChanged(nameof(RemainingSpots));
            OnPropertyChanged(nameof(TakenSpots));
        }
Exemple #3
0
        public async void Subscribe()
        {
            if (!_isWorking && ShownEvent.MaxNoParticipant > Participants.Count)
            {
                _isWorking = true;
                if (IsSubed)
                {
                    await RegiSing.RemoveRegistration(ShownEvent, ViewModel.IsParticipant);
                }
                else
                {
                    await RegiSing.AddRegistration(ShownEvent, ViewModel.IsParticipant);
                }

                IsSubed = !IsSubed;
                ChangeSubButton();
                OnPropertyChanged(nameof(RemainingSpots));
                OnPropertyChanged(nameof(TakenSpots));
                _isWorking = false;
            }
        }
Exemple #4
0
        public async void Delete()
        {
            bool ok = await MessageDialogUtil.InputDialogAsync("Er du sikker?", "Er du sikker på at du vil slette denne begivenhed fuldstændig");

            if (ok)
            {
                ViewModel.LoadText = "Sletter begivenheden";
                await RegiSing.DeleteEvent(ShownEvent);

                ok = await EventSing.EventCatalog.Remove(ShownEvent.Id);

                ok = ok && await ImageSingleton.Instance.ImageCatalog.RemoveImage(ShownEvent.ImageName);

                if (!ok)
                {
                    ViewModel.LoadText = "Fejl";
                    throw new BaseException("Failed to delete event");
                }
                ViewModel.LoadText    = null;
                EventSing.ViewedEvent = null;
                MainViewModel.Instance.NavigateToPage(typeof(EventHomePage));
            }
        }