From ea90bd6778d0f981f7dbacbdbe7e53f44ce302b0 Mon Sep 17 00:00:00 2001 From: HuskyTeufel Date: Thu, 21 Apr 2022 08:00:09 +0200 Subject: [PATCH 1/8] =?UTF-8?q?cherrypick=20durchgef=C3=BChrt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SanSystem/App.config | 32 ++++++++++---- SanSystem/Database/Datenbank.cs | 2 + SanSystem/Database/UpdateDatabase.cs | 60 ++++++++++++++++++++++++++- SanSystem/SanSystem.csproj | 33 +++++++++++++++ SanSystem/datenbank.db | Bin 0 -> 12288 bytes SanSystem/packages.config | 7 ++++ 6 files changed, 124 insertions(+), 10 deletions(-) create mode 100644 SanSystem/datenbank.db diff --git a/SanSystem/App.config b/SanSystem/App.config index 38061a4..502cd7c 100644 --- a/SanSystem/App.config +++ b/SanSystem/App.config @@ -1,13 +1,15 @@  - - -
- - - - - + + +
+ + +
+ + + + @@ -63,4 +65,16 @@ - + + + + + + + + + + + + + \ No newline at end of file diff --git a/SanSystem/Database/Datenbank.cs b/SanSystem/Database/Datenbank.cs index dfea20e..e4d0f50 100644 --- a/SanSystem/Database/Datenbank.cs +++ b/SanSystem/Database/Datenbank.cs @@ -67,6 +67,8 @@ namespace Database { //UpdateDatabase.GenerateNewBeziehungen(); } + + UpdateDatabase.CreateSQLiteDB(); return true; } diff --git a/SanSystem/Database/UpdateDatabase.cs b/SanSystem/Database/UpdateDatabase.cs index 56156a5..6c6925f 100644 --- a/SanSystem/Database/UpdateDatabase.cs +++ b/SanSystem/Database/UpdateDatabase.cs @@ -1,7 +1,10 @@ -using KlassenBIB; +using FastMember; +using KlassenBIB; using SanShared; using System; using System.Collections.Generic; +using System.Data; +using System.Data.SQLite; using System.Diagnostics; using System.IO; using System.Linq; @@ -32,6 +35,61 @@ namespace Database return; } + public static void CreateSQLiteDB() + { + var source = Datenbank.Instance.TeufelDB; + + + // Auftraggber Datatable + DataTable dtauftraggeber = new DataTable(); + + // Verbindung zur SQLite herstellen + + SQLiteConnection Connection = new SQLiteConnection("Data Source=datenbank.db;Version=3;"); + + + SQLiteCommand Command = new SQLiteCommand("SELECT * FROM Auftraggeber", Connection); + SQLiteDataAdapter auftraggeberDA = new SQLiteDataAdapter(); + //auftraggeberDA.SelectCommand = Command; + SQLiteCommandBuilder cmd = new SQLiteCommandBuilder(auftraggeberDA); + + auftraggeberDA.SelectCommand = Command; + auftraggeberDA.InsertCommand = cmd.GetInsertCommand(); + + Connection.Open(); + + auftraggeberDA.Fill(dtauftraggeber); + + DataTable srcdtAuftraggeber = new DataTable(); + using (var reader = ObjectReader.Create(source.Auftraggeber, "Name", "Strasse", "Ort", "Ansprechpartner")) + { + srcdtAuftraggeber.Load(reader); + } + + foreach (DataRow s in srcdtAuftraggeber.Rows) + { + DataRow dr = dtauftraggeber.NewRow(); + //dr.BeginEdit(); + dr["Name"] = s["Name"]; + dr["Strasse"] = s["Strasse"]; + dr["Ort"] = s["Ort"]; + dr["Ansprechpartner"] = s["Ansprechpartner"]; + //dr.EndEdit(); + + dtauftraggeber.Rows.Add(dr); + + } + // dtauftraggeber.AcceptChanges(); + // auftraggeberDA.Update(dtauftraggeber); + + DataTable dtimprägnierberichte = new DataTable(); + using (var reader = ObjectReader.Create(source.Imprägnierungen)) + { + dtimprägnierberichte.Load(reader); + } + + Connection.Close(); + } public static void MakeNewDatabaseSystem() diff --git a/SanSystem/SanSystem.csproj b/SanSystem/SanSystem.csproj index 56614a2..1ff48d3 100644 --- a/SanSystem/SanSystem.csproj +++ b/SanSystem/SanSystem.csproj @@ -1,5 +1,6 @@  + Debug @@ -37,9 +38,18 @@ 4 + + ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll + + + ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll + True + + ..\packages\FastMember.1.5.0\lib\net461\FastMember.dll + ..\packages\FluentFTP.37.0.2\lib\net45\FluentFTP.dll @@ -110,7 +120,17 @@ ..\packages\Syncfusion.Tools.Windows.19.4.0.56\lib\net46\Syncfusion.Tools.Windows.dll + + + ..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.115.5\lib\net46\System.Data.SQLite.dll + + + ..\packages\System.Data.SQLite.EF6.1.0.115.5\lib\net46\System.Data.SQLite.EF6.dll + + + ..\packages\System.Data.SQLite.Linq.1.0.115.5\lib\net46\System.Data.SQLite.Linq.dll + @@ -471,6 +491,9 @@ UCWeitereFotos.cs + + PreserveNewest + PreserveNewest @@ -615,4 +638,14 @@ + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + + \ No newline at end of file diff --git a/SanSystem/datenbank.db b/SanSystem/datenbank.db new file mode 100644 index 0000000000000000000000000000000000000000..31870f19f848ab486664dcf16be156c68f13ab94 GIT binary patch literal 12288 zcmeI#&r8EF6bJBR6{Q1z+;$CxLCc00@!-vDy9o9q-OT1-t6Q2KJ?Nk8Utl_l z)`3?K;~Qx6USIoYKRvzSeQ#zIo4o2pX4n}yA(WC!#t0!!b=YmQ%6zYi%Z=9Jze0zc z#&3tV+Bo_o$2azb1px>^00Izz00bZa0SG_<0ucBYfk9)x)#=dGWTUw%R&zW4J{4-U zR{3~4b*>Y^rC^d@^#t3x*Uz(s>e?rR_X~Q^YPadf`KBjdPmIo{Q#De$9yfk<^Xes! z`AyfGJ$r5#NpUNZu1zD`-*csSlw~%wJ&U4tA=c)n%JX8W)%azZX_G7cT^J-`pC>81 z6RBVJXZ%6NVPxN=FCrNvLq8S-AOHafKmY;|fB*y_009U<00KKKfcbxie=a@^ Y0uX=z1Rwwb2tWV=5P$##AW#W>0T=mOwg3PC literal 0 HcmV?d00001 diff --git a/SanSystem/packages.config b/SanSystem/packages.config index 6f05d41..4b92c93 100644 --- a/SanSystem/packages.config +++ b/SanSystem/packages.config @@ -1,7 +1,10 @@  + + + @@ -23,4 +26,8 @@ + + + + \ No newline at end of file From 0080866a52f2d10bf34df5aa972e1ef8cc31bf04 Mon Sep 17 00:00:00 2001 From: HuskyTeufel Date: Thu, 21 Apr 2022 16:33:37 +0200 Subject: [PATCH 2/8] Datenbank erweitert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Imprägnierungen Inspektionsobjekt Projekt --- SanSystem/datenbank.db | Bin 12288 -> 24576 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/SanSystem/datenbank.db b/SanSystem/datenbank.db index 31870f19f848ab486664dcf16be156c68f13ab94..f665d91b0c94e537fcb1b99f5ada5899373a9cd5 100644 GIT binary patch literal 24576 zcmeI#T}#_g7zgmAT1y>ngE4v`gAfoDbzY1ycDL3B4Yq05Mx9r3nw~aU)029Vurb($ z_F|uQH~R!Tr$+K(hqt5r1EuFBIWNEGN#OK9x4ejIqkvCIq`gyKDyph{(lkX;%Hp>n zeh-%{uRm18znUrkt5{avc7AS&-tx0I%8TanKU=@IUWp!8K@Vd~|k2ncKYLO|`tG4mQmiKpflvYkj9I|*ir95rx-Vau6?kv_k zpg*YRxGZMl^ofgrbz?TkjN9ikYKRs-$*nrW%f*)DWa<5V!aU05`~`<@ z&urIwSK66zwJSrR)z9sYX^F_S4a?r!+`GM8uhh1;)p>al^+YrIE9WDev@VUSRR~Ki zZZha39*Ovl$8;d0m&u59?Pjwp?)1Jd+n3qw$D?fDlRLXBtyOA=hwA*peLhcToX~ON zM44Hrujlt#>|VNQ5m}$aGQaXU*|c&yyd-Qm^qh%E3-QLZWV*B-r->Cf?nS^|akET? zj8JARg_)j2=$1BW`}^wEf*`!{McQ76^d_dvp@r&N4xrGv%fwrGAfDX2{is%IJ3H## z`^A{`Ojxt!Qf@Ro+qIN3|JEm;f;16w=~Ne=CQco9MtHMfhNAqpZNF`0R(>v AjQ{`u From 0746de66eae1c2cb7cf2e5b42423757f36f5c7f1 Mon Sep 17 00:00:00 2001 From: HuskyTeufel Date: Thu, 21 Apr 2022 16:33:52 +0200 Subject: [PATCH 3/8] Auftraggeber werden gespeichert --- SanSystem/Database/UpdateDatabase.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SanSystem/Database/UpdateDatabase.cs b/SanSystem/Database/UpdateDatabase.cs index 6c6925f..791362a 100644 --- a/SanSystem/Database/UpdateDatabase.cs +++ b/SanSystem/Database/UpdateDatabase.cs @@ -79,8 +79,8 @@ namespace Database dtauftraggeber.Rows.Add(dr); } - // dtauftraggeber.AcceptChanges(); - // auftraggeberDA.Update(dtauftraggeber); + + auftraggeberDA.Update(dtauftraggeber); DataTable dtimprägnierberichte = new DataTable(); using (var reader = ObjectReader.Create(source.Imprägnierungen)) From 075720b8bd15efdf287564af80fea6e3350f3952 Mon Sep 17 00:00:00 2001 From: HuskyTeufel Date: Fri, 22 Apr 2022 15:04:35 +0200 Subject: [PATCH 4/8] Inspektionsobjekte MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit werden in SQL Datenbank hinzugefügt --- SanSystem/Database/UpdateDatabase.cs | 68 +++++++++++++++++++++++++++ SanSystem/datenbank.db | Bin 24576 -> 36864 bytes 2 files changed, 68 insertions(+) diff --git a/SanSystem/Database/UpdateDatabase.cs b/SanSystem/Database/UpdateDatabase.cs index 791362a..2b1c80f 100644 --- a/SanSystem/Database/UpdateDatabase.cs +++ b/SanSystem/Database/UpdateDatabase.cs @@ -82,12 +82,80 @@ namespace Database auftraggeberDA.Update(dtauftraggeber); + //Imprägnierberichte DataTable dtimprägnierberichte = new DataTable(); using (var reader = ObjectReader.Create(source.Imprägnierungen)) { dtimprägnierberichte.Load(reader); } + Command = new SQLiteCommand("SELECT * FROM Projekt",Connection); + SQLiteDataAdapter projektDA = new SQLiteDataAdapter(); + cmd = new SQLiteCommandBuilder(projektDA); + projektDA.SelectCommand = Command; + projektDA.InsertCommand = cmd.GetInsertCommand(); + + Command = new SQLiteCommand("SELECT * FROM Inspektionsobjekt", Connection); + SQLiteDataAdapter objektDA = new SQLiteDataAdapter(); + cmd = new SQLiteCommandBuilder(objektDA); + objektDA.SelectCommand = Command; + objektDA.InsertCommand = cmd.GetInsertCommand(); + + DataTable dtprojekte = new DataTable(); + DataTable dtObjekte = new DataTable(); + projektDA.Fill(dtprojekte); + objektDA.Fill(dtObjekte); + + + int projektID = 1; + // Alle Projekte durch gehen + foreach(Projekt projekt in source.Projekte) + { + DataRow projektRow = dtprojekte.NewRow(); + projektRow["ID"] = projektID; + projektRow["Nummer"] = projekt.Nummer; + projektRow["Ort"] = projekt.Ort; + projektRow["SanierungsIDPrefix"] = projekt.SanierungsIDPrefix; + projektRow["SanierungsIDSuffix"] = projekt.SanierungsIDSuffix; + + int objektID = 1; + // Alle einzelne Inspektionsobjekte + foreach(var inspektionsobjekt in projekt.Objekte) + { + DataRow objektRow = dtObjekte.NewRow(); + objektRow["id"] = objektID; + objektRow["ref_projekt_id"] = projektID; + objektRow["StrasseName"] = inspektionsobjekt.StrasseName; + objektRow["Ort"] = inspektionsobjekt.OrtName; + objektRow["Hausnummer"] = inspektionsobjekt.Hausnummer; + objektRow["Projektnummer"] = inspektionsobjekt.Projektnummer; + objektRow["Objektbezeichnung"] = inspektionsobjekt.Objektbezeichnung; + objektRow["VonPunkt"] = inspektionsobjekt.VonPunkt; + objektRow["BisPunkt"] = inspektionsobjekt.BisPunkt; + objektRow["RohrMaterial"] = inspektionsobjekt.RohrMaterial; + objektRow["Kanalrohrweite"] = inspektionsobjekt.Kanalrohrweite; + objektRow["Haltungslaenge"] = inspektionsobjekt.Haltungslaenge; + objektRow["Schachtlaenge"] = inspektionsobjekt.Schachtlaenge; + objektRow["HaltungGemessen"] = inspektionsobjekt.HaltungGemessen.ToString(); + objektRow["Bemerkung"] = inspektionsobjekt.Bemerkung; + objektRow["Inspektionsrichtung"] = inspektionsobjekt.Inspektionsrichtung; + objektRow["Sanierungsnummer"] = inspektionsobjekt.Sanierungsnummer; + + foreach(Sanierung sanierung in inspektionsobjekt.Sanierung) + { + + } + + dtObjekte.Rows.Add(objektRow); + objektID++; + } + + dtprojekte.Rows.Add(projektRow); + projektID++; + } + projektDA.Update(dtprojekte); + objektDA.Update(dtObjekte); + Connection.Close(); } diff --git a/SanSystem/datenbank.db b/SanSystem/datenbank.db index f665d91b0c94e537fcb1b99f5ada5899373a9cd5..690a9867da23ebaa093799f4e9a8a73e23b46cb0 100644 GIT binary patch literal 36864 zcmeI&O>g2x7zc2hkTqU>8b3y|dz#AB|V|!aw zYNg$@s`gY>>euS0*mEy?uheH82p$uJ)Fb&Lq2L)ap7}lFdBzH@?<$VZbA4BinVFL{~zq|BK(tGw&WvgCW#?$)G+jN#??HHNjrysZf+5T+ni}at? zPV%o+Uq(FyAaEZAlK*C(Ju}~*`m8(R-s@4f|Yy12HHUwG-OZ zsY2j+T;$WW)2iJpzfdi!;+IUYkyd)neVV@urdsN4zUUyP#az})h&|0qY9$nAzdPBN$mrG7rK>udb z?Yh+AWz{84-yOMX@Z6@3YppjVA2~veHZqtBqwdo#8IwA9k@`{!XS%JFQm zQ1C#H%|iXs7)_+B(oZLrqguXH8KB0-w7$+3x4K&5X9p)N@I){kM_0ebO=I!mdYIw5 z{3lL%LTHQPnJXHBQ0Z^h?y=*=N}BFaRvBdkMl(U&MJI0ui`wSs=MZso|{B{r<= zlPBi&*EjQ7+uLwajvXiUvBsv{j^O+wu78fQz2mYDNz?G=Ny;p`g3+F@5vs z?Kh^CJvcDmJrCO~M8X>VoX}d!N2~6n)bIM~QZSzg+H@+=(j;k1H(}C`?u1rqsAqF} z=*J5J5P$##AOHafKmY;|fB*y_0D(0YP|yE~%m*X$G4mnw_ZklrLxTVWAOHafKmY;| zfB*y_009WBk-$M};n%O*$&LNg{8x&fBsTU^x4$C6|Nqx0_!tTVAOHafKmY;|fB*y_ z009Up|Chj^7y=N000bZa0SG_<0uX=z1R$_R0(kykqhMkv5P$##AOHafKmY;| zfB*y_0D&a}c>Z4kgJK9k00Izz00bZa0SG_<0uX?}8VTU}e~p5Pp+Eov5P$##AOHaf jKmY;|fB*y_009U<00Izz00bZa0SG_<0uX?}y%qQm^=O&z delta 68 zcmZozz|?Snae}lUD+2=q8xX?)+e95>aaIOB|5{$45G%JV1HTL3C*HTb!rZc(1qGIK PZI Date: Fri, 13 May 2022 13:34:10 +0200 Subject: [PATCH 5/8] =?UTF-8?q?impr=C3=A4gnierberichte=20werden=20in=20Db?= =?UTF-8?q?=20=C3=BCbertragen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SanSystem/Database/UpdateDatabase.cs | 44 +++++++++++++++++++++++++-- SanSystem/datenbank.db | Bin 36864 -> 36864 bytes 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/SanSystem/Database/UpdateDatabase.cs b/SanSystem/Database/UpdateDatabase.cs index 2b1c80f..ff1bdf6 100644 --- a/SanSystem/Database/UpdateDatabase.cs +++ b/SanSystem/Database/UpdateDatabase.cs @@ -83,12 +83,43 @@ namespace Database auftraggeberDA.Update(dtauftraggeber); //Imprägnierberichte - DataTable dtimprägnierberichte = new DataTable(); + DataTable dtImpraegnierSource = new DataTable(); using (var reader = ObjectReader.Create(source.Imprägnierungen)) { - dtimprägnierberichte.Load(reader); + dtImpraegnierSource.Load(reader); + } + Command = new SQLiteCommand("SELECT * FROM Impraegnierungen", Connection); + SQLiteDataAdapter imprDA = new SQLiteDataAdapter(); + cmd = new SQLiteCommandBuilder(imprDA); + imprDA.SelectCommand = Command; + imprDA.InsertCommand = cmd.GetInsertCommand(); + DataTable dtImpr = new DataTable(); + imprDA.Fill(dtImpr); + + foreach(DataRow s in dtImpraegnierSource.Rows) + { + DataRow dr = dtImpr.NewRow(); + dr["Schlauchnummer"] = s["Schlauchnummer"]; + dr["DN"] = s["DN"]; + dr["Wanddicke"] = s["Wanddicke"]; + dr["Laenge"] = s["LinerLänge"]; + dr["NochVorhanden"] = s["NochVorhanden"]; + dr["Impraegniernummer"] = s["Imprägniernummer"]; + dr["ImpraegnierDatum"] = (s["ImprägnierungBeginn"] as KlassenBIB.ImprägnierungStrukture).Zeitstempel.Date.ToShortDateString(); + dtImpr.Rows.Add(dr); + } + + imprDA.Update(dtImpr); + dtImpr.Clear(); + imprDA.Fill(dtImpr); + + + + + // Projekt schleife + Command = new SQLiteCommand("SELECT * FROM Projekt",Connection); SQLiteDataAdapter projektDA = new SQLiteDataAdapter(); cmd = new SQLiteCommandBuilder(projektDA); @@ -143,6 +174,15 @@ namespace Database foreach(Sanierung sanierung in inspektionsobjekt.Sanierung) { + if(sanierung is InlinerSanierung) + { + + InlinerSanierung san = (InlinerSanierung)sanierung; + string searchquery = string.Format("Impraegniernummer = '{0}'",(san.Imprägnierungsbericht as WerkseitigImprägniert).Imprägniernummer); + int refimpID = (int)dtImpr.Select(searchquery).Last()["id"]; + + } + } diff --git a/SanSystem/datenbank.db b/SanSystem/datenbank.db index 690a9867da23ebaa093799f4e9a8a73e23b46cb0..b41ca31d99ea33192b8e3d9c3dacee2895fa98b4 100644 GIT binary patch delta 327 zcmZozz|^pSX@ayM4+8@OClIp$F(VMmPt-A%uw=CyG zb^+FpEEhHl3P`a`p2lKj#QT=XL0n&-u{pOSF)1gtxG*Ovz9cobARf$(H^dO&oP3N$ zPRCG5L4%7^DKkZh)6*}+)!j8n2gvozEhtJ%P0!0rEpkaLDa}>l3~`MJne4;2n1}am zlMD~LxUMc^bN1x#ysC_xlV$mg#c=9awpoDvE*sECjI5JC^8Vyt<6#5(jDcbECq5xT zE@u974E&$?AM>9B`s4t=kuWQ>E(elXrFrS8dAuyliX1_ydHH3DC7JnoJWR~;9Kneo S#{s1m3l<10a&TDWAOHZ6i(K{q delta 222 zcmZozz|^pSX@ayMHvJdMRl)W=mpskksFDZV5%w;;YGF)1fC-ej^OtLWtWoJyOU*`G1;F)%Ro zi|gw%cDjS4Hw&=eWn*b#VrHNGk@qKutFNnHh$ffj=1+V=f?Q1ej~Vzs@jvE23$)=7 zzkw Date: Sat, 14 Jan 2023 09:39:16 +0100 Subject: [PATCH 6/8] Tranfer to net core --- SanSystem/Database/Datenbank.cs | 21 +- SanSystem/Database/UpdateDatabase.cs | 5 +- SanSystem/Einstellungen/Settings.cs | 10 +- SanSystem/Global.cs | 2 +- SanSystem/KlassenBIB/Inspektionsobjekt.cs | 1 - SanSystem/KlassenBIB/Projekt.cs | 2 - .../Sanierung/Renovation/InlinerSanierung.cs | 6 +- SanSystem/NuGet.config | 6 + SanSystem/Properties/Settings.Designer.cs | 38 - SanSystem/Properties/Settings.settings | 9 - SanSystem/SanSystem.csproj | 683 +----------------- SanSystem/TempCAN/TemperaturBuilder.cs | 4 +- SanSystem/TempCAN/TinkerForgeTemperatur.cs | 4 +- SanSystem/UCInliner.Designer.cs | 98 ++- SanSystem/UCInliner.cs | 31 +- SanSystem/frmMain.Designer.cs | 6 +- SanSystem/frmMain.cs | 4 +- 17 files changed, 159 insertions(+), 771 deletions(-) create mode 100644 SanSystem/NuGet.config delete mode 100644 SanSystem/Properties/Settings.Designer.cs delete mode 100644 SanSystem/Properties/Settings.settings diff --git a/SanSystem/Database/Datenbank.cs b/SanSystem/Database/Datenbank.cs index e4d0f50..858fd1a 100644 --- a/SanSystem/Database/Datenbank.cs +++ b/SanSystem/Database/Datenbank.cs @@ -10,8 +10,15 @@ using System.Diagnostics; using KlassenBIB; using SanShared.Exceptions; + namespace Database { + /* public class SanVerwaltungContext: DbContext + { + public DbSet Projekte { get; set; } + + } + */ public class Datenbank { public string pfad; @@ -36,8 +43,8 @@ namespace Database Directory.CreateDirectory(Path.Combine(pfad, "projekte")); return; } - if (File.Exists(filepath)) - TeufelDB = XamlServices.Load(filepath) as KlassenBIB.DB; + //if (File.Exists(filepath)) + //TeufelDB = XamlServices.Load(filepath) as KlassenBIB.DB; } public KlassenBIB.Projekt loadedProjekt = null; @@ -59,16 +66,16 @@ namespace Database if (!File.Exists(filepath)) { if (!Directory.Exists("./projekte")) return true; - UpdateDatabase.UpdateNewGuids(); + //UpdateDatabase.UpdateNewGuids(); - UpdateDatabase.TransferAuftraggeber(); - UpdateDatabase.MakeNewDatabaseSystem(); + //UpdateDatabase.TransferAuftraggeber(); + //UpdateDatabase.MakeNewDatabaseSystem(); } else { //UpdateDatabase.GenerateNewBeziehungen(); } - UpdateDatabase.CreateSQLiteDB(); + //UpdateDatabase.CreateSQLiteDB(); return true; } @@ -85,7 +92,7 @@ namespace Database { string filepath = Path.Combine(pfad, "projekte", "TeufelDB.xaml"); Trace.WriteLine(filepath); - XamlServices.Save(filepath, TeufelDB); + //XamlServices.Save(filepath, TeufelDB); } } } diff --git a/SanSystem/Database/UpdateDatabase.cs b/SanSystem/Database/UpdateDatabase.cs index ff1bdf6..d4fc68b 100644 --- a/SanSystem/Database/UpdateDatabase.cs +++ b/SanSystem/Database/UpdateDatabase.cs @@ -1,4 +1,4 @@ -using FastMember; +/*using FastMember; using KlassenBIB; using SanShared; using System; @@ -284,7 +284,8 @@ namespace Database Datenbank.Instance.MainDatenbank.AuftraggeberListe.Add(tempProjekt.Auftraggeber); } - */ + } } } +*/ diff --git a/SanSystem/Einstellungen/Settings.cs b/SanSystem/Einstellungen/Settings.cs index 185e0a9..eefe5e2 100644 --- a/SanSystem/Einstellungen/Settings.cs +++ b/SanSystem/Einstellungen/Settings.cs @@ -1,4 +1,4 @@ -using Newtonsoft.Json; +//using Newtonsoft.Json; using System; using System.Collections.Generic; using System.IO; @@ -30,8 +30,8 @@ namespace SanSystem.Einstellungen } else { - string input = File.ReadAllText(modPath); - configuration = (Dictionary)JsonConvert.DeserializeObject(input, typeof(Dictionary)); + //string input = File.ReadAllText(modPath); + //configuration = (Dictionary)JsonConvert.DeserializeObject(input, typeof(Dictionary)); } } @@ -65,8 +65,8 @@ namespace SanSystem.Einstellungen public virtual void SaveSettings() { - string ser = JsonConvert.SerializeObject(configuration); - File.WriteAllText(modPath, ser); + //string ser = JsonConvert.SerializeObject(configuration); + //File.WriteAllText(modPath, ser); } public void Dispose() diff --git a/SanSystem/Global.cs b/SanSystem/Global.cs index d932861..934e76c 100644 --- a/SanSystem/Global.cs +++ b/SanSystem/Global.cs @@ -111,7 +111,7 @@ namespace SanSystem { get { - return Path.Combine(Properties.Settings.Default.DATABASEMAIN,speicherpfad_to_projekts, projektpfad); + return "C:\\";// Path.Combine(Properties.Settings.Default.DATABASEMAIN,speicherpfad_to_projekts, projektpfad); } } diff --git a/SanSystem/KlassenBIB/Inspektionsobjekt.cs b/SanSystem/KlassenBIB/Inspektionsobjekt.cs index fe04287..5a9fa74 100644 --- a/SanSystem/KlassenBIB/Inspektionsobjekt.cs +++ b/SanSystem/KlassenBIB/Inspektionsobjekt.cs @@ -11,7 +11,6 @@ namespace KlassenBIB /// /// /// - [ContentProperty("Sanierung")] public class Inspektionsobjekt { private string strasseName = "none"; diff --git a/SanSystem/KlassenBIB/Projekt.cs b/SanSystem/KlassenBIB/Projekt.cs index 686a928..711c86d 100644 --- a/SanSystem/KlassenBIB/Projekt.cs +++ b/SanSystem/KlassenBIB/Projekt.cs @@ -6,10 +6,8 @@ using System.Text; using System.Threading.Tasks; using System.Windows.Markup; -[assembly: XmlnsDefinition("http://schemas.cosysda.de/sanVerwaltung/xaml","KlassenBIB")] namespace KlassenBIB { - [ContentProperty("Objekte")] public class Projekt :IProjekt { public string Nummer { get; set; } diff --git a/SanSystem/KlassenBIB/Sanierung/Renovation/InlinerSanierung.cs b/SanSystem/KlassenBIB/Sanierung/Renovation/InlinerSanierung.cs index 230bdb1..0bc0343 100644 --- a/SanSystem/KlassenBIB/Sanierung/Renovation/InlinerSanierung.cs +++ b/SanSystem/KlassenBIB/Sanierung/Renovation/InlinerSanierung.cs @@ -40,6 +40,7 @@ namespace KlassenBIB string bediener; DateTime anfangKalibrierung; DateTime endeKalibirierung; + DateTime tvInspektion; AbstractImprägnier imprägnierungsbericht; Dictionary lagerungZeiten = new Dictionary(); @@ -202,7 +203,7 @@ namespace KlassenBIB grunddaten["KL_rob_true"] = this.VorbereitetRoboter ? "X": " "; grunddaten["KL_HD_date"] = this.Datum.ToShortDateString(); grunddaten["KL_Besatzung"] = this.Besatzung; - grunddaten["liner_laenge"] = Inspektionsobjekt.Haltungslaenge; //LaengeGesamt; + grunddaten["liner_laenge"] = Inspektionsobjekt.Haltungslaenge; grunddaten["Charge_Liner"] = this.imprägnierungsbericht == null ? this.LinerChargenummer : this.imprägnierungsbericht.Schlauchnummer; grunddaten["Charge_Harz"] = this.imprägnierungsbericht == null ? this.HarzChargenummer : (this.imprägnierungsbericht as WerkseitigImprägniert).Imprägniernummer; grunddaten["harz_bedarf_m"] = this.imprägnierungsbericht == null ? harzbedarf : this.imprägnierungsbericht.Harzmenge; @@ -224,7 +225,7 @@ namespace KlassenBIB grunddaten["liner_type"] = LinerTyp; try { - grunddaten["TV_Kontrolle"] = string.Format("Ja, am {0}", AnfangAushaertung.Subtract(TimeSpan.FromMinutes(20))); + grunddaten["TV_Kontrolle"] = string.Format("Ja, am {0}", TvInspektion); } catch(ArgumentOutOfRangeException) { @@ -339,5 +340,6 @@ namespace KlassenBIB public int EinbauTemperatur { get => temperaturEinbau; set => temperaturEinbau = value; } public double InversionsDruck { get => inversionsDruck; set => inversionsDruck = value; } public AbstractImprägnier Imprägnierungsbericht { get => imprägnierungsbericht; set => imprägnierungsbericht = value; } + public DateTime TvInspektion { get => tvInspektion; set => tvInspektion = value; } } } diff --git a/SanSystem/NuGet.config b/SanSystem/NuGet.config new file mode 100644 index 0000000..e333c16 --- /dev/null +++ b/SanSystem/NuGet.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/SanSystem/Properties/Settings.Designer.cs b/SanSystem/Properties/Settings.Designer.cs deleted file mode 100644 index 1c3f239..0000000 --- a/SanSystem/Properties/Settings.Designer.cs +++ /dev/null @@ -1,38 +0,0 @@ -//------------------------------------------------------------------------------ -// -// Dieser Code wurde von einem Tool generiert. -// Laufzeitversion:4.0.30319.42000 -// -// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn -// der Code erneut generiert wird. -// -//------------------------------------------------------------------------------ - -namespace SanSystem.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.1.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("C:\\")] - public string DATABASEMAIN { - get { - return ((string)(this["DATABASEMAIN"])); - } - set { - this["DATABASEMAIN"] = value; - } - } - } -} diff --git a/SanSystem/Properties/Settings.settings b/SanSystem/Properties/Settings.settings deleted file mode 100644 index fb30c22..0000000 --- a/SanSystem/Properties/Settings.settings +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - C:\ - - - \ No newline at end of file diff --git a/SanSystem/SanSystem.csproj b/SanSystem/SanSystem.csproj index 1ff48d3..b690094 100644 --- a/SanSystem/SanSystem.csproj +++ b/SanSystem/SanSystem.csproj @@ -1,651 +1,32 @@ - - - - - - Debug - AnyCPU - {C6546A88-8830-4EF2-B99C-B9183171F6EF} - WinExe - SanSystem - SanSystem - v4.7.2 - 512 - true - - - - - - AnyCPU - true - full - false - bin\Debug\ - TRACE;DEBUG;LAPTOP - prompt - 4 - - - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.dll - - - ..\packages\EntityFramework.6.4.4\lib\net45\EntityFramework.SqlServer.dll - - - True - - - ..\packages\FastMember.1.5.0\lib\net461\FastMember.dll - - - ..\packages\FluentFTP.37.0.2\lib\net45\FluentFTP.dll - - - ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll - - - ..\packages\Syncfusion.Chart.Base.19.4.0.56\lib\net46\Syncfusion.Chart.Base.dll - - - ..\packages\Syncfusion.Chart.Windows.19.4.0.56\lib\net46\Syncfusion.Chart.Windows.dll - - - ..\packages\Syncfusion.Compression.Base.19.4.0.56\lib\net46\Syncfusion.Compression.Base.dll - - - ..\packages\Syncfusion.Core.WinForms.19.4.0.56\lib\net46\Syncfusion.Core.WinForms.dll - - - ..\packages\Syncfusion.DocIO.WinForms.19.4.0.56\lib\net46\Syncfusion.DocIO.Base.dll - - - ..\packages\Syncfusion.DocToPDFConverter.WinForms.19.4.0.56\lib\net46\Syncfusion.DocToPdfConverter.Base.dll - - - ..\packages\Syncfusion.Grid.Base.19.4.0.56\lib\net46\Syncfusion.Grid.Base.dll - - - ..\packages\Syncfusion.Grid.Windows.19.4.0.56\lib\net46\Syncfusion.Grid.Windows.dll - - - ..\packages\Syncfusion.Grouping.Base.19.4.0.56\lib\net46\Syncfusion.Grouping.Base.dll - - - ..\packages\Syncfusion.Licensing.19.4.0.56\lib\net46\Syncfusion.Licensing.dll - - - ..\packages\Syncfusion.OfficeChart.Base.19.4.0.56\lib\net46\Syncfusion.OfficeChart.Base.dll - - - ..\packages\Syncfusion.Pdf.WinForms.19.4.0.56\lib\net46\Syncfusion.Pdf.Base.dll - - - ..\packages\Syncfusion.PdfViewer.Windows.19.4.0.56\lib\net46\Syncfusion.PdfViewer.Windows.dll - - - ..\packages\Syncfusion.SfInput.WinForms.19.4.0.56\lib\net46\Syncfusion.SfInput.WinForms.dll - - - ..\packages\Syncfusion.SfSpellChecker.WPF.19.4.0.56\lib\net46\Syncfusion.SfSpellChecker.WPF.dll - - - ..\packages\Syncfusion.Shared.Base.19.4.0.56\lib\net46\Syncfusion.Shared.Base.dll - - - ..\packages\Syncfusion.Shared.Windows.19.4.0.56\lib\net46\Syncfusion.Shared.Windows.dll - - - ..\packages\Syncfusion.Shared.WPF.19.4.0.56\lib\net46\Syncfusion.Shared.WPF.dll - - - ..\packages\Syncfusion.SpellChecker.Base.19.4.0.56\lib\net46\Syncfusion.SpellChecker.Base.dll - - - ..\packages\Syncfusion.Tools.Base.19.4.0.56\lib\net46\Syncfusion.Tools.Base.dll - - - ..\packages\Syncfusion.Tools.Windows.19.4.0.56\lib\net46\Syncfusion.Tools.Windows.dll - - - - - - ..\packages\Stub.System.Data.SQLite.Core.NetFramework.1.0.115.5\lib\net46\System.Data.SQLite.dll - - - ..\packages\System.Data.SQLite.EF6.1.0.115.5\lib\net46\System.Data.SQLite.EF6.dll - - - ..\packages\System.Data.SQLite.Linq.1.0.115.5\lib\net46\System.Data.SQLite.Linq.dll - - - - - - - - - - - - - - - ..\dlls\Tinkerforge.dll - - - ..\3rdPackage\WibuCmNET.dll - - - ..\3rdPackage\wupi.net.dll - - - ..\3rdPackage\WupiEngineNet.dll - - - - - - - Form - - - FrmOptions.cs - - - - - - - - - - - - - - - - Form - - - FrmAktuelleBesatzung.cs - - - Form - - - frmAuftraggeberEdit.cs - - - Form - - - frmExceptionWindow.cs - - - Form - - - FrmGetDataFromBluelight.cs - - - Form - - - frmImprägnierBerichtEdit.cs - - - Form - - - frmImprägnierBerichtList.cs - - - Form - - - frmKalibrierungFestlegung.cs - - - Form - - - FrmLinerReste.cs - - - Form - - - frmNewProjekt.cs - - - Form - - - frmObjektEdit.cs - - - Form - - - frmObjekteList.cs - - - Form - - - frmOffsetSet.cs - - - Form - - - FrmPrefixSuffix.cs - - - Form - - - frmProjektList.cs - - - Form - - - frmReparaturKonzept.cs - - - Form - - - frmSanKonzeptList.cs - - - Form - - - frmSelectMassenDate.cs - - - Form - - - frmSelectNewSan.cs - - - Form - - - frmSettings.cs - - - Form - - - frmStrassenList.cs - - - Form - - - frmMain.cs - - - Form - - - frmInfo.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - UserControl - - - UCInliner.cs - - - UserControl - - - UCLinerGrundlagenBrawo.cs - - - UserControl - - - UCWeitereFotos.cs - - - UserControl - - - UCWerkseitigImprägniert.cs - - - FrmOptions.cs - - - FrmAktuelleBesatzung.cs - - - frmAuftraggeberEdit.cs - - - frmExceptionWindow.cs - - - FrmGetDataFromBluelight.cs - - - frmImprägnierBerichtEdit.cs - - - frmImprägnierBerichtList.cs - - - frmKalibrierungFestlegung.cs - - - FrmLinerReste.cs - - - frmNewProjekt.cs - - - frmObjektEdit.cs - - - frmObjekteList.cs - - - frmOffsetSet.cs - - - FrmPrefixSuffix.cs - - - frmProjektList.cs - - - frmReparaturKonzept.cs - - - frmSanKonzeptList.cs - - - frmSelectMassenDate.cs - - - frmSelectNewSan.cs - - - frmSettings.cs - - - frmStrassenList.cs - - - frmMain.cs - - - frmInfo.cs - - - PublicResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - UCInliner.cs - - - UCLinerGrundlagenBrawo.cs - - - UCWeitereFotos.cs - - - PreserveNewest - - - PreserveNewest - - - Always - - - Always - - - PreserveNewest - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - Designer - - - Designer - - - Designer - - - Designer - PreserveNewest - - - Designer - - - Designer - - - - - - - - {324277c6-2eb3-47b7-9dd5-7fa520e7d349} - Dichtheitsprüfung - - - {cf95db30-247b-4382-948e-3bd5eb73c938} - UpdateLib - - - - - UCWerkseitigImprägniert.cs - - - Always - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - git rev-parse HEAD > "$(ProjectDir)\version.txt" - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - \ No newline at end of file + + + + WinExe + net6.0-windows + true + false + + + + + + + + + Always + + + + + + + + + + + + + + + + diff --git a/SanSystem/TempCAN/TemperaturBuilder.cs b/SanSystem/TempCAN/TemperaturBuilder.cs index d0fb342..554314f 100644 --- a/SanSystem/TempCAN/TemperaturBuilder.cs +++ b/SanSystem/TempCAN/TemperaturBuilder.cs @@ -29,8 +29,8 @@ namespace TempCAN { switch(temperaturSchnittstellen) { - case TemperaturSchnittstellen.TINKERFORGE: - return new TinkerForgeTemperatur(); + //case TemperaturSchnittstellen.TINKERFORGE: + //return new TinkerForgeTemperatur(); default: diff --git a/SanSystem/TempCAN/TinkerForgeTemperatur.cs b/SanSystem/TempCAN/TinkerForgeTemperatur.cs index 2cff252..b4a5e75 100644 --- a/SanSystem/TempCAN/TinkerForgeTemperatur.cs +++ b/SanSystem/TempCAN/TinkerForgeTemperatur.cs @@ -1,4 +1,4 @@ -using System; +/*using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -66,3 +66,5 @@ namespace TempCAN } } } +*/ + diff --git a/SanSystem/UCInliner.Designer.cs b/SanSystem/UCInliner.Designer.cs index 06dfc69..5b3672a 100644 --- a/SanSystem/UCInliner.Designer.cs +++ b/SanSystem/UCInliner.Designer.cs @@ -63,6 +63,8 @@ this.cb_stvo = new System.Windows.Forms.CheckBox(); this.cb_wasserhaltung = new System.Windows.Forms.CheckBox(); this.cb_genehmigung = new System.Windows.Forms.CheckBox(); + this.label7 = new System.Windows.Forms.Label(); + this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker(); this.tabControl1.SuspendLayout(); this.tabPage2.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -83,6 +85,8 @@ // // tabPage2 // + this.tabPage2.Controls.Add(this.label7); + this.tabPage2.Controls.Add(this.dateTimePicker1); this.tabPage2.Controls.Add(this.btn_gen_dp); this.tabPage2.Controls.Add(this.label6); this.tabPage2.Controls.Add(this.txt_einbaudruck); @@ -104,18 +108,18 @@ this.tabPage2.Controls.Add(this.cb_stvo); this.tabPage2.Controls.Add(this.cb_wasserhaltung); this.tabPage2.Controls.Add(this.cb_genehmigung); - this.tabPage2.Location = new System.Drawing.Point(4, 29); + this.tabPage2.Location = new System.Drawing.Point(4, 34); this.tabPage2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.tabPage2.Name = "tabPage2"; this.tabPage2.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.tabPage2.Size = new System.Drawing.Size(1336, 669); + this.tabPage2.Size = new System.Drawing.Size(1336, 664); this.tabPage2.TabIndex = 1; this.tabPage2.Text = "Vorraussetzungen"; this.tabPage2.UseVisualStyleBackColor = true; // // btn_gen_dp // - this.btn_gen_dp.Location = new System.Drawing.Point(840, 323); + this.btn_gen_dp.Location = new System.Drawing.Point(946, 323); this.btn_gen_dp.Name = "btn_gen_dp"; this.btn_gen_dp.Size = new System.Drawing.Size(167, 103); this.btn_gen_dp.TabIndex = 43; @@ -126,25 +130,25 @@ // label6 // this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(713, 337); + this.label6.Location = new System.Drawing.Point(713, 393); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(34, 20); + this.label6.Size = new System.Drawing.Size(42, 25); this.label6.TabIndex = 42; this.label6.Text = "Bar"; // // txt_einbaudruck // - this.txt_einbaudruck.Location = new System.Drawing.Point(564, 334); + this.txt_einbaudruck.Location = new System.Drawing.Point(564, 390); this.txt_einbaudruck.Name = "txt_einbaudruck"; - this.txt_einbaudruck.Size = new System.Drawing.Size(138, 26); + this.txt_einbaudruck.Size = new System.Drawing.Size(138, 30); this.txt_einbaudruck.TabIndex = 41; // // label5 // this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(398, 337); + this.label5.Location = new System.Drawing.Point(398, 393); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(98, 20); + this.label5.Size = new System.Drawing.Size(121, 25); this.label5.TabIndex = 40; this.label5.Text = "Einbaudruck"; // @@ -167,25 +171,25 @@ this.cb_preliner.Location = new System.Drawing.Point(8, 130); this.cb_preliner.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.cb_preliner.Name = "cb_preliner"; - this.cb_preliner.Size = new System.Drawing.Size(205, 24); + this.cb_preliner.Size = new System.Drawing.Size(253, 29); this.cb_preliner.TabIndex = 38; this.cb_preliner.Text = "Preliner wurde verwendet"; this.cb_preliner.UseVisualStyleBackColor = true; // // txt_besatzung // - this.txt_besatzung.Location = new System.Drawing.Point(564, 264); + this.txt_besatzung.Location = new System.Drawing.Point(564, 320); this.txt_besatzung.Name = "txt_besatzung"; - this.txt_besatzung.Size = new System.Drawing.Size(296, 26); + this.txt_besatzung.Size = new System.Drawing.Size(296, 30); this.txt_besatzung.TabIndex = 37; this.txt_besatzung.Enter += new System.EventHandler(this.txt_besatzung_Enter); // // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(398, 267); + this.label2.Location = new System.Drawing.Point(398, 323); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(86, 20); + this.label2.Size = new System.Drawing.Size(105, 25); this.label2.TabIndex = 36; this.label2.Text = "Besatzung"; // @@ -206,7 +210,7 @@ this.cb_mech.AutoSize = true; this.cb_mech.Location = new System.Drawing.Point(6, 90); this.cb_mech.Name = "cb_mech"; - this.cb_mech.Size = new System.Drawing.Size(113, 24); + this.cb_mech.Size = new System.Drawing.Size(140, 29); this.cb_mech.TabIndex = 2; this.cb_mech.Text = "Mechanisch"; this.cb_mech.UseVisualStyleBackColor = true; @@ -216,7 +220,7 @@ this.cb_roboter.AutoSize = true; this.cb_roboter.Location = new System.Drawing.Point(6, 60); this.cb_roboter.Name = "cb_roboter"; - this.cb_roboter.Size = new System.Drawing.Size(86, 24); + this.cb_roboter.Size = new System.Drawing.Size(102, 29); this.cb_roboter.TabIndex = 1; this.cb_roboter.Text = "Roboter"; this.cb_roboter.UseVisualStyleBackColor = true; @@ -228,7 +232,7 @@ this.cb_hd.CheckState = System.Windows.Forms.CheckState.Checked; this.cb_hd.Location = new System.Drawing.Point(6, 29); this.cb_hd.Name = "cb_hd"; - this.cb_hd.Size = new System.Drawing.Size(56, 24); + this.cb_hd.Size = new System.Drawing.Size(67, 29); this.cb_hd.TabIndex = 0; this.cb_hd.Text = "HD "; this.cb_hd.UseVisualStyleBackColor = true; @@ -245,7 +249,7 @@ // // ftpProgress // - this.ftpProgress.Location = new System.Drawing.Point(140, 454); + this.ftpProgress.Location = new System.Drawing.Point(84, 454); this.ftpProgress.Name = "ftpProgress"; this.ftpProgress.Size = new System.Drawing.Size(280, 37); this.ftpProgress.TabIndex = 29; @@ -266,7 +270,7 @@ this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(398, 237); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(108, 20); + this.label1.Size = new System.Drawing.Size(132, 25); this.label1.TabIndex = 27; this.label1.Text = "Eingebaut am"; // @@ -274,7 +278,7 @@ // this.dt_eingebaut.Location = new System.Drawing.Point(562, 232); this.dt_eingebaut.Name = "dt_eingebaut"; - this.dt_eingebaut.Size = new System.Drawing.Size(325, 26); + this.dt_eingebaut.Size = new System.Drawing.Size(325, 30); this.dt_eingebaut.TabIndex = 26; // // cb_fertig @@ -284,7 +288,7 @@ this.cb_fertig.Font = new System.Drawing.Font("Microsoft Sans Serif", 20.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.cb_fertig.Location = new System.Drawing.Point(13, 323); this.cb_fertig.Name = "cb_fertig"; - this.cb_fertig.Size = new System.Drawing.Size(100, 35); + this.cb_fertig.Size = new System.Drawing.Size(122, 43); this.cb_fertig.TabIndex = 25; this.cb_fertig.Text = "Fertig"; this.cb_fertig.UseVisualStyleBackColor = true; @@ -298,18 +302,18 @@ "Trocken", "Niederschlag", "Schnee - Eisschmelze"}); - this.cbb_wetter.Location = new System.Drawing.Point(564, 296); + this.cbb_wetter.Location = new System.Drawing.Point(564, 352); this.cbb_wetter.Name = "cbb_wetter"; - this.cbb_wetter.Size = new System.Drawing.Size(191, 28); + this.cbb_wetter.Size = new System.Drawing.Size(191, 33); this.cbb_wetter.TabIndex = 23; // // label24 // this.label24.AutoSize = true; this.label24.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label24.Location = new System.Drawing.Point(398, 300); + this.label24.Location = new System.Drawing.Point(398, 356); this.label24.Name = "label24"; - this.label24.Size = new System.Drawing.Size(57, 20); + this.label24.Size = new System.Drawing.Size(70, 25); this.label24.TabIndex = 24; this.label24.Text = "Wetter"; // @@ -335,14 +339,14 @@ // this.txt_einbau_temp.Location = new System.Drawing.Point(229, 166); this.txt_einbau_temp.Name = "txt_einbau_temp"; - this.txt_einbau_temp.Size = new System.Drawing.Size(100, 26); + this.txt_einbau_temp.Size = new System.Drawing.Size(100, 30); this.txt_einbau_temp.TabIndex = 22; // // txt_lagerung_temp // this.txt_lagerung_temp.Location = new System.Drawing.Point(229, 123); this.txt_lagerung_temp.Name = "txt_lagerung_temp"; - this.txt_lagerung_temp.Size = new System.Drawing.Size(100, 26); + this.txt_lagerung_temp.Size = new System.Drawing.Size(100, 30); this.txt_lagerung_temp.TabIndex = 21; // // label4 @@ -350,7 +354,7 @@ this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(15, 171); this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(136, 20); + this.label4.Size = new System.Drawing.Size(168, 25); this.label4.TabIndex = 20; this.label4.Text = "Liner beim Einbau"; // @@ -359,7 +363,7 @@ this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(15, 123); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(106, 20); + this.label3.Size = new System.Drawing.Size(131, 25); this.label3.TabIndex = 19; this.label3.Text = "Linerlagerung"; // @@ -377,14 +381,14 @@ // this.txt_temp_kanal.Location = new System.Drawing.Point(229, 75); this.txt_temp_kanal.Name = "txt_temp_kanal"; - this.txt_temp_kanal.Size = new System.Drawing.Size(100, 26); + this.txt_temp_kanal.Size = new System.Drawing.Size(100, 30); this.txt_temp_kanal.TabIndex = 18; // // txt_temp_aussen // this.txt_temp_aussen.Location = new System.Drawing.Point(229, 32); this.txt_temp_aussen.Name = "txt_temp_aussen"; - this.txt_temp_aussen.Size = new System.Drawing.Size(100, 26); + this.txt_temp_aussen.Size = new System.Drawing.Size(100, 30); this.txt_temp_aussen.TabIndex = 17; // // label23 @@ -392,7 +396,7 @@ this.label23.AutoSize = true; this.label23.Location = new System.Drawing.Point(15, 80); this.label23.Name = "label23"; - this.label23.Size = new System.Drawing.Size(49, 20); + this.label23.Size = new System.Drawing.Size(63, 25); this.label23.TabIndex = 1; this.label23.Text = "Kanal"; // @@ -401,7 +405,7 @@ this.label22.AutoSize = true; this.label22.Location = new System.Drawing.Point(15, 34); this.label22.Name = "label22"; - this.label22.Size = new System.Drawing.Size(63, 20); + this.label22.Size = new System.Drawing.Size(79, 25); this.label22.TabIndex = 0; this.label22.Text = "Aussen"; // @@ -414,7 +418,7 @@ this.cb_stvo.Location = new System.Drawing.Point(8, 91); this.cb_stvo.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.cb_stvo.Name = "cb_stvo"; - this.cb_stvo.Size = new System.Drawing.Size(263, 24); + this.cb_stvo.Size = new System.Drawing.Size(323, 29); this.cb_stvo.TabIndex = 16; this.cb_stvo.Text = "Es wurde nach StVO abgesichert"; this.cb_stvo.UseVisualStyleBackColor = true; @@ -428,7 +432,7 @@ this.cb_wasserhaltung.Location = new System.Drawing.Point(8, 57); this.cb_wasserhaltung.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.cb_wasserhaltung.Name = "cb_wasserhaltung"; - this.cb_wasserhaltung.Size = new System.Drawing.Size(269, 24); + this.cb_wasserhaltung.Size = new System.Drawing.Size(329, 29); this.cb_wasserhaltung.TabIndex = 15; this.cb_wasserhaltung.Text = "Wasserhaltung wurde eingerichtet"; this.cb_wasserhaltung.UseVisualStyleBackColor = true; @@ -442,14 +446,32 @@ this.cb_genehmigung.Location = new System.Drawing.Point(8, 23); this.cb_genehmigung.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.cb_genehmigung.Name = "cb_genehmigung"; - this.cb_genehmigung.Size = new System.Drawing.Size(245, 24); + this.cb_genehmigung.Size = new System.Drawing.Size(299, 29); this.cb_genehmigung.TabIndex = 14; this.cb_genehmigung.Text = "Genehmigung wurde eingeholt"; this.cb_genehmigung.UseVisualStyleBackColor = true; // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(398, 278); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(153, 25); + this.label7.TabIndex = 45; + this.label7.Text = "TV Kontrolle am"; + this.label7.Click += new System.EventHandler(this.label7_Click); + // + // dateTimePicker1 + // + this.dateTimePicker1.Location = new System.Drawing.Point(562, 273); + this.dateTimePicker1.Name = "dateTimePicker1"; + this.dateTimePicker1.Size = new System.Drawing.Size(510, 30); + this.dateTimePicker1.TabIndex = 44; + this.dateTimePicker1.ValueChanged += new System.EventHandler(this.dateTimePicker1_ValueChanged); + // // UCInliner // - this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F); + this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 25F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.tabControl1); this.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); @@ -505,5 +527,7 @@ private System.Windows.Forms.Label label5; private System.Windows.Forms.Label label6; private System.Windows.Forms.Button btn_gen_dp; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.DateTimePicker dateTimePicker1; } } diff --git a/SanSystem/UCInliner.cs b/SanSystem/UCInliner.cs index 22c66ef..a0e0598 100644 --- a/SanSystem/UCInliner.cs +++ b/SanSystem/UCInliner.cs @@ -11,12 +11,12 @@ using KlassenBIB; using System.Diagnostics; using System.IO; using SanShared; -using FluentFTP; + using System.Collections; using CSVParser; using BerichtGen; using SanShared.Exceptions; -using Dichtheitsprüfung; +//using Dichtheitsprüfung; using System.Threading; namespace SanSystem @@ -144,6 +144,7 @@ namespace SanSystem txt_temp_aussen.Update(); } + /* private void DownloadFromUV() { Progress progress = new Progress(x => @@ -159,7 +160,7 @@ namespace SanSystem }); try { - + FtpClient client = new FtpClient("192.168.250.2"); client.Port = 21; client.DataConnectionType = FtpDataConnectionType.AutoActive; @@ -199,6 +200,7 @@ namespace SanSystem } } + */ private void btn_transfer_ftp_Click(object sender, EventArgs e) { @@ -221,12 +223,12 @@ namespace SanSystem filenames.Clear(); if (MessageBox.Show("Bitte stellen Sie sicher, dass der Server antwortet und dass nur die Dateien vorhanden sind!, Bitte beachten Sie, dass das fenster einfrieren kann", "WARNUNG", MessageBoxButtons.OKCancel, MessageBoxIcon.Stop) == DialogResult.OK) { - DownloadFromUV(); + //DownloadFromUV(); } } } - private void ListFiles(FtpClient client, string directory) + /*private void ListFiles(FtpClient client, string directory) { client.ListingParser = FtpParser.Unix; foreach (FtpListItem item in client.GetListing(directory, FtpListOption.ForceNameList)) @@ -241,6 +243,7 @@ namespace SanSystem } } } + */ private bool AccessCSV() { @@ -347,6 +350,7 @@ namespace SanSystem options.ShowDialog(); } + /* private void GeneriereDP() { #if DEBUG @@ -382,6 +386,7 @@ namespace SanSystem } #endif } + */ private void Btn_gen_dp_Click(object sender, EventArgs e) { @@ -399,9 +404,9 @@ namespace SanSystem } - Thread generateDichtheitsprüfung = new Thread(GeneriereDP); - generateDichtheitsprüfung.IsBackground = true; - generateDichtheitsprüfung.Start(); + //Thread generateDichtheitsprüfung = new Thread(GeneriereDP); + //generateDichtheitsprüfung.IsBackground = true; + //generateDichtheitsprüfung.Start(); } @@ -412,5 +417,15 @@ namespace SanSystem txt_besatzung.Text = Global.Instance.AktuelleBesatzung; } } + + private void label7_Click(object sender, EventArgs e) + { + + } + + private void dateTimePicker1_ValueChanged(object sender, EventArgs e) + { + + } } } diff --git a/SanSystem/frmMain.Designer.cs b/SanSystem/frmMain.Designer.cs index 63ebe6b..0486b08 100644 --- a/SanSystem/frmMain.Designer.cs +++ b/SanSystem/frmMain.Designer.cs @@ -47,7 +47,7 @@ this.toolStripStatus_projekt_Label = new System.Windows.Forms.ToolStripStatusLabel(); this.toolstrip_gesamtLiner = new System.Windows.Forms.ToolStripStatusLabel(); this.toolstrip_messages = new System.Windows.Forms.ToolStripStatusLabel(); - this.update = new UpdateLib.Updater(); +// this.update = new UpdateLib.Updater(); this.speichernToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.imprägnierberichteToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.massenstatistikToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); @@ -195,7 +195,7 @@ // // update // - this.update.UpdateUrl = "http://home.cosysda.de/sanverwaltung/UpdateInfo.dat"; + //this.update.UpdateUrl = "http://home.cosysda.de/sanverwaltung/UpdateInfo.dat"; // // speichernToolStripMenuItem1 // @@ -271,7 +271,7 @@ private System.Windows.Forms.ToolStripMenuItem verbrauchToolStripMenuItem; private System.Windows.Forms.ToolStripStatusLabel toolstrip_gesamtLiner; private System.Windows.Forms.ToolStripMenuItem prefixSuffixToolStripMenuItem; - private UpdateLib.Updater update; + // private UpdateLib.Updater update; private System.Windows.Forms.ToolStripStatusLabel toolstrip_messages; private System.Windows.Forms.ToolStripMenuItem exportFürBüroErstellenToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem speichernToolStripMenuItem1; diff --git a/SanSystem/frmMain.cs b/SanSystem/frmMain.cs index 513f2df..6382f12 100644 --- a/SanSystem/frmMain.cs +++ b/SanSystem/frmMain.cs @@ -32,7 +32,7 @@ namespace SanSystem #if !DEBUG update.CheckForUpdates(); #endif - string sx = Properties.Settings.Default.DATABASEMAIN; + string sx = ""; Datenbank.Instance.pfad = sx; @@ -40,7 +40,7 @@ namespace SanSystem if (!Directory.Exists(Global.Instance.Projektpfad)) Directory.CreateDirectory(Global.Instance.Projektpfad); try { - Datenbank.Instance.LoadProjekt(Global.Instance.ProjektNummer);// Path.Combine(Global.Instance.Projektpfad,"18-850.xaml")); + Datenbank.Instance.LoadProjekt(Global.Instance.ProjektNummer); } catch(DataBaseVersionMismatchException ex) { From 1c4f581f2813cd2847d90bd752b8b4e84270ac7c Mon Sep 17 00:00:00 2001 From: Damian Wessels Date: Sat, 14 Jan 2023 12:20:47 +0100 Subject: [PATCH 7/8] EF core added --- SanSystem/BüroExporter.cs | 3 +- SanSystem/FrmNewProjekt.cs | 28 ++- SanSystem/Global.cs | 12 - SanSystem/KlassenBIB/Auftraggeber.cs | 2 +- SanSystem/KlassenBIB/DBModel.cs | 13 + SanSystem/KlassenBIB/Inspektionsobjekt.cs | 18 +- SanSystem/KlassenBIB/Projekt.cs | 8 +- .../Sanierung/Renovation/InlinerSanierung.cs | 2 +- SanSystem/KlassenBIB/Sanierung/Reparatur.cs | 2 +- SanSystem/KlassenBIB/Sanierung/Sanierung.cs | 4 +- SanSystem/KlassenBIB/SchachtAnbindung.cs | 2 +- .../20230114101006_InitialCreate.Designer.cs | 226 ++++++++++++++++++ .../20230114101006_InitialCreate.cs | 153 ++++++++++++ .../SanVerwalterContextModelSnapshot.cs | 224 +++++++++++++++++ SanSystem/Program.cs | 1 + SanSystem/SanSystem.csproj | 19 +- SanSystem/SanVerwalterContext.cs | 32 +++ SanSystem/SanVerwaltung.db | Bin 0 -> 49152 bytes SanSystem/SchnittstelleImporter/I2006XML.cs | 2 +- SanSystem/UCInliner.cs | 2 +- SanSystem/frmMain.cs | 4 +- SanSystem/frmObjektEdit.cs | 6 +- SanSystem/frmObjekteList.cs | 2 +- SanSystem/frmStrassenList.cs | 7 +- 24 files changed, 719 insertions(+), 53 deletions(-) create mode 100644 SanSystem/KlassenBIB/DBModel.cs create mode 100644 SanSystem/Migrations/20230114101006_InitialCreate.Designer.cs create mode 100644 SanSystem/Migrations/20230114101006_InitialCreate.cs create mode 100644 SanSystem/Migrations/SanVerwalterContextModelSnapshot.cs create mode 100644 SanSystem/SanVerwalterContext.cs create mode 100644 SanSystem/SanVerwaltung.db diff --git a/SanSystem/BüroExporter.cs b/SanSystem/BüroExporter.cs index b527712..f912fb8 100644 --- a/SanSystem/BüroExporter.cs +++ b/SanSystem/BüroExporter.cs @@ -58,7 +58,7 @@ namespace SanSystem } else if (san is KlassenBIB.SchachtAnbindung) { - string sourceDirectory = san.CheckVerzeichnisse(Global.Instance.Projektpfad); + /*string sourceDirectory = san.CheckVerzeichnisse(Global.Instance.Projektpfad); SchachtAnbindung fotoDokumentation = (san as SchachtAnbindung); KlassenBIB.Collections.Bilder fotos = fotoDokumentation.SavedBilders; foreach (SavedBilder foto in fotos) @@ -70,6 +70,7 @@ namespace SanSystem File.Copy(foto.Speicherpfad, Path.Combine(tempPath, destinationName)); } + */ } } diff --git a/SanSystem/FrmNewProjekt.cs b/SanSystem/FrmNewProjekt.cs index a2c4a55..184267a 100644 --- a/SanSystem/FrmNewProjekt.cs +++ b/SanSystem/FrmNewProjekt.cs @@ -25,26 +25,30 @@ namespace SanSystem InitializeComponent(); } - private bool project_already_excist(string projektnummer) - { - return Datenbank.Instance.TeufelDB.Projekte.FindAll(x => x.Nummer.Equals(projektnummer)).Count > 0; - } - private void btn_save_Click(object sender, EventArgs e) { - if(project_already_excist(txt_pro_nr.Text)) + using (var context = new SanVerwalterContext()) { - MessageBox.Show(string.Format("Projekt mit den nummer {0} excistiert bereits. Projekt wird nicht angelegt", txt_pro_nr.Text)); - return; + if (project_already_exist(context, txt_pro_nr.Text)) + { + MessageBox.Show(string.Format("Projekt mit den nummer {0} excistiert bereits. Projekt wird nicht angelegt", txt_pro_nr.Text)); + return; + } + Projekt projekt = new Projekt(); + projekt.Nummer = txt_pro_nr.Text; + projekt.Ort = txt_ort.Text; + context.Projekte.Add(projekt); + context.SaveChanges(); } - Projekt projekt = new Projekt(); - projekt.Nummer = txt_pro_nr.Text; - projekt.Ort = txt_ort.Text; - Global.Instance.SetProjekt(projekt); this.Close(); //Global.Instance.ChangeProjekt(txt_pro_nr.Text); } + private bool project_already_exist(SanVerwalterContext context, string text) + { + return context.Projekte.Count(x => x.Nummer.Equals(text)) > 0; + } + private void txt_pro_nr_KeyPress(object sender, KeyPressEventArgs e) { if(e.KeyChar == '/' || e.KeyChar == '\\') diff --git a/SanSystem/Global.cs b/SanSystem/Global.cs index 934e76c..cabdb5e 100644 --- a/SanSystem/Global.cs +++ b/SanSystem/Global.cs @@ -95,18 +95,6 @@ namespace SanSystem } } - internal void SetProjekt(Projekt projekt) - { - Database.Datenbank.Instance.SaveProjekt(); - this.ProjektNummer = projekt.Nummer; - Database.Datenbank.Instance.loadedProjekt = null; - Database.Datenbank.Instance.LoadProjekt(projekt.Nummer); - - if (!Directory.Exists(Projektpfad)) Directory.CreateDirectory(Projektpfad); - Database.Datenbank.Instance.TeufelDB.Projekte.Add(projekt); - Database.Datenbank.Instance.InitProjekt(projekt, Projektpfad); - } - public string Projektpfad { get diff --git a/SanSystem/KlassenBIB/Auftraggeber.cs b/SanSystem/KlassenBIB/Auftraggeber.cs index 845ebf3..bc529cd 100644 --- a/SanSystem/KlassenBIB/Auftraggeber.cs +++ b/SanSystem/KlassenBIB/Auftraggeber.cs @@ -10,7 +10,7 @@ namespace KlassenBIB /// /// /// - public class Auftraggeber :IAuftraggeber + public class Auftraggeber : DBModel, IAuftraggeber { /// /// diff --git a/SanSystem/KlassenBIB/DBModel.cs b/SanSystem/KlassenBIB/DBModel.cs new file mode 100644 index 0000000..5887593 --- /dev/null +++ b/SanSystem/KlassenBIB/DBModel.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace KlassenBIB +{ + public abstract class DBModel + { + public int Id { get; set; } + } +} diff --git a/SanSystem/KlassenBIB/Inspektionsobjekt.cs b/SanSystem/KlassenBIB/Inspektionsobjekt.cs index 5a9fa74..7d7e406 100644 --- a/SanSystem/KlassenBIB/Inspektionsobjekt.cs +++ b/SanSystem/KlassenBIB/Inspektionsobjekt.cs @@ -1,6 +1,7 @@ using SanShared; using System; using System.Collections.Generic; +using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -11,11 +12,11 @@ namespace KlassenBIB /// /// /// - public class Inspektionsobjekt + public class Inspektionsobjekt: DBModel { private string strasseName = "none"; - public IAuftraggeber OverrideAuftraggeber { get; set; } + public Auftraggeber OverrideAuftraggeber { get; set; } public bool GeschlossenesEnde { get; set; } public string StrasseName { get => strasseName; set => strasseName = value; } @@ -42,25 +43,26 @@ namespace KlassenBIB public DateTime HaltungGemessen { get; set; } - public Collections.Inspektionskuerzeln Schadenskuerzeln { get; set; } + //public Collections.Inspektionskuerzeln Schadenskuerzeln { get; set; } public string Bemerkung { get; set; } - + + [NotMapped] public Collections.Sanierung Sanierung { get;set; } - public Collections.AusgefuehrteTaetigkeiten AusgefuehrteTaetigkeiten { get; set; } + //public Collections.AusgefuehrteTaetigkeiten AusgefuehrteTaetigkeiten { get; set; } public string Inspektionsrichtung { get; set; } public string Sanierungsnummer { get; set; } - public Guid Guid { get; set; } + public Inspektionsobjekt() { - Schadenskuerzeln = new Collections.Inspektionskuerzeln(); + //Schadenskuerzeln = new Collections.Inspektionskuerzeln(); Sanierung = new Collections.Sanierung(); - AusgefuehrteTaetigkeiten = new Collections.AusgefuehrteTaetigkeiten(); + //AusgefuehrteTaetigkeiten = new Collections.AusgefuehrteTaetigkeiten(); if (HaltungGemessen <= DateTime.MinValue || HaltungGemessen >= DateTime.MaxValue) HaltungGemessen = DateTime.Now; } } diff --git a/SanSystem/KlassenBIB/Projekt.cs b/SanSystem/KlassenBIB/Projekt.cs index 711c86d..715891b 100644 --- a/SanSystem/KlassenBIB/Projekt.cs +++ b/SanSystem/KlassenBIB/Projekt.cs @@ -8,12 +8,12 @@ using System.Windows.Markup; namespace KlassenBIB { - public class Projekt :IProjekt + public class Projekt: DBModel //:IProjekt { public string Nummer { get; set; } public string Ort { get; set; } - public IAuftraggeber Auftraggeber { get; set; } - public Collections.Leistungsverzeichnis Leistungsverzeichnis { get; set; } + public Auftraggeber Auftraggeber { get; set; } + //public Collections.Leistungsverzeichnis Leistungsverzeichnis { get; set; } public Collections.AbwasserTechnischeAnlage Objekte { get; set; } public string SanierungsIDPrefix { get; set; } public string SanierungsIDSuffix { get; set; } @@ -23,7 +23,7 @@ namespace KlassenBIB public Projekt() { Objekte = new Collections.AbwasserTechnischeAnlage(); - Leistungsverzeichnis = new Collections.Leistungsverzeichnis(); + //Leistungsverzeichnis = new Collections.Leistungsverzeichnis(); Auftraggeber = new Auftraggeber(); } } diff --git a/SanSystem/KlassenBIB/Sanierung/Renovation/InlinerSanierung.cs b/SanSystem/KlassenBIB/Sanierung/Renovation/InlinerSanierung.cs index 0bc0343..2530261 100644 --- a/SanSystem/KlassenBIB/Sanierung/Renovation/InlinerSanierung.cs +++ b/SanSystem/KlassenBIB/Sanierung/Renovation/InlinerSanierung.cs @@ -51,7 +51,7 @@ namespace KlassenBIB return haltungslaenge * harzbedarf; } - public override string CheckVerzeichnisse(string projektpfad) + public string CheckVerzeichnisse(string projektpfad) { string path = Path.Combine(projektpfad, PfadZurSan); if (!Directory.Exists(path)) Directory.CreateDirectory(path); diff --git a/SanSystem/KlassenBIB/Sanierung/Reparatur.cs b/SanSystem/KlassenBIB/Sanierung/Reparatur.cs index 465cddc..2c1e693 100644 --- a/SanSystem/KlassenBIB/Sanierung/Reparatur.cs +++ b/SanSystem/KlassenBIB/Sanierung/Reparatur.cs @@ -32,7 +32,7 @@ namespace KlassenBIB /// /// /// - public override string CheckVerzeichnisse(string projektpfad) + public string CheckVerzeichnisse(string projektpfad) { throw new NotImplementedException(); } diff --git a/SanSystem/KlassenBIB/Sanierung/Sanierung.cs b/SanSystem/KlassenBIB/Sanierung/Sanierung.cs index 4a375c3..8bef836 100644 --- a/SanSystem/KlassenBIB/Sanierung/Sanierung.cs +++ b/SanSystem/KlassenBIB/Sanierung/Sanierung.cs @@ -10,7 +10,7 @@ namespace KlassenBIB { [EditorBrowsable(EditorBrowsableState.Never)] [Browsable(false)] - public abstract class Sanierung : INotifyPropertyChanged + public class Sanierung : INotifyPropertyChanged { Guid guid; double tempAusen; @@ -37,7 +37,7 @@ namespace KlassenBIB } - public abstract string CheckVerzeichnisse(string projektpfad); + //public string CheckVerzeichnisse(string projektpfad); public Guid Guid { get => guid; set => guid = value; } diff --git a/SanSystem/KlassenBIB/SchachtAnbindung.cs b/SanSystem/KlassenBIB/SchachtAnbindung.cs index 27770e5..601bafe 100644 --- a/SanSystem/KlassenBIB/SchachtAnbindung.cs +++ b/SanSystem/KlassenBIB/SchachtAnbindung.cs @@ -37,7 +37,7 @@ namespace KlassenBIB /// /// /// - public override string CheckVerzeichnisse(string projektpfad) + public string CheckVerzeichnisse(string projektpfad) { string path = Path.Combine(projektpfad, PfadZurSan); if (!Directory.Exists(path)) Directory.CreateDirectory(path); diff --git a/SanSystem/Migrations/20230114101006_InitialCreate.Designer.cs b/SanSystem/Migrations/20230114101006_InitialCreate.Designer.cs new file mode 100644 index 0000000..5b2c3a7 --- /dev/null +++ b/SanSystem/Migrations/20230114101006_InitialCreate.Designer.cs @@ -0,0 +1,226 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using SanSystem; + +#nullable disable + +namespace SanSystem.Migrations +{ + [DbContext(typeof(SanVerwalterContext))] + [Migration("20230114101006_InitialCreate")] + partial class InitialCreate + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "6.0.0"); + + modelBuilder.Entity("KlassenBIB.Auftraggeber", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Ansprechpartner") + .HasColumnType("TEXT"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("Ort") + .HasColumnType("TEXT"); + + b.Property("Strasse") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Auftraggebers"); + }); + + modelBuilder.Entity("KlassenBIB.Inspektionsobjekt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Bemerkung") + .HasColumnType("TEXT"); + + b.Property("BisPunkt") + .HasColumnType("TEXT"); + + b.Property("GeschlossenesEnde") + .HasColumnType("INTEGER"); + + b.Property("Guid") + .HasColumnType("TEXT"); + + b.Property("HaltungGemessen") + .HasColumnType("TEXT"); + + b.Property("Haltungslaenge") + .HasColumnType("REAL"); + + b.Property("Hausnummer") + .HasColumnType("TEXT"); + + b.Property("Inspektionsrichtung") + .HasColumnType("TEXT"); + + b.Property("Kanalrohrweite") + .HasColumnType("INTEGER"); + + b.Property("Objektbezeichnung") + .HasColumnType("TEXT"); + + b.Property("OrtName") + .HasColumnType("TEXT"); + + b.Property("OverrideAuftraggeberId") + .HasColumnType("INTEGER"); + + b.Property("ProjektId") + .HasColumnType("INTEGER"); + + b.Property("Projektnummer") + .HasColumnType("TEXT"); + + b.Property("RohrMaterial") + .HasColumnType("TEXT"); + + b.Property("Sanierungsnummer") + .HasColumnType("TEXT"); + + b.Property("Schachtlaenge") + .HasColumnType("REAL"); + + b.Property("StrasseName") + .HasColumnType("TEXT"); + + b.Property("VonPunkt") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("OverrideAuftraggeberId"); + + b.HasIndex("ProjektId"); + + b.ToTable("InspektionObjekte"); + }); + + modelBuilder.Entity("KlassenBIB.Projekt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AuftraggeberId") + .HasColumnType("INTEGER"); + + b.Property("Nummer") + .HasColumnType("TEXT"); + + b.Property("Ort") + .HasColumnType("TEXT"); + + b.Property("SanierungsIDPrefix") + .HasColumnType("TEXT"); + + b.Property("SanierungsIDSuffix") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("AuftraggeberId"); + + b.ToTable("Projekte"); + }); + + modelBuilder.Entity("KlassenBIB.Sanierung", b => + { + b.Property("GenehmigungVorhanden") + .HasColumnType("INTEGER"); + + b.Property("Guid") + .HasColumnType("TEXT"); + + b.Property("HDReinigung") + .HasColumnType("INTEGER"); + + b.Property("HDReinigungDatum") + .HasColumnType("TEXT"); + + b.Property("InspektionsobjektId") + .HasColumnType("INTEGER"); + + b.Property("STVOAbsicherung") + .HasColumnType("INTEGER"); + + b.Property("TempAusen") + .HasColumnType("REAL"); + + b.Property("TempKanal") + .HasColumnType("REAL"); + + b.Property("VorbereitetMechanisch") + .HasColumnType("INTEGER"); + + b.Property("VorbereitetRoboter") + .HasColumnType("INTEGER"); + + b.Property("WasserhaltungEingerichtet") + .HasColumnType("INTEGER"); + + b.Property("Wetter") + .HasColumnType("TEXT"); + + b.HasIndex("InspektionsobjektId"); + + b.ToTable("Sanierung"); + }); + + modelBuilder.Entity("KlassenBIB.Inspektionsobjekt", b => + { + b.HasOne("KlassenBIB.Auftraggeber", "OverrideAuftraggeber") + .WithMany() + .HasForeignKey("OverrideAuftraggeberId"); + + b.HasOne("KlassenBIB.Projekt", null) + .WithMany("Objekte") + .HasForeignKey("ProjektId"); + + b.Navigation("OverrideAuftraggeber"); + }); + + modelBuilder.Entity("KlassenBIB.Projekt", b => + { + b.HasOne("KlassenBIB.Auftraggeber", "Auftraggeber") + .WithMany() + .HasForeignKey("AuftraggeberId"); + + b.Navigation("Auftraggeber"); + }); + + modelBuilder.Entity("KlassenBIB.Sanierung", b => + { + b.HasOne("KlassenBIB.Inspektionsobjekt", "Inspektionsobjekt") + .WithMany() + .HasForeignKey("InspektionsobjektId"); + + b.Navigation("Inspektionsobjekt"); + }); + + modelBuilder.Entity("KlassenBIB.Projekt", b => + { + b.Navigation("Objekte"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/SanSystem/Migrations/20230114101006_InitialCreate.cs b/SanSystem/Migrations/20230114101006_InitialCreate.cs new file mode 100644 index 0000000..c915327 --- /dev/null +++ b/SanSystem/Migrations/20230114101006_InitialCreate.cs @@ -0,0 +1,153 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace SanSystem.Migrations +{ + public partial class InitialCreate : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "Auftraggebers", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Name = table.Column(type: "TEXT", nullable: true), + Strasse = table.Column(type: "TEXT", nullable: true), + Ort = table.Column(type: "TEXT", nullable: true), + Ansprechpartner = table.Column(type: "TEXT", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Auftraggebers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Projekte", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + Nummer = table.Column(type: "TEXT", nullable: true), + Ort = table.Column(type: "TEXT", nullable: true), + AuftraggeberId = table.Column(type: "INTEGER", nullable: true), + SanierungsIDPrefix = table.Column(type: "TEXT", nullable: true), + SanierungsIDSuffix = table.Column(type: "TEXT", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Projekte", x => x.Id); + table.ForeignKey( + name: "FK_Projekte_Auftraggebers_AuftraggeberId", + column: x => x.AuftraggeberId, + principalTable: "Auftraggebers", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "InspektionObjekte", + columns: table => new + { + Id = table.Column(type: "INTEGER", nullable: false) + .Annotation("Sqlite:Autoincrement", true), + OverrideAuftraggeberId = table.Column(type: "INTEGER", nullable: true), + GeschlossenesEnde = table.Column(type: "INTEGER", nullable: false), + StrasseName = table.Column(type: "TEXT", nullable: true), + OrtName = table.Column(type: "TEXT", nullable: true), + Hausnummer = table.Column(type: "TEXT", nullable: true), + Projektnummer = table.Column(type: "TEXT", nullable: true), + Objektbezeichnung = table.Column(type: "TEXT", nullable: true), + VonPunkt = table.Column(type: "TEXT", nullable: true), + BisPunkt = table.Column(type: "TEXT", nullable: true), + RohrMaterial = table.Column(type: "TEXT", nullable: true), + Kanalrohrweite = table.Column(type: "INTEGER", nullable: false), + Haltungslaenge = table.Column(type: "REAL", nullable: false), + Schachtlaenge = table.Column(type: "REAL", nullable: false), + HaltungGemessen = table.Column(type: "TEXT", nullable: false), + Bemerkung = table.Column(type: "TEXT", nullable: true), + Inspektionsrichtung = table.Column(type: "TEXT", nullable: true), + Sanierungsnummer = table.Column(type: "TEXT", nullable: true), + Guid = table.Column(type: "TEXT", nullable: false), + ProjektId = table.Column(type: "INTEGER", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_InspektionObjekte", x => x.Id); + table.ForeignKey( + name: "FK_InspektionObjekte_Auftraggebers_OverrideAuftraggeberId", + column: x => x.OverrideAuftraggeberId, + principalTable: "Auftraggebers", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_InspektionObjekte_Projekte_ProjektId", + column: x => x.ProjektId, + principalTable: "Projekte", + principalColumn: "Id"); + }); + + migrationBuilder.CreateTable( + name: "Sanierung", + columns: table => new + { + Guid = table.Column(type: "TEXT", nullable: false), + TempAusen = table.Column(type: "REAL", nullable: false), + TempKanal = table.Column(type: "REAL", nullable: false), + Wetter = table.Column(type: "TEXT", nullable: true), + GenehmigungVorhanden = table.Column(type: "INTEGER", nullable: false), + WasserhaltungEingerichtet = table.Column(type: "INTEGER", nullable: false), + STVOAbsicherung = table.Column(type: "INTEGER", nullable: false), + HDReinigung = table.Column(type: "INTEGER", nullable: false), + HDReinigungDatum = table.Column(type: "TEXT", nullable: false), + InspektionsobjektId = table.Column(type: "INTEGER", nullable: true), + VorbereitetMechanisch = table.Column(type: "INTEGER", nullable: false), + VorbereitetRoboter = table.Column(type: "INTEGER", nullable: false) + }, + constraints: table => + { + table.ForeignKey( + name: "FK_Sanierung_InspektionObjekte_InspektionsobjektId", + column: x => x.InspektionsobjektId, + principalTable: "InspektionObjekte", + principalColumn: "Id"); + }); + + migrationBuilder.CreateIndex( + name: "IX_InspektionObjekte_OverrideAuftraggeberId", + table: "InspektionObjekte", + column: "OverrideAuftraggeberId"); + + migrationBuilder.CreateIndex( + name: "IX_InspektionObjekte_ProjektId", + table: "InspektionObjekte", + column: "ProjektId"); + + migrationBuilder.CreateIndex( + name: "IX_Projekte_AuftraggeberId", + table: "Projekte", + column: "AuftraggeberId"); + + migrationBuilder.CreateIndex( + name: "IX_Sanierung_InspektionsobjektId", + table: "Sanierung", + column: "InspektionsobjektId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "Sanierung"); + + migrationBuilder.DropTable( + name: "InspektionObjekte"); + + migrationBuilder.DropTable( + name: "Projekte"); + + migrationBuilder.DropTable( + name: "Auftraggebers"); + } + } +} diff --git a/SanSystem/Migrations/SanVerwalterContextModelSnapshot.cs b/SanSystem/Migrations/SanVerwalterContextModelSnapshot.cs new file mode 100644 index 0000000..ab05f7b --- /dev/null +++ b/SanSystem/Migrations/SanVerwalterContextModelSnapshot.cs @@ -0,0 +1,224 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using SanSystem; + +#nullable disable + +namespace SanSystem.Migrations +{ + [DbContext(typeof(SanVerwalterContext))] + partial class SanVerwalterContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "6.0.0"); + + modelBuilder.Entity("KlassenBIB.Auftraggeber", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Ansprechpartner") + .HasColumnType("TEXT"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("Ort") + .HasColumnType("TEXT"); + + b.Property("Strasse") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Auftraggebers"); + }); + + modelBuilder.Entity("KlassenBIB.Inspektionsobjekt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("Bemerkung") + .HasColumnType("TEXT"); + + b.Property("BisPunkt") + .HasColumnType("TEXT"); + + b.Property("GeschlossenesEnde") + .HasColumnType("INTEGER"); + + b.Property("Guid") + .HasColumnType("TEXT"); + + b.Property("HaltungGemessen") + .HasColumnType("TEXT"); + + b.Property("Haltungslaenge") + .HasColumnType("REAL"); + + b.Property("Hausnummer") + .HasColumnType("TEXT"); + + b.Property("Inspektionsrichtung") + .HasColumnType("TEXT"); + + b.Property("Kanalrohrweite") + .HasColumnType("INTEGER"); + + b.Property("Objektbezeichnung") + .HasColumnType("TEXT"); + + b.Property("OrtName") + .HasColumnType("TEXT"); + + b.Property("OverrideAuftraggeberId") + .HasColumnType("INTEGER"); + + b.Property("ProjektId") + .HasColumnType("INTEGER"); + + b.Property("Projektnummer") + .HasColumnType("TEXT"); + + b.Property("RohrMaterial") + .HasColumnType("TEXT"); + + b.Property("Sanierungsnummer") + .HasColumnType("TEXT"); + + b.Property("Schachtlaenge") + .HasColumnType("REAL"); + + b.Property("StrasseName") + .HasColumnType("TEXT"); + + b.Property("VonPunkt") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("OverrideAuftraggeberId"); + + b.HasIndex("ProjektId"); + + b.ToTable("InspektionObjekte"); + }); + + modelBuilder.Entity("KlassenBIB.Projekt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("AuftraggeberId") + .HasColumnType("INTEGER"); + + b.Property("Nummer") + .HasColumnType("TEXT"); + + b.Property("Ort") + .HasColumnType("TEXT"); + + b.Property("SanierungsIDPrefix") + .HasColumnType("TEXT"); + + b.Property("SanierungsIDSuffix") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("AuftraggeberId"); + + b.ToTable("Projekte"); + }); + + modelBuilder.Entity("KlassenBIB.Sanierung", b => + { + b.Property("GenehmigungVorhanden") + .HasColumnType("INTEGER"); + + b.Property("Guid") + .HasColumnType("TEXT"); + + b.Property("HDReinigung") + .HasColumnType("INTEGER"); + + b.Property("HDReinigungDatum") + .HasColumnType("TEXT"); + + b.Property("InspektionsobjektId") + .HasColumnType("INTEGER"); + + b.Property("STVOAbsicherung") + .HasColumnType("INTEGER"); + + b.Property("TempAusen") + .HasColumnType("REAL"); + + b.Property("TempKanal") + .HasColumnType("REAL"); + + b.Property("VorbereitetMechanisch") + .HasColumnType("INTEGER"); + + b.Property("VorbereitetRoboter") + .HasColumnType("INTEGER"); + + b.Property("WasserhaltungEingerichtet") + .HasColumnType("INTEGER"); + + b.Property("Wetter") + .HasColumnType("TEXT"); + + b.HasIndex("InspektionsobjektId"); + + b.ToTable("Sanierung"); + }); + + modelBuilder.Entity("KlassenBIB.Inspektionsobjekt", b => + { + b.HasOne("KlassenBIB.Auftraggeber", "OverrideAuftraggeber") + .WithMany() + .HasForeignKey("OverrideAuftraggeberId"); + + b.HasOne("KlassenBIB.Projekt", null) + .WithMany("Objekte") + .HasForeignKey("ProjektId"); + + b.Navigation("OverrideAuftraggeber"); + }); + + modelBuilder.Entity("KlassenBIB.Projekt", b => + { + b.HasOne("KlassenBIB.Auftraggeber", "Auftraggeber") + .WithMany() + .HasForeignKey("AuftraggeberId"); + + b.Navigation("Auftraggeber"); + }); + + modelBuilder.Entity("KlassenBIB.Sanierung", b => + { + b.HasOne("KlassenBIB.Inspektionsobjekt", "Inspektionsobjekt") + .WithMany() + .HasForeignKey("InspektionsobjektId"); + + b.Navigation("Inspektionsobjekt"); + }); + + modelBuilder.Entity("KlassenBIB.Projekt", b => + { + b.Navigation("Objekte"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/SanSystem/Program.cs b/SanSystem/Program.cs index a6fe33a..5cf0819 100644 --- a/SanSystem/Program.cs +++ b/SanSystem/Program.cs @@ -18,6 +18,7 @@ namespace SanSystem [STAThread] static void Main() { + new Mutex(initiallyOwned: true, "SanVerwaltung", out bool result); if(!result) { diff --git a/SanSystem/SanSystem.csproj b/SanSystem/SanSystem.csproj index b690094..c94cb85 100644 --- a/SanSystem/SanSystem.csproj +++ b/SanSystem/SanSystem.csproj @@ -18,13 +18,30 @@ - + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + PreserveNewest + + + Never + + + Never + + + diff --git a/SanSystem/SanVerwalterContext.cs b/SanSystem/SanVerwalterContext.cs new file mode 100644 index 0000000..d7f1f83 --- /dev/null +++ b/SanSystem/SanVerwalterContext.cs @@ -0,0 +1,32 @@ +using KlassenBIB; +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SanSystem +{ + public class SanVerwalterContext : DbContext + { + public DbSet Projekte { get; set; } + public DbSet InspektionObjekte { get; set; } + public DbSet Sanierung { get; set; } + public DbSet Auftraggebers { get; set; } + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + optionsBuilder.UseSqlite("Data Source=SanVerwaltung.db"); + base.OnConfiguring(optionsBuilder); + + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity().HasNoKey(); + base.OnModelCreating(modelBuilder); + + } + } +} diff --git a/SanSystem/SanVerwaltung.db b/SanSystem/SanVerwaltung.db new file mode 100644 index 0000000000000000000000000000000000000000..f544ca9fc0c4b41602859f96823645bcb684916c GIT binary patch literal 49152 zcmeI4OHbog6vyKP2#;atri!{ic&th@(TpIOX$N)J047+FN0ST#i&5kxm*A4vj34b# zsf*00Rn=8LM7Ldb-4D=RrEa?F$LO*r#!h@=8;0d1e~T!#@44rm^E(gc21NaU0&rlWV8if&!9 z3tKaE%V>Q~XG&)@cyG5R7aFptl=tKlQMzrOBv#6zG@31mkE96gQub;&ohhsfg9pAf zRnr)*%$fz~%r@0-m$jIwbo|>ZAv64ui3!&R_=Cgsd4*DTaDOSCQMQCZ-d}rcVa0Wy zHNE*tCp5GiG9)B2o_%dhNMLByXazFp^Tl+gO$M=egDT%J)6_bQcP6BH={>BAR&|4^ zF%z;se3DLQHa3Kx1zT05$r6w!IvUn(;#lu`qIG)|Al}^Fr zrNSK>3U*Ow=fBSA-VLa>BW>Ai+JStc}#{y*>fXq09l)b9S&a^iX zih@FQ=PXiaA~3#J+y^m>yBeCrM`prcK0LueD-fgV+(PE@W8u_|koCGp72dSiYlrD= zHgP%6#cN{lkxtF<3C+yDolB)N4<8Eeimpy>VeVp%)5m?L99npXM+2u;5^v9h=*I1} z^@tG0WC%ShO?uv6s-~@TJ)M$&a3Z8L+uOq1ii@Gyl=n+o*Hqmt!GUJkhItivGs$C# zlo{h0=^W+*_n~j{`5B`q0Ly>8QTBD5wtdV@i}o)QYRNSvxsZ9aEhOBJ)?OZ{j%~Qt z&B%3{`N-QT+HfrnH(jgr64w4n&<_p}009sH0T2KI5C8!X009sH0T2Lz501d6LQ2j& z%{_gV%jZAK=kmGSbNV(^v+29$U6awb&d)b-l0T2KI5C8!X009sH0T2KI5SV@f z!~g$}|Nl4rafXK=00JNY0w4eaAOHd&00JNY0<%p3`~TUFKfDJ45C8!X009sH0T2KI z5C8!Xm< ortteile = Datenbank.Instance.loadedProjekt.Objekte.Select(x => x.OrtName).Distinct().ToList(); int aktuellOpened = -1; bool aktuelleStrasse = false; @@ -109,7 +110,8 @@ namespace SanSystem } private void buildUnsortedStreetList() - { + { + List strassen = Datenbank.Instance.loadedProjekt.Objekte.Select(x => x.StrasseName).Distinct().ToList(); List streets = new List(); @@ -129,6 +131,9 @@ namespace SanSystem private void frmStrassenList_Load(object sender, EventArgs e) { + + + this.Height = this.MdiParent.Height - 120; if(streetListSetting.SortedSelected()) { From cfbbcdfae1f0ae23b03543f4339235c6ec679c6f Mon Sep 17 00:00:00 2001 From: Damian Wessels Date: Sun, 15 Jan 2023 12:17:16 +0100 Subject: [PATCH 8/8] Database removing --- SanSystem/Database/Datenbank.cs | 4 ++-- SanSystem/frmMain.cs | 3 ++- SanSystem/frmProjektList.cs | 17 ++++------------- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/SanSystem/Database/Datenbank.cs b/SanSystem/Database/Datenbank.cs index 858fd1a..9efbde9 100644 --- a/SanSystem/Database/Datenbank.cs +++ b/SanSystem/Database/Datenbank.cs @@ -62,7 +62,7 @@ namespace Database this.projekt = projekt; loadedProjekt = Datenbank.Instance.TeufelDB.Projekte.Find(x => x.Nummer != null && x.Nummer.Equals(projekt)); - string filepath = Path.Combine(pfad, "projekte", "TeufelDB.xaml"); + /*string filepath = Path.Combine(pfad, "projekte", "TeufelDB.xaml"); if (!File.Exists(filepath)) { if (!Directory.Exists("./projekte")) return true; @@ -76,7 +76,7 @@ namespace Database } //UpdateDatabase.CreateSQLiteDB(); - + */ return true; } diff --git a/SanSystem/frmMain.cs b/SanSystem/frmMain.cs index a09f7fd..7c106c6 100644 --- a/SanSystem/frmMain.cs +++ b/SanSystem/frmMain.cs @@ -154,8 +154,9 @@ namespace SanSystem private void FrmProjektList_FormClosed(object sender, FormClosedEventArgs e) { - if(Datenbank.Instance.loadedProjekt.Auftraggeber.Name == null) + /*if(Datenbank.Instance.loadedProjekt.Auftraggeber.Name == null) showauftraggeberform(); + */ toolStripStatus_projekt_Label.Text = Global.Instance.ProjektNummer; Form[] openedWindows = this.MdiChildren; diff --git a/SanSystem/frmProjektList.cs b/SanSystem/frmProjektList.cs index c455f2d..64d8fa0 100644 --- a/SanSystem/frmProjektList.cs +++ b/SanSystem/frmProjektList.cs @@ -29,22 +29,13 @@ namespace SanSystem private void frmProjektList_Load(object sender, EventArgs e) { - - foreach(Projekt projekt in Datenbank.Instance.TeufelDB.Projekte) + using(var context = new SanVerwalterContext()) { - if (projekt.Nummer == null) + List list = context.Projekte.ToList(); + foreach(Projekt projekt in list) { - Datenbank.Instance.TeufelDB.Projekte.Remove(projekt); - if(Debugger.IsAttached) - { - Debugger.Break(); - } - else - { - continue; - } + lb_projekte.Items.Add(projekt.Nummer); } - lb_projekte.Items.Add(projekt.Nummer); } }