diff --git a/ConsoleApplication/Program.cs b/ConsoleApplication/Program.cs index daee2c9..f6a8ed4 100644 --- a/ConsoleApplication/Program.cs +++ b/ConsoleApplication/Program.cs @@ -23,6 +23,7 @@ namespace ConsoleApplication var manager = kernel.Get(); var baustellen = kernel.Get(); + /* Auftraggeber auftraggeber = new Auftraggeber(); auftraggeber.Baustellen = new List(); auftraggeber.Baustellen.Add(new Bauvorhaben() @@ -37,7 +38,7 @@ namespace ConsoleApplication auftraggeber.Strasse = "Schlachthofstraße 42"; manager.Add(auftraggeber); - + */ var auftragger = manager.GetAllAuftraggeber(); var bau = baustellen.GetAllBauvorhaben(); diff --git a/DichtheitManagement.Contract/IAuftraggeberManager.cs b/DichtheitManagement.Contract/IAuftraggeberManager.cs index cd265c2..074147e 100644 --- a/DichtheitManagement.Contract/IAuftraggeberManager.cs +++ b/DichtheitManagement.Contract/IAuftraggeberManager.cs @@ -8,5 +8,6 @@ namespace DichtheitManagement.Contract { IQueryable GetAllAuftraggeber(); void Add(Auftraggeber auftraggeber); + void Update(Auftraggeber update); } } diff --git a/DichtheitManagement.Contract/IBaustelleManager.cs b/DichtheitManagement.Contract/IBaustelleManager.cs index 179e411..b77865b 100644 --- a/DichtheitManagement.Contract/IBaustelleManager.cs +++ b/DichtheitManagement.Contract/IBaustelleManager.cs @@ -10,5 +10,8 @@ namespace DichtheitManagement.Contract { IQueryable GetAllBauvorhaben(); void Add(Bauvorhaben bauvorhaben); + Bauvorhaben GetBauvorhaben(int id); + List GetBauvorhaben(Auftraggeber auftraggeber); + void Update(Bauvorhaben bauvorhaben); } } diff --git a/DichtheitManagement/AuftraggeberManager.cs b/DichtheitManagement/AuftraggeberManager.cs index a67ee11..380df4e 100644 --- a/DichtheitManagement/AuftraggeberManager.cs +++ b/DichtheitManagement/AuftraggeberManager.cs @@ -19,7 +19,12 @@ namespace DichtheitManagement public IQueryable GetAllAuftraggeber() { - return _repository.Query.Where(p => p.Id >= 0); + return _repository.Get(includeProperties: "Baustellen,Baustellen.Prüfobjekte").Where(p => p.Id >= 0); + } + + public void Update(Auftraggeber update) + { + _repository.Update(update); } } } diff --git a/DichtheitManagement/BaustelleManager.cs b/DichtheitManagement/BaustelleManager.cs index 87ad2b3..2efe8be 100644 --- a/DichtheitManagement/BaustelleManager.cs +++ b/DichtheitManagement/BaustelleManager.cs @@ -24,7 +24,22 @@ namespace DichtheitManagement public IQueryable GetAllBauvorhaben() { - return _repository.Get(includeProperties: "Auftraggeber"); + return _repository.Get(includeProperties: "Auftraggeber,Prüfobjekte"); + } + + public Bauvorhaben GetBauvorhaben(int id) + { + return _repository.Get().Where(s => s.Id == id).FirstOrDefault(); + } + + public List GetBauvorhaben(Auftraggeber auftraggeber) + { + return _repository.Get().Where(s => s.Auftraggeber == auftraggeber).ToList(); + } + + public void Update(Bauvorhaben bauvorhaben) + { + _repository.Update(bauvorhaben); } } } diff --git a/Dichtheitsprüfung.sln b/Dichtheitsprüfung.sln index f10a8fd..85850bb 100644 --- a/Dichtheitsprüfung.sln +++ b/Dichtheitsprüfung.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.31019.35 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.31911.260 MinimumVisualStudioVersion = 15.0.26124.0 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DPGetDataContract", "DPGetDataContract\DPGetDataContract.csproj", "{FEAFDFF0-4E0F-4C3F-AA04-3DB55FE40EEF}" EndProject @@ -29,11 +29,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DichtheitManagement.Contrac EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mappings", "Mappings\Mappings.csproj", "{CB3C8585-E6B2-42AC-BED6-9924E7CDC355}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GuiWPF_ViewModel", "GuiWPF_ViewModel\GuiWPF_ViewModel.csproj", "{AEE0E978-875E-4BF4-B5D5-CF8D85E227CE}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DichtheitsprüfungTerminal", "DichtheitsprüfungTerminal\DichtheitsprüfungTerminal.csproj", "{DA1AF5F2-BBF9-4F0E-ACD2-8E10264CFB9C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataGenTests", "DataGenTests\DataGenTests.csproj", "{88B9FEA8-6E47-4987-A8FA-2E68628690E1}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataGenTests", "DataGenTests\DataGenTests.csproj", "{88B9FEA8-6E47-4987-A8FA-2E68628690E1}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{29CAE66D-C5A2-4963-A78A-CEB5E5033224}" ProjectSection(SolutionItems) = preProject @@ -206,18 +204,6 @@ Global {CB3C8585-E6B2-42AC-BED6-9924E7CDC355}.Release|x64.Build.0 = Release|Any CPU {CB3C8585-E6B2-42AC-BED6-9924E7CDC355}.Release|x86.ActiveCfg = Release|Any CPU {CB3C8585-E6B2-42AC-BED6-9924E7CDC355}.Release|x86.Build.0 = Release|Any CPU - {AEE0E978-875E-4BF4-B5D5-CF8D85E227CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AEE0E978-875E-4BF4-B5D5-CF8D85E227CE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AEE0E978-875E-4BF4-B5D5-CF8D85E227CE}.Debug|x64.ActiveCfg = Debug|Any CPU - {AEE0E978-875E-4BF4-B5D5-CF8D85E227CE}.Debug|x64.Build.0 = Debug|Any CPU - {AEE0E978-875E-4BF4-B5D5-CF8D85E227CE}.Debug|x86.ActiveCfg = Debug|Any CPU - {AEE0E978-875E-4BF4-B5D5-CF8D85E227CE}.Debug|x86.Build.0 = Debug|Any CPU - {AEE0E978-875E-4BF4-B5D5-CF8D85E227CE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AEE0E978-875E-4BF4-B5D5-CF8D85E227CE}.Release|Any CPU.Build.0 = Release|Any CPU - {AEE0E978-875E-4BF4-B5D5-CF8D85E227CE}.Release|x64.ActiveCfg = Release|Any CPU - {AEE0E978-875E-4BF4-B5D5-CF8D85E227CE}.Release|x64.Build.0 = Release|Any CPU - {AEE0E978-875E-4BF4-B5D5-CF8D85E227CE}.Release|x86.ActiveCfg = Release|Any CPU - {AEE0E978-875E-4BF4-B5D5-CF8D85E227CE}.Release|x86.Build.0 = Release|Any CPU {DA1AF5F2-BBF9-4F0E-ACD2-8E10264CFB9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {DA1AF5F2-BBF9-4F0E-ACD2-8E10264CFB9C}.Debug|Any CPU.Build.0 = Debug|Any CPU {DA1AF5F2-BBF9-4F0E-ACD2-8E10264CFB9C}.Debug|x64.ActiveCfg = Debug|Any CPU diff --git a/GuiWPF/App.xaml.cs b/GuiWPF/App.xaml.cs index deec891..c64dd10 100644 --- a/GuiWPF/App.xaml.cs +++ b/GuiWPF/App.xaml.cs @@ -1,4 +1,8 @@ -using System; +using DichtheitManagement.Contract; +using GuiWPF.ViewModel; +using Mappings; +using Ninject; +using System; using System.Collections.Generic; using System.Configuration; using System.Data; @@ -16,8 +20,16 @@ namespace GuiWPF protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); + + + +#if !DEBUG + MessageBox.Show("Kein gültiger Lizenz gefunden!"); + Environment.Exit(0); +#else var window = new MainWindow() { DataContext = new MainWindowViewModel() }; window.Show(); +#endif } } } diff --git a/GuiWPF/GuiWPF.csproj b/GuiWPF/GuiWPF.csproj index 3356d60..dbc4fb7 100644 --- a/GuiWPF/GuiWPF.csproj +++ b/GuiWPF/GuiWPF.csproj @@ -7,7 +7,11 @@ - + + + + + diff --git a/GuiWPF/GuiWPF.csproj.user b/GuiWPF/GuiWPF.csproj.user index b5309f2..553729d 100644 --- a/GuiWPF/GuiWPF.csproj.user +++ b/GuiWPF/GuiWPF.csproj.user @@ -1,5 +1,32 @@  - + + + Code + + + Code + + + Code + + + Code + + + + + Designer + + + Designer + + + Designer + + + Designer + + \ No newline at end of file diff --git a/GuiWPF/MainWindow.xaml b/GuiWPF/MainWindow.xaml index 2a51dff..5154359 100644 --- a/GuiWPF/MainWindow.xaml +++ b/GuiWPF/MainWindow.xaml @@ -4,21 +4,38 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:GuiWPF" + xmlns:viewmodel="clr-namespace:GuiWPF.ViewModel" + xmlns:views="clr-namespace:GuiWPF.Views" mc:Ignorable="d" - Title="MainWindow" Height="450" Width="800"> + Title="MainWindow" Height="420" Width="1041"> - - + + - - + + + + + + + + + + + -