private void Button18_Click(object sender, EventArgs e) { try { Land landToUpdate = SelectObjectForm.selectObject("Ändere Land", Data.Laender) as Land; if (landToUpdate == null) { return; } LandForm.updateLand(Data, landToUpdate); Data.SaveChanges(); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
private void Button17_Click(object sender, EventArgs e) { try { Land newLand = LandForm.createLand(Data, "Neues Land anlegen..."); if (newLand == null) { return; } Data.Laender.Add(newLand); Data.SaveChanges(); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }