Beispiel #1
0
 private void Button9_Click(object sender, EventArgs e)
 {
     try
     {
         Person newPerson =
             PersonForm.createPerson(
                 Data,
                 "Neue Person erstellen...");
         Data.People.Add(newPerson);
         Data.SaveChanges();
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
 }
Beispiel #2
0
 private void Button10_Click(object sender, EventArgs e)
 {
     try
     {
         Person personToUpdate =
             SelectObjectForm.selectObject("Ändere Person", Data.People) as Person;
         if (personToUpdate == null)
         {
             return;
         }
         PersonForm.updatePerson(Data, personToUpdate);
         Data.SaveChanges();
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
     }
 }