Schädenedit hinzugefügt

This commit is contained in:
Husky
2020-03-29 14:15:14 +02:00
parent 58764bc307
commit 6abd8f663a
10 changed files with 207 additions and 11 deletions

View File

@@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace KanSan.Base.Interfaces.UI
{
public interface ISchaedenEditViewModel
{
decimal Entfernung { get; set; }
bool WurzelInkrustationAblagerungen { get; set; }
bool RissBruchScherbe { get; set; }
bool EinragendeStutzen { get; set; }
string Sanierungstyp { get; set; }
}
}

View File

@@ -22,6 +22,10 @@
<ProjectReference Include="..\KanSan.Base\KanSan.Base.csproj" /> <ProjectReference Include="..\KanSan.Base\KanSan.Base.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Folder Include="Schaeden\" />
</ItemGroup>
<Target Name="PreBuild" BeforeTargets="PreBuildEvent"> <Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="git rev-parse HEAD &gt;&quot;$(ProjectDir)\version.txt" /> <Exec Command="git rev-parse HEAD &gt;&quot;$(ProjectDir)\version.txt" />
</Target> </Target>

View File

@@ -0,0 +1,82 @@
using KanSan.Base;
using KanSan.Base.Enums;
using KanSan.Base.Interfaces;
using KanSan.Base.Interfaces.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
namespace KanSan.ViewModel
{
public class SchaedenEditViewModel : PropertyChangedClass, INotifyPropertyChanged, ISchaedenEditViewModel
{
IUnitOfWork unitOfWork = new UnitOfWork(new KanSanContext());
decimal entfernung;
bool wurzelInkrustation;
bool rissbruchscherbe;
bool einragendeStutzen;
ESanierung sanierungstyp;
#region GetSetters
public decimal Entfernung
{
get => entfernung;
set
{
if (entfernung == value) return;
entfernung = value;
OnPropertyChanged();
}
}
public bool WurzelInkrustationAblagerungen
{
get => wurzelInkrustation;
set
{
if (wurzelInkrustation == value) return;
wurzelInkrustation = value;
OnPropertyChanged();
}
}
public bool RissBruchScherbe
{
get => rissbruchscherbe;
set
{
if (rissbruchscherbe == value) return;
rissbruchscherbe = value;
OnPropertyChanged();
}
}
public bool EinragendeStutzen
{
get => einragendeStutzen;
set
{
if (einragendeStutzen == value) return;
einragendeStutzen = value;
OnPropertyChanged();
}
}
public string Sanierungstyp
{
get
{
switch(sanierungstyp)
{
case ESanierung.ERNEUERUNG: return "Offene Bauweise";
case ESanierung.RENOVATION: return "Renovation";
case ESanierung.REPERATUR: return "Reperatur";
default: return "Unbekannt";
}
}
set
{
throw new NotImplementedException();
}
}
#endregion
}
}

View File

@@ -5,6 +5,8 @@
xmlns:local="clr-namespace:KanSan" xmlns:local="clr-namespace:KanSan"
StartupUri="MainWindow.xaml"> StartupUri="MainWindow.xaml">
<Application.Resources> <Application.Resources>
<Style TargetType="{x:Type UserControl}"> <Style TargetType="{x:Type UserControl}">
<Setter Property="FontFamily" Value="Comic Sans MS"/> <Setter Property="FontFamily" Value="Comic Sans MS"/>
<Setter Property="FontSize" Value="20" /> <Setter Property="FontSize" Value="20" />
@@ -14,5 +16,6 @@
<Setter Property="FontFamily" Value="Comic Sans MS"/> <Setter Property="FontFamily" Value="Comic Sans MS"/>
<Setter Property="FontSize" Value="20" /> <Setter Property="FontSize" Value="20" />
</Style> </Style>
</Application.Resources> </Application.Resources>
</Application> </Application>

View File

@@ -40,6 +40,9 @@
<Compile Update="UI\Schäden\UCSchaedenList.xaml.cs"> <Compile Update="UI\Schäden\UCSchaedenList.xaml.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
<Compile Update="UI\Schäden\UCSchaedenEdit.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="UI\UCSewerMainMenu.xaml.cs"> <Compile Update="UI\UCSewerMainMenu.xaml.cs">
<SubType>Code</SubType> <SubType>Code</SubType>
</Compile> </Compile>
@@ -84,6 +87,9 @@
<Page Update="UI\Schäden\UCSchaedenList.xaml"> <Page Update="UI\Schäden\UCSchaedenList.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Update="UI\Schäden\UCSchaedenEdit.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="UI\UCSewerMainMenu.xaml"> <Page Update="UI\UCSewerMainMenu.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>

View File

@@ -0,0 +1,16 @@
using KanSan.Base.Interfaces.UI;
using System;
using System.Collections.Generic;
using System.Text;
namespace KanSan.SampleData
{
class SchaedenEditViewModelSampleData : ISchaedenEditViewModel
{
public decimal Entfernung { get => 0.4m; set => throw new NotImplementedException(); }
public bool WurzelInkrustationAblagerungen { get => true; set => throw new NotImplementedException(); }
public bool RissBruchScherbe { get => false; set => throw new NotImplementedException(); }
public bool EinragendeStutzen { get => true; set => throw new NotImplementedException(); }
public string Sanierungstyp { get => "REPERATUR"; set => throw new NotImplementedException(); }
}
}

View File

@@ -0,0 +1,38 @@
<UserControl x:Class="KanSan.UI.UCSchaedenEdit"
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:sd="clr-namespace:KanSan.SampleData"
xmlns:local="clr-namespace:KanSan.UI"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800" Background="Gray">
<d:UserControl.DataContext>
<sd:SchaedenEditViewModelSampleData />
</d:UserControl.DataContext>
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="./../../my_controls.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="150" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Label Grid.Row="0" Content="Entfernung" />
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Entfernung}" />
<CheckBox Grid.Row="1" Grid.ColumnSpan="2" Content="Wurzel / Inkrustation / Ablagerungen" Style="{StaticResource checkBoxCircle}" IsChecked="{Binding WurzelInkrustationAblagerungen}" />
<CheckBox Grid.Row="2" Grid.ColumnSpan="2" Content="Einragende Stutzen" Style="{StaticResource checkBoxCircle}" IsChecked="{Binding EinragendeStutzen}" />
<CheckBox Grid.Row="3" Grid.ColumnSpan="2" Content="Riss / Bruch / Scherbe" Style="{StaticResource checkBoxCircle}" IsChecked="{Binding RissBruchScherbe}" />
</Grid>
</UserControl>

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Text;
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 KanSan.UI
{
/// <summary>
/// Interaktionslogik für UCSchaedenEdit.xaml
/// </summary>
public partial class UCSchaedenEdit : UserControl
{
public UCSchaedenEdit()
{
InitializeComponent();
}
}
}

View File

@@ -18,7 +18,11 @@
<sd:SchaedenListViewModelSampleData /> <sd:SchaedenListViewModelSampleData />
</d:UserControl.DataContext> </d:UserControl.DataContext>
<Grid> <Grid>
<DataGrid ItemsSource="{Binding Schaeden}" Background="Gray" AutoGenerateColumns="False" Margin="0,0,-32,0"> <Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="100" />
</Grid.RowDefinitions>
<DataGrid CanUserAddRows="False" Grid.Row="0" ItemsSource="{Binding Schaeden}" Background="Gray" AutoGenerateColumns="False" Margin="0,0,0,0">
<DataGrid.RowStyle> <DataGrid.RowStyle>
<Style TargetType="DataGridRow"> <Style TargetType="DataGridRow">
<Setter Property="Background" Value="Gray" /> <Setter Property="Background" Value="Gray" />
@@ -33,5 +37,6 @@
<DataGridCheckBoxColumn Header="Einragende&#x0a;Stutzen" Width="auto" IsReadOnly="True" ElementStyle="{StaticResource checkBoxCircleSmall}" Binding="{Binding StutzenEinragend}" /> <DataGridCheckBoxColumn Header="Einragende&#x0a;Stutzen" Width="auto" IsReadOnly="True" ElementStyle="{StaticResource checkBoxCircleSmall}" Binding="{Binding StutzenEinragend}" />
</DataGrid.Columns> </DataGrid.Columns>
</DataGrid> </DataGrid>
<Button Grid.Row="1">Neue Schaden Hinzufügen</Button>
</Grid> </Grid>
</UserControl> </UserControl>

View File

@@ -66,7 +66,8 @@ namespace KanSan.UI
NONE, NONE,
STAMMDATEN, STAMMDATEN,
SCHAEDEN, SCHAEDEN,
SANIERUNG SANIERUNG,
SCHAEDENEDIT
} }
public class SewerMainMenuItemSelectedEventArgs : EventArgs public class SewerMainMenuItemSelectedEventArgs : EventArgs
{ {