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);