Genehmigungen hinzugefügt

This commit is contained in:
HuskyTeufel
2021-10-11 07:34:20 +02:00
parent 3388891134
commit b48007095e
7 changed files with 136 additions and 36 deletions

View File

@@ -13,6 +13,9 @@ namespace DaSaSo.ViewModel.Controls
public bool Mechanisch { get; set; } public bool Mechanisch { get; set; }
public bool Roboter { get; set; } public bool Roboter { get; set; }
public bool Faekalienfrei { 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) public SewerPreperationControllViewModel(EPreparationType preparationType)
{ {
@@ -20,6 +23,9 @@ namespace DaSaSo.ViewModel.Controls
Mechanisch = preparationType.HasFlag(EPreparationType.CleanedMechanisch); Mechanisch = preparationType.HasFlag(EPreparationType.CleanedMechanisch);
Roboter = preparationType.HasFlag(EPreparationType.CleanedRoboter); Roboter = preparationType.HasFlag(EPreparationType.CleanedRoboter);
Faekalienfrei = preparationType.HasFlag(EPreparationType.FaekalienFrei); Faekalienfrei = preparationType.HasFlag(EPreparationType.FaekalienFrei);
Genehmigung = preparationType.HasFlag(EPreparationType.PermitNeeded);
WaterBaried = preparationType.HasFlag(EPreparationType.WaterBaried);
STVO = preparationType.HasFlag(EPreparationType.STVO);
} }
public EPreparationType CalculatePreparationFlags() public EPreparationType CalculatePreparationFlags()
@@ -29,6 +35,9 @@ namespace DaSaSo.ViewModel.Controls
if (Mechanisch) result |= EPreparationType.CleanedMechanisch; if (Mechanisch) result |= EPreparationType.CleanedMechanisch;
if (Roboter) result |= EPreparationType.CleanedRoboter; if (Roboter) result |= EPreparationType.CleanedRoboter;
if (Faekalienfrei) result |= EPreparationType.FaekalienFrei; if (Faekalienfrei) result |= EPreparationType.FaekalienFrei;
if (Genehmigung) result |= EPreparationType.PermitNeeded;
if (WaterBaried) result |= EPreparationType.WaterBaried;
if (STVO) result |= EPreparationType.STVO;
return result; return result;
} }

View File

@@ -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.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@@ -8,5 +11,90 @@ namespace DaSaSo.ViewModel
{ {
public class SewerPipeLinerViewModel : BaseViewModel 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;
}
} }
} }

View File

@@ -5,6 +5,7 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
@@ -20,6 +21,7 @@ namespace DaSaSo.Wpf.HostBuilders
string connectionString = ""; string connectionString = "";
Action<DbContextOptionsBuilder> configureDbContext = null; Action<DbContextOptionsBuilder> configureDbContext = null;
string databaseToUse = context.Configuration.GetConnectionString("databaseToUse"); string databaseToUse = context.Configuration.GetConnectionString("databaseToUse");
Trace.WriteLine(databaseToUse);
if(databaseToUse.Equals("default")) if(databaseToUse.Equals("default"))
{ {
connectionString = context.Configuration.GetConnectionString("default"); connectionString = context.Configuration.GetConnectionString("default");

View File

@@ -90,7 +90,9 @@ namespace DaSaSo.Wpf.HostBuilders
}); });
services.AddTransient<CreateViewModel<SewerPipeLinerViewModel>>(services => services.AddTransient<CreateViewModel<SewerPipeLinerViewModel>>(services =>
{ {
return () => new SewerPipeLinerViewModel(); return () => new SewerPipeLinerViewModel(
services.GetRequiredService<IActualProject>()
);
}); });
services.AddTransient<CreateViewModel<ClientListViewModel>>(services => services.AddTransient<CreateViewModel<ClientListViewModel>>(services =>

View File

@@ -20,9 +20,9 @@
<CheckBox Margin="5" Content="Mechanisch Gereinigt" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Mechanisch}" /> <CheckBox Margin="5" Content="Mechanisch Gereinigt" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Mechanisch}" />
<CheckBox Margin="5" Content="Mit Roborter Gereinigt" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Roboter}" /> <CheckBox Margin="5" Content="Mit Roborter Gereinigt" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Roboter}" />
<CheckBox Margin="5" Content="Schadstelle Fäkalienfrei" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Faekalienfrei}" /> <CheckBox Margin="5" Content="Schadstelle Fäkalienfrei" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Faekalienfrei}" />
<CheckBox Margin="5" Content="Genehmigung wurde eingeholt" Style="{StaticResource checkBoxCircleSmall}" /> <CheckBox Margin="5" Content="Genehmigung wurde eingeholt" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Genehmigung}" />
<CheckBox Margin="5" Content="Wasserhaltung wurde eingerichtet" Style="{StaticResource checkBoxCircleSmall}" /> <CheckBox Margin="5" Content="Wasserhaltung wurde eingerichtet" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding WaterBaried}" />
<CheckBox Margin="5" Content="Es wurde nach StVO abgesichert" Style="{StaticResource checkBoxCircleSmall}" /> <CheckBox Margin="5" Content="Es wurde nach StVO abgesichert" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding STVO}" />
</StackPanel> </StackPanel>
</Border> </Border>
</Grid> </Grid>

View File

@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 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" mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800"> d:DesignHeight="450" d:DesignWidth="800">
<Grid> <Grid>
@@ -31,7 +31,7 @@
<Label Margin="20" Grid.Column="0" Grid.Row="2" Content="Temperatur Aussen" /> <Label Margin="20" Grid.Column="0" Grid.Row="2" Content="Temperatur Aussen" />
<Label Margin="20" Grid.Column="0" Grid.Row="3" Content="Temperatur Kanal" /> <Label Margin="20" Grid.Column="0" Grid.Row="3" Content="Temperatur Kanal" />
<TextBox Grid.Column="1" Grid.Row="0" Margin="20" /> <TextBox Grid.Column="1" Grid.Row="0" Margin="20" Text="{Binding Operator}" />
<!--<TextBox Grid.Column="1" Grid.Row="1" Margin="20" />--> <!--<TextBox Grid.Column="1" Grid.Row="1" Margin="20" />-->
<DatePicker Grid.Column="1" Grid.Row="1" Margin="20" /> <DatePicker Grid.Column="1" Grid.Row="1" Margin="20" />
<TextBox Grid.Column="1" Grid.Row="2" Margin="20" /> <TextBox Grid.Column="1" Grid.Row="2" Margin="20" />

View File

@@ -4,16 +4,15 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DaSaSo.Wpf.View.SewerObject" xmlns:local="clr-namespace:DaSaSo.Wpf.View.SewerObject"
xmlns:controls="clr-namespace:DaSaSo.Wpf.View.SewerObject.Controls" xmlns:controls="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" mc:Ignorable="d" d:DesignWidth="800" Height="722">
d:DesignHeight="450" d:DesignWidth="800">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="auto" /> <RowDefinition Height="auto" />
<RowDefinition Height="auto" /> <RowDefinition Height="auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Border Grid.Row="0"> <Border Grid.Row="0">
<controls:SewerRehabilation /> <controls:SewerRehabilation DataContext="{Binding SewerPreperationControllViewModel}" />
</Border> </Border>
<Border BorderBrush="Black" BorderThickness="2" Grid.Row="1"> <Border BorderBrush="Black" BorderThickness="2" Grid.Row="1">
<Grid Background="LightBlue"> <Grid Background="LightBlue">
@@ -37,11 +36,11 @@
<Label Margin="20" Grid.Column="0" Grid.Row="4" Content="Temperatur beim Einbau" /> <Label Margin="20" Grid.Column="0" Grid.Row="4" Content="Temperatur beim Einbau" />
<Label Margin="20" Grid.Column="0" Grid.Row="5" Content="Einbaudruck" /> <Label Margin="20" Grid.Column="0" Grid.Row="5" Content="Einbaudruck" />
<CheckBox Style="{StaticResource checkBoxCircleSmall}" Grid.Column="1" Grid.Row="0" Margin="20" Content="Ja" /> <CheckBox Style="{StaticResource checkBoxCircleSmall}" Grid.Column="1" Grid.Row="0" Margin="20" Content="Ja" IsChecked="{Binding ClosedEnd}" />
<CheckBox Style="{StaticResource checkBoxCircleSmall}" Grid.Column="1" Grid.Row="1" Margin="20" Content="Ja" /> <CheckBox Style="{StaticResource checkBoxCircleSmall}" Grid.Column="1" Grid.Row="1" Margin="20" Content="Ja" IsChecked="{Binding Preliner}" />
<TextBox BorderThickness="0" Grid.Column="1" Grid.Row="2" Margin="20" /> <TextBox BorderThickness="0" Grid.Column="1" Grid.Row="2" Margin="20" />
<TextBox BorderThickness="0" Grid.Column="1" Grid.Row="3" Margin="20" /> <TextBox BorderThickness="0" Grid.Column="1" Grid.Row="3" Margin="20" Text="{Binding LagerungTemperatur}" />
<TextBox BorderThickness="0" Grid.Column="1" Grid.Row="4" Margin="20" /> <TextBox BorderThickness="0" Grid.Column="1" Grid.Row="4" Margin="20" Text="{Binding EinbauTemperatur}" />
<TextBox BorderThickness="0" Grid.Column="1" Grid.Row="5" Margin="20" /> <TextBox BorderThickness="0" Grid.Column="1" Grid.Row="5" Margin="20" />
</Grid> </Grid>
</Border> </Border>