public async Task Initialize() { IsBusy = true; BandInvitations.ReplaceRange(await App.Database.GetUserBandInvitations(DependencyService .Resolve <IAuthenticationService>() .GetCurrentUserId())); IsBusy = false; AcceptInvitationCommand.RaiseCanExecuteChanged(); DenyInvitationCommand.RaiseCanExecuteChanged(); }
private async Task DenyInvitation(Invitation arg) { IsBusy = true; AcceptInvitationCommand.RaiseCanExecuteChanged(); DenyInvitationCommand.RaiseCanExecuteChanged(); await App.Database.RemoveInvitation(arg); await Shell.Current.CurrentPage.DisplayToastAsync("Pozvánka odmítnuta!"); await Initialize(); }
private async Task AcceptInvitation(Invitation arg) { IsBusy = true; AcceptInvitationCommand.RaiseCanExecuteChanged(); DenyInvitationCommand.RaiseCanExecuteChanged(); var bandMusician = new BandMusicians { BandId = arg.ToBandId, MusicianId = DependencyService.Resolve <IAuthenticationService>().GetCurrentUserId(), TimeStamp = DateTime.Now }; await App.Database.AddBandMember(bandMusician); await App.Database.RemoveInvitation(arg); await Shell.Current.CurrentPage.DisplayToastAsync("Pozvánka úspěšně přijata!"); await Initialize(); }