From ce1a17640b32ca5ccf2bb2a49efa0f226e477af6 Mon Sep 17 00:00:00 2001 From: HuskyTeufel Date: Mon, 10 Aug 2020 09:23:05 +0200 Subject: [PATCH] =?UTF-8?q?Bilder=20werden=20wieder=20im=20Ausdruck=20ange?= =?UTF-8?q?f=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SanSystem/Global.cs | 1 + SanSystem/UCWeitereFotos.cs | 18 +++++++++++++++++- SanSystem/frmMain.cs | 22 ++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/SanSystem/Global.cs b/SanSystem/Global.cs index 2af8156..192ece8 100644 --- a/SanSystem/Global.cs +++ b/SanSystem/Global.cs @@ -67,6 +67,7 @@ namespace SanSystem Database.Datenbank.Instance.loadedProjekt = null; if (!Directory.Exists(Projektpfad)) Directory.CreateDirectory(Projektpfad); + Database.Datenbank.Instance.TeufelDB.Projekte.Add(projekt); Database.Datenbank.Instance.InitProjekt(projekt, Projektpfad); } diff --git a/SanSystem/UCWeitereFotos.cs b/SanSystem/UCWeitereFotos.cs index bbeed30..3998862 100644 --- a/SanSystem/UCWeitereFotos.cs +++ b/SanSystem/UCWeitereFotos.cs @@ -61,7 +61,23 @@ namespace SanSystem using (OpenFileDialog openFileDialog = new OpenFileDialog()) { if (txt_schachtnummer.Text == "") - openFileDialog.InitialDirectory = @"C:\K2000w\BILDER"; + { + bool found = false; + foreach(string directory in Directory.EnumerateDirectories(@"C:\K2000w\BILDER")) + { + if(directory.Contains(Global.Instance.ProjektNummer)) + { + found = true; + openFileDialog.InitialDirectory = directory; + break; + } + } + if(!found) + { + openFileDialog.InitialDirectory = @"C:\K2000w\BILDER"; + } + } + if (openFileDialog.ShowDialog() == DialogResult.OK) { string source = openFileDialog.FileName; diff --git a/SanSystem/frmMain.cs b/SanSystem/frmMain.cs index 2179785..abeec2f 100644 --- a/SanSystem/frmMain.cs +++ b/SanSystem/frmMain.cs @@ -253,6 +253,7 @@ namespace SanSystem { ausdruck.Add((InlinerSanierung)san); } + /* else if(san is SchachtAnbindung) { foreach(SavedBilder bild in (san as SchachtAnbindung).SavedBilders) @@ -270,12 +271,33 @@ namespace SanSystem }); } } + */ } } foreach(InlinerSanierung san in ausdruck) { + bilder.Clear(); + foreach (Sanierung d in san.Inspektionsobjekt.Sanierung) + { + if (d is SchachtAnbindung) + { + foreach(SavedBilder c in (d as SchachtAnbindung).SavedBilders) + { + string komment = String.Empty; + if ((d as SchachtAnbindung).SchachtNummer != null) + { + komment = string.Format("{0} von Schacht: {1}", c.Bildname, (d as SchachtAnbindung).SchachtNummer); + } + bilder.Add(new BilderObject() + { + Path = c.Speicherpfad, + Kommentar = komment + }); + } + } + } string destinationPath = san.CheckVerzeichnisse(Global.Instance.Projektpfad); Hashtable hashtable = san.MakeProtokoll(destinationPath, Database.Datenbank.Instance.loadedProjekt, DateTime.MinValue); DirectoryInfo directory = Directory.GetParent(destinationPath);