diff --git a/DaSaSo.ViewModel/Controls/SewerPreperationControllViewModel.cs b/DaSaSo.ViewModel/Controls/SewerPreperationControllViewModel.cs index 0a52177..e365944 100644 --- a/DaSaSo.ViewModel/Controls/SewerPreperationControllViewModel.cs +++ b/DaSaSo.ViewModel/Controls/SewerPreperationControllViewModel.cs @@ -13,6 +13,9 @@ namespace DaSaSo.ViewModel.Controls public bool Mechanisch { get; set; } public bool Roboter { get; set; } public bool Faekalienfrei { get; set; } + public bool Genehmigung { get; set; } + public bool WaterBaried { get; set; } + public bool STVO { get; set; } public SewerPreperationControllViewModel(EPreparationType preparationType) { @@ -20,6 +23,9 @@ namespace DaSaSo.ViewModel.Controls Mechanisch = preparationType.HasFlag(EPreparationType.CleanedMechanisch); Roboter = preparationType.HasFlag(EPreparationType.CleanedRoboter); Faekalienfrei = preparationType.HasFlag(EPreparationType.FaekalienFrei); + Genehmigung = preparationType.HasFlag(EPreparationType.PermitNeeded); + WaterBaried = preparationType.HasFlag(EPreparationType.WaterBaried); + STVO = preparationType.HasFlag(EPreparationType.STVO); } public EPreparationType CalculatePreparationFlags() @@ -29,6 +35,9 @@ namespace DaSaSo.ViewModel.Controls if (Mechanisch) result |= EPreparationType.CleanedMechanisch; if (Roboter) result |= EPreparationType.CleanedRoboter; if (Faekalienfrei) result |= EPreparationType.FaekalienFrei; + if (Genehmigung) result |= EPreparationType.PermitNeeded; + if (WaterBaried) result |= EPreparationType.WaterBaried; + if (STVO) result |= EPreparationType.STVO; return result; } diff --git a/DaSaSo.ViewModel/SewerPipeLinerViewModel.cs b/DaSaSo.ViewModel/SewerPipeLinerViewModel.cs index 78afb00..2b5892b 100644 --- a/DaSaSo.ViewModel/SewerPipeLinerViewModel.cs +++ b/DaSaSo.ViewModel/SewerPipeLinerViewModel.cs @@ -1,4 +1,7 @@ -using System; +using DaSaSo.Domain.Model; +using DaSaSo.ViewModel.Controls; +using DaSaSo.ViewModel.Interface; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -8,5 +11,90 @@ namespace DaSaSo.ViewModel { public class SewerPipeLinerViewModel : BaseViewModel { + private SewerPreperationControllViewModel _sewerPreperationControllViewModel; + private PipeLiner _model; + + public PipeLiner Model + { + get => _model; + set => _model = value; + } + + public string Operator + { + get => Model.Operator; + set + { + if(Model.Operator != value) + { + Model.Operator = value; + OnPropertyChanged(); + } + } + } + public bool ClosedEnd + { + get => Model.ClosedEnd; + set + { + if(Model.ClosedEnd != value) + { + Model.ClosedEnd = value; + OnPropertyChanged(); + } + } + } + public bool Preliner + { + get => Model.Preliner; + set + { + if(Model.Preliner != value) + { + Model.Preliner = value; + OnPropertyChanged(); + } + } + } + public decimal EinbauTemperatur + { + get => Model.TemperaturAssembly; + set + { + if(Model.TemperaturAssembly != value) + { + Model.TemperaturAssembly = value; + OnPropertyChanged(); + } + } + } + public decimal LagerungTemperatur + { + get => Model.TemperaturStorage; + set + { + if (Model.TemperaturStorage != value) + { + Model.TemperaturStorage = value; + OnPropertyChanged(); + } + } + } + public SewerPreperationControllViewModel SewerPreperationControllViewModel + { + get => _sewerPreperationControllViewModel; + set => _sewerPreperationControllViewModel = value; + } + + public SewerPipeLinerViewModel(IActualProject actualProject) + { + SewerPreperationControllViewModel = new SewerPreperationControllViewModel(EPreparationType.WaterBaried); + if(actualProject.AktuellSewerObject.PipeLiner == null) + { + actualProject.AktuellSewerObject.PipeLiner = new PipeLiner(); + } + Model = actualProject.AktuellSewerObject.PipeLiner; + + } } } diff --git a/DaSaSo.Wpf/HostBuilders/AddDbContextHostBuilderExtensions.cs b/DaSaSo.Wpf/HostBuilders/AddDbContextHostBuilderExtensions.cs index 8c66fcc..984a9b2 100644 --- a/DaSaSo.Wpf/HostBuilders/AddDbContextHostBuilderExtensions.cs +++ b/DaSaSo.Wpf/HostBuilders/AddDbContextHostBuilderExtensions.cs @@ -5,6 +5,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -20,6 +21,7 @@ namespace DaSaSo.Wpf.HostBuilders string connectionString = ""; Action configureDbContext = null; string databaseToUse = context.Configuration.GetConnectionString("databaseToUse"); + Trace.WriteLine(databaseToUse); if(databaseToUse.Equals("default")) { connectionString = context.Configuration.GetConnectionString("default"); diff --git a/DaSaSo.Wpf/HostBuilders/AddViewModelsHostBuilderExtensions.cs b/DaSaSo.Wpf/HostBuilders/AddViewModelsHostBuilderExtensions.cs index 68e1337..3be7716 100644 --- a/DaSaSo.Wpf/HostBuilders/AddViewModelsHostBuilderExtensions.cs +++ b/DaSaSo.Wpf/HostBuilders/AddViewModelsHostBuilderExtensions.cs @@ -90,7 +90,9 @@ namespace DaSaSo.Wpf.HostBuilders }); services.AddTransient>(services => { - return () => new SewerPipeLinerViewModel(); + return () => new SewerPipeLinerViewModel( + services.GetRequiredService() + ); }); services.AddTransient>(services => diff --git a/DaSaSo.Wpf/View/SewerObject/Controls/SewerDamagePreparation.xaml b/DaSaSo.Wpf/View/SewerObject/Controls/SewerDamagePreparation.xaml index c7d8438..e165452 100644 --- a/DaSaSo.Wpf/View/SewerObject/Controls/SewerDamagePreparation.xaml +++ b/DaSaSo.Wpf/View/SewerObject/Controls/SewerDamagePreparation.xaml @@ -20,9 +20,9 @@ - - - + + + diff --git a/DaSaSo.Wpf/View/SewerObject/Controls/SewerRehabilation.xaml b/DaSaSo.Wpf/View/SewerObject/Controls/SewerRehabilation.xaml index eafd879..61b216b 100644 --- a/DaSaSo.Wpf/View/SewerObject/Controls/SewerRehabilation.xaml +++ b/DaSaSo.Wpf/View/SewerObject/Controls/SewerRehabilation.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:local="clr-namespace:DaSaSo.Wpf.View.SewerObject.Controls" + xmlns:local="clr-namespace:DaSaSo.Wpf.View.SewerObject.Controls" xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:SewerPipeLinerViewModel}" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> @@ -31,7 +31,7 @@