Beispiel #1
0
 private void CancelClick(object sender, RoutedEventArgs e)
 {
     ClientServerController.SaveChangesEvents(list);
     db.EventsList.Remove((EventsList)DataGrid.SelectedItem);
     db.SaveChangesAsync();
     DataGrid.ItemsSource = db.EventsList.Local;
 }
Beispiel #2
0
        private void SaveChanges_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                ClientServerController.SaveChangesEvents(list);
                db.SaveChanges();
            }
            catch (Exception exception)
            {
                MessageBox.Show(
                    exception.Message + "\n" +
                    "Can't add data. Hint:\n \"UserId\" and \"Username\" fields must be unique and not empty\n \"Status\" field must be filled",
                    "Error");
                return;
            }

            MessageBox.Show("Data was added!");
        }