From 01316e681c61cf7618e5f68dad923942c0888bde Mon Sep 17 00:00:00 2001 From: HuskyTeufel Date: Thu, 11 Jun 2020 09:54:37 +0200 Subject: [PATCH] =?UTF-8?q?Fehlerbehandlung=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SanSystem/UCInliner.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/SanSystem/UCInliner.cs b/SanSystem/UCInliner.cs index 795df50..fa81cb6 100644 --- a/SanSystem/UCInliner.cs +++ b/SanSystem/UCInliner.cs @@ -341,7 +341,13 @@ namespace SanSystem private void Btn_gen_dp_Click(object sender, EventArgs e) { - ProtokolWriter protokollWriter = new ProtokolWriter(inliner.Inspektionsobjekt.Objektbezeichnung+".txt"); + if(inliner.EndeAushaertung == DateTime.MinValue) + { + MessageBox.Show("Es konnte das Ende der Aushärtung nicht gefunden werden, breche ab"); + return; + } + DateTime startprüfung = inliner.EndeAushaertung.AddMinutes(20); + ProtokolWriter protokollWriter = new ProtokolWriter("./dp/"+inliner.Inspektionsobjekt.Objektbezeichnung+".txt"); protokollWriter.haltungsbezeichnung = inliner.Inspektionsobjekt.Objektbezeichnung; protokollWriter.Bauvorhaben_Ort = inliner.Inspektionsobjekt.OrtName; protokollWriter.Bauvorhaben_Strasse = inliner.Inspektionsobjekt.StrasseName + " " + inliner.Inspektionsobjekt.Hausnummer; @@ -354,8 +360,7 @@ namespace SanSystem protokollWriter.AuftraggeberOrt = Database.Datenbank.Instance.loadedProjekt.Auftraggeber.Ort; protokollWriter.AuftraggeberStrasse = Database.Datenbank.Instance.loadedProjekt.Auftraggeber.Strasse; protokollWriter.AuftraggeberTel = ""; - - DateTime startprüfung = inliner.EndeAushaertung.AddMinutes(20); + protokollWriter.Projektnummer = Database.Datenbank.Instance.loadedProjekt.Nummer; protokollWriter.GenerateMessreiheÜberdruck(startprüfung, 100); protokollWriter.Ersetzen(); protokollWriter.WriteFile();