Пример #1
0
        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();
            }
        }
Пример #2
0
        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();
            }
        }
Пример #3
0
        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();
            }
        }
Пример #4
0
        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();
            }
        }
Пример #5
0
        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");
            }
        }
Пример #6
0
 private void btnOK_Click(object sender, EventArgs e)
 {
     _result = (MessageBoxDialogResult)btnOK.Tag;
     this.Close();
 }
Пример #7
0
 private void btnCancel_Click(object sender, EventArgs e)
 {
     _result = (MessageBoxDialogResult)btnCancel.Tag;
     this.Close();
 }