wenn projekt null ist, soll man kein

Objekt hinzufügen dürfen
This commit is contained in:
Damian Wessels
2022-12-11 14:50:09 +01:00
parent db636eb82a
commit a306dc1e57
6 changed files with 75 additions and 60 deletions

View File

@@ -147,6 +147,11 @@ namespace SanSystem
private void btn_add_Click(object sender, EventArgs e)
{
if(Datenbank.Instance.loadedProjekt == null)
{
MessageBox.Show("Es wurde kein Projekt geladen");
return;
}
KlassenBIB.Inspektionsobjekt inspektionsobjekt = new KlassenBIB.Inspektionsobjekt();
inspektionsobjekt.Projektnummer = Global.Instance.ProjektNummer;
Datenbank.Instance.loadedProjekt.Objekte.Add(inspektionsobjekt);