Kanalschaden werden richtig geparsed

This commit is contained in:
HuskyTeufel
2021-09-30 16:27:28 +02:00
parent 9da7090883
commit 98494be3cf
37 changed files with 576 additions and 136 deletions

View File

@@ -12,7 +12,7 @@
<RadioButton Content="Stammdaten" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentSewerViewModelCommand}" CommandParameter="{x:Static nav:ESewerWindowViewType.SewerStammdaten}" Margin="20" />
<RadioButton Content="Schäden" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentSewerViewModelCommand}" CommandParameter="{x:Static nav:ESewerWindowViewType.SewerDamageList}" Margin="20" />
<RadioButton Content="Schließen" Style="{StaticResource ToggleButtonList}" Command="{Binding CloseCommand}" Margin="20" />
<RadioButton Content="{Binding Schaden}" Style="{StaticResource ToggleButtonList}" />
<RadioButton Content="{Binding Schaden.Distance,FallbackValue='Damage'}" Command="{Binding UpdateCurrentSewerViewModelCommand}" CommandParameter="{x:Static nav:ESewerWindowViewType.SewerDamageEdit}" Style="{StaticResource ToggleButtonList}" />
</StackPanel>

View File

@@ -13,13 +13,14 @@ namespace DaSaSo.Wpf.Converters
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return (((int)value & (int)parameter) == (int)value);
bool result = (((int)value & (int)parameter) == (int)value);
return result;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
//EDamageType result = (EDamageType)parameter;
return null;
}
}
}

View File

@@ -37,6 +37,15 @@
<Compile Update="View\SewerObjecte\SewerObjecteListView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="View\SewerObject\Controls\SewerDamage.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="View\SewerObject\Controls\SewerDamagePreparation.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="View\SewerObject\SewerDamageEditView.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="View\SewerObject\SewerDamageListView.xaml.cs">
<SubType>Code</SubType>
</Compile>
@@ -84,6 +93,15 @@
<Page Update="View\SewerObjecte\SewerObjecteListView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="View\SewerObject\Controls\SewerDamage.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="View\SewerObject\Controls\SewerDamagePreparation.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="View\SewerObject\SewerDamageEditView.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="View\SewerObject\SewerDamageListView.xaml">
<SubType>Designer</SubType>
</Page>

View File

@@ -21,7 +21,7 @@ namespace DaSaSo.Wpf.HostBuilders
{
host.ConfigureServices(services =>
{
services.AddSingleton<IDataService<Client>, ClientDataService>();
services.AddTransient<IDataService<Client>, ClientDataService>();
services.AddSingleton<IDataService<Project>, ProjectDataService>();
services.AddTransient<IDataService<Buildingsite>, BuildingsiteDataService>();
services.AddSingleton<IDataService<SewerObject>, SewerObjectDataService>();

View File

@@ -79,7 +79,12 @@ namespace DaSaSo.Wpf.HostBuilders
services.GetRequiredService<IActualProject>(),
services.GetRequiredService<IDataService<SewerObject>>()//,
//services.GetRequiredService<SewerMainListViewModel>()
);
});
services.AddTransient<CreateViewModel<SewerDamageEditViewModel>>(services =>
{
return () => new SewerDamageEditViewModel(
services.GetRequiredService<IActualProject>()
);
});

View File

@@ -16,7 +16,7 @@ namespace DaSaSo.Wpf.Sampledata
Damages.Add(new SewerDamage()
{
DamageType = EDamageType.Bruch | EDamageType.EinrageneStutzen,
PreparationType = EPreparationType.CleanedHD | EPreparationType.CleanedRoborter,
PreparationType = EPreparationType.CleanedHD | EPreparationType.CleanedRoboter,
Distance = 12.5m
});

View File

@@ -17,11 +17,12 @@
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="Projektname" />
<Label Grid.Row="1" Grid.Column="0" Content="Projektnummer" />
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding ProjektName}" />
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding ProjektNummer}" />
<Label Grid.Row="0" Grid.Column="0" Content="Projektnummer" />
<Label Grid.Row="1" Grid.Column="0" Content="Projektname" />
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding ProjektNummer}" />
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding ProjektName}" />
</Grid>
<Button Content="Speichern" Command="{Binding SaveProjectCommand}" />

View File

@@ -0,0 +1,52 @@
<UserControl x:Class="DaSaSo.Wpf.View.SewerObject.Controls.SewerDamage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:damagetype="clr-namespace:DaSaSo.Domain.Model;assembly=DaSaSo.Domain"
xmlns:local="clr-namespace:DaSaSo.Wpf.View.SewerObject.Controls" xmlns:controls="clr-namespace:DaSaSo.ViewModel.Controls;assembly=DaSaSo.ViewModel" d:DataContext="{d:DesignInstance Type=controls:SewerDamageControllViewModel}"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid Background="LightBlue">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Border Grid.Row="0" Grid.ColumnSpan="3" BorderBrush="Black" BorderThickness="3">
<TextBlock TextAlignment="Center" Text="Schaden" />
</Border>
<Border Grid.Column="0" Grid.Row="1" BorderBrush="Black" BorderThickness="2,1">
<StackPanel>
<Label />
<Label Content="Rohrstatik schaden" />
<CheckBox Content="Riss" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Riss}" />
<CheckBox Content="Bruch" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Bruch}" />
<CheckBox Content="Scherbe" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Scherbe}" />
</StackPanel>
</Border>
<Border Grid.Column="1" Grid.Row="1" BorderBrush="Black" BorderThickness="1,2">
<StackPanel>
<Label Content="Rohr Betrieb Hinderniss" />
<CheckBox Content="Wurzeln" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Wurzel }"/>
<CheckBox Content="Inkrustation" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Inkrustation }" />
<CheckBox Content="Ablagerungen" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Ablagerungen}" />
</StackPanel>
</Border>
<Border Grid.Column="2" Grid.Row="1" BorderBrush="Black" BorderThickness="1,2">
<StackPanel>
<Label Content="Sonstiges" />
<CheckBox Content="Einragende Anschluss" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding EinrageneStutzen }" />
<CheckBox Content="Infiltration" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Infiltration }"/>
</StackPanel>
</Border>
</Grid>
</UserControl>

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace DaSaSo.Wpf.View.SewerObject.Controls
{
/// <summary>
/// Interaction logic for SewerDamage.xaml
/// </summary>
public partial class SewerDamage : UserControl
{
public SewerDamage()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,26 @@
<UserControl x:Class="DaSaSo.Wpf.View.SewerObject.Controls.SewerDamagePreparation"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:controls="clr-namespace:DaSaSo.ViewModel.Controls;assembly=DaSaSo.ViewModel" d:DataContext="{d:DesignInstance Type=controls:SewerPreperationControllViewModel}"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid Background="LightBlue">
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Border Grid.Row="0" BorderThickness="3" BorderBrush="Black">
<TextBlock Text="Vorbereitungen" TextAlignment="Center"/>
</Border>
<Border BorderBrush="Black" Grid.Row="1" BorderThickness="2">
<StackPanel>
<CheckBox Content="HD Gereinigt" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding HD}" />
<CheckBox Content="Mechanisch Gereinigt" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Mechanisch}" />
<CheckBox Content="Mit Roborter Gereinigt" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Roboter}" />
<CheckBox Content="Schadstelle Fäkalienfrei" Style="{StaticResource checkBoxCircleSmall}" IsChecked="{Binding Faekalienfrei}" />
</StackPanel>
</Border>
</Grid>
</UserControl>

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace DaSaSo.Wpf.View.SewerObject.Controls
{
/// <summary>
/// Interaction logic for SewerDamagePreparation.xaml
/// </summary>
public partial class SewerDamagePreparation : UserControl
{
public SewerDamagePreparation()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,24 @@
<UserControl x:Class="DaSaSo.Wpf.View.SewerObject.SewerDamageEditView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
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:selfControls="clr-namespace:DaSaSo.Wpf.View.SewerObject.Controls"
xmlns:local="clr-namespace:DaSaSo.Wpf.View.SewerObject" xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:SewerDamageEditViewModel}"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<selfControls:SewerDamage Grid.Column="0" Grid.Row="0" DataContext="{Binding damageControllViewModel}" />
<selfControls:SewerDamagePreparation Grid.Column="1" Grid.Row="0" DataContext="{Binding preperationControllViewModel}" />
<Button Grid.Column="0" Grid.Row="1" Content="Berechne" Command="{Binding Berechne}" />
</Grid>
</UserControl>

View File

@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace DaSaSo.Wpf.View.SewerObject
{
/// <summary>
/// Interaction logic for SewerDamageEditView.xaml
/// </summary>
public partial class SewerDamageEditView : UserControl
{
public SewerDamageEditView()
{
InitializeComponent();
}
}
}

View File

@@ -27,7 +27,7 @@
<DataGridCheckBoxColumn Header="HD Reinigung" Binding="{Binding PreparationType, Converter={StaticResource EqualPreperationTypeToBooleanConverter}, ConverterParameter={x:Static damagetype:EPreparationType.CleanedHD}}" />
<DataGridCheckBoxColumn Header="Mechanisch gereinigt" Binding="{Binding PreparationType, Converter={StaticResource EqualPreperationTypeToBooleanConverter}, ConverterParameter={x:Static damagetype:EPreparationType.CleanedMechanisch}}" />
<DataGridCheckBoxColumn Header="Roboter" Binding="{Binding PreparationType, Converter={StaticResource EqualPreperationTypeToBooleanConverter}, ConverterParameter={x:Static damagetype:EPreparationType.CleanedRoborter}}" />
<DataGridCheckBoxColumn Header="Roboter" Binding="{Binding PreparationType, Converter={StaticResource EqualPreperationTypeToBooleanConverter}, ConverterParameter={x:Static damagetype:EPreparationType.CleanedRoboter}}" />
<DataGridCheckBoxColumn Header="Fäkalienfrei" Binding="{Binding PreparationType, Converter={StaticResource EqualPreperationTypeToBooleanConverter}, ConverterParameter={x:Static damagetype:EPreparationType.FaekalienFrei}}" />
</DataGrid.Columns>
</DataGrid>

View File

@@ -15,6 +15,9 @@
<DataTemplate DataType="{x:Type viewmodel:SewerDamageListViewModel}">
<views:SewerDamageListView />
</DataTemplate>
<DataTemplate DataType="{x:Type viewmodel:SewerDamageEditViewModel}">
<views:SewerDamageEditView />
</DataTemplate>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
</UserControl.Resources>
<Grid>

View File

@@ -27,4 +27,39 @@
</Setter.Value>
</Setter>
</Style>
<Style x:Key="checkBoxCircleSmall" TargetType="{x:Type CheckBox}">
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="Margin" Value="0" />
<Setter Property="Content" Value="" />
<Setter Property="IsEnabled" Value="{Binding Change}" />
<Setter Property="FrameworkElement.FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type CheckBox}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="auto" />
</Grid.ColumnDefinitions>
<Ellipse Name="outerEllipse" Grid.Column="0" Width="30" Height="30" StrokeThickness="2" Stroke="#FFFFFFFF" />
<Ellipse Name="highlightCircle" Grid.Column="0" Width="20" Height="20" Fill="#FFFFFFFF" />
<ContentPresenter Name="content" Grid.Column="1" Content="{TemplateBinding Content}" Margin="5,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="ToggleButton.IsChecked" Value="True">
<Setter TargetName="highlightCircle" Property="Shape.Fill" Value="BlueViolet" />
</Trigger>
<Trigger Property="ToggleButton.IsChecked" Value="False">
<Setter TargetName="highlightCircle" Property="Shape.Fill" Value="#FFFFFF" />
</Trigger>
<Trigger Property="UIElement.IsFocused" Value="True">
<Setter TargetName="outerEllipse" Property="Shape.Stroke" Value="BlueViolet" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>