Пример #1
0
 private async void btnUpdateIssue_Click(object sender, RoutedEventArgs e)
 {
     if (!string.IsNullOrWhiteSpace(tbxTitle.Text) && !string.IsNullOrWhiteSpace(tbxDescription.Text))
     {
         if (cmbStatus.SelectedItem == null)
         {
             var dialog = new MessageDialog("Please select a status!");
             await dialog.ShowAsync();
         }
         else
         {
             await SqliteContext.UpdateIssueById(_Id, cmbStatus.SelectedItem.ToString(), tbxTitle.Text, tbxDescription.Text);
         }
     }
     else
     {
         if (string.IsNullOrWhiteSpace(tbxTitle.Text) && string.IsNullOrWhiteSpace(tbxDescription.Text))
         {
             if (cmbStatus.SelectedItem == null)
             {
                 var dialog = new MessageDialog("Please select a status!");
                 await dialog.ShowAsync();
             }
             else
             {
                 await SqliteContext.UpdateIssueStatusById(_Id, cmbStatus.SelectedItem.ToString());
             }
         }
         else
         {
             var dialog = new MessageDialog("If you want to update the titel and description of the issue beside the status, you need fill in both of title and description fields.!");
             await dialog.ShowAsync();
         }
     }
     LoadIssuesAsync().GetAwaiter();
     ResetTextBoxes();
     tbxComment.IsEnabled = false;
 }