private async void btnClearDB_Click(object sender, RoutedEventArgs e) { try { AcceptForm form = new AcceptForm(); form.ShowDialog(); if (form.IsActive == false) { if (form.isAccepted == true) { await ClearLog(); form.Close(); } else { form.Close(); } } } catch (Exception er) { MessageBox.Show(er.Message); } }
private async void btnDeleteTask_Click(object sender, RoutedEventArgs e) { try { if (lsTasks.SelectedIndex != -1) { AcceptForm form = new AcceptForm(); form.ShowDialog(); if (form.IsActive == false) { if (form.isAccepted == true) { await DeleteTask(curTasks[lsTasks.SelectedIndex].id); form.Close(); } else { form.Close(); } } } else { MessageBox.Show("Выберете элемент!", "Ошибка"); } } catch (Exception er) { MessageBox.Show(er.Message); } }
private async void btn_Click(object sender, RoutedEventArgs e) { try { AcceptForm form = new AcceptForm(); form.ShowDialog(); if (form.IsActive == false) { if (form.isAccepted == true) { await CompleteTask(); } else { } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }