Example #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());
     }
 }
Example #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());
     }
 }