public async Task DeleteBook(Book book) { MessageBoxDialogResult result = await ModalDialog.ShowMessageBoxAsync("Confirm Delete", "Are you sure you want to delete the book ?", MessageBoxButtons.YesNo, MessageBoxDefaultButton.Button2); if (result == MessageBoxDialogResult.Yes) { await BookService.DeleteBook(book.Id); await RefreshListAsync(); } }
public async Task DeleteProfile(Profile profile) { MessageBoxDialogResult result = await ModalDialog.ShowMessageBoxAsync("Confirm Delete", "Are you sure you want to delete the profile ?", MessageBoxButtons.YesNo, MessageBoxDefaultButton.Button2); if (result == MessageBoxDialogResult.Yes) { await ProfileService.DeleteProfile(profile.Id); await RefreshListAsync(); } }
protected async Task DeleteEpisode(Chapter OneChapter, Episode OneEpisode) { MessageBoxDialogResult result = await ModalDialog.ShowMessageBoxAsync("Confirm Delete", "Are you sure you want to delete the episode ?", MessageBoxButtons.YesNo, MessageBoxDefaultButton.Button2); if (result == MessageBoxDialogResult.Yes) { await EpisodeService.DeleteEpisode(OneEpisode.Id); OneChapter.Episodes.Remove(OneEpisode); StateHasChanged(); } }
protected async Task DeleteChapter(Chapter OneChapter) { MessageBoxDialogResult result = await ModalDialog.ShowMessageBoxAsync("Confirm Delete", "Are you sure you want to delete the chapter ?", MessageBoxButtons.YesNo, MessageBoxDefaultButton.Button2); if (result == MessageBoxDialogResult.Yes) { await ChapterService.DeleteChapter(OneChapter.Id); OneQuiz.Chapters.Remove(OneChapter); StateHasChanged(); } }
protected async Task DeleteQuiz() { MessageBoxDialogResult result = await ModalDialog.ShowMessageBoxAsync("Confirm Delete", "Are you sure you want to delete the quiz ?", MessageBoxButtons.YesNo, MessageBoxDefaultButton.Button2); if (result == MessageBoxDialogResult.Yes) { await QuizService.DeleteQuiz(OneQuiz.Id); StatusClass = "alert-danger"; Message = "Deleted successfully"; StateHasChanged(); await Task.Delay(1000); NavigationManager.NavigateTo("/admin/quizzes"); } }
private void btnOK_Click(object sender, EventArgs e) { _result = (MessageBoxDialogResult)btnOK.Tag; this.Close(); }
private void btnCancel_Click(object sender, EventArgs e) { _result = (MessageBoxDialogResult)btnCancel.Tag; this.Close(); }