Schädenedit hinzugefügt
This commit is contained in:
15
KanSan.Base/Interfaces/UI/ISchaedenEditViewModel.cs
Normal file
15
KanSan.Base/Interfaces/UI/ISchaedenEditViewModel.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,10 @@
|
||||
<ProjectReference Include="..\KanSan.Base\KanSan.Base.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Schaeden\" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
||||
<Exec Command="git rev-parse HEAD >"$(ProjectDir)\version.txt" />
|
||||
</Target>
|
||||
|
||||
82
KanSan.ViewModel/SchaedenEditViewModel.cs
Normal file
82
KanSan.ViewModel/SchaedenEditViewModel.cs
Normal 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
|
||||
}
|
||||
}
|
||||
@@ -5,14 +5,17 @@
|
||||
xmlns:local="clr-namespace:KanSan"
|
||||
StartupUri="MainWindow.xaml">
|
||||
<Application.Resources>
|
||||
<Style TargetType="{x:Type UserControl}">
|
||||
<Setter Property="FontFamily" Value="Comic Sans MS"/>
|
||||
<Setter Property="FontSize" Value="20" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type Window}">
|
||||
<Setter Property="FontFamily" Value="Comic Sans MS"/>
|
||||
<Setter Property="FontSize" Value="20" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type UserControl}">
|
||||
<Setter Property="FontFamily" Value="Comic Sans MS"/>
|
||||
<Setter Property="FontSize" Value="20" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type Window}">
|
||||
<Setter Property="FontFamily" Value="Comic Sans MS"/>
|
||||
<Setter Property="FontSize" Value="20" />
|
||||
</Style>
|
||||
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
|
||||
@@ -40,6 +40,9 @@
|
||||
<Compile Update="UI\Schäden\UCSchaedenList.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="UI\Schäden\UCSchaedenEdit.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="UI\UCSewerMainMenu.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
@@ -84,6 +87,9 @@
|
||||
<Page Update="UI\Schäden\UCSchaedenList.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="UI\Schäden\UCSchaedenEdit.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="UI\UCSewerMainMenu.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
|
||||
16
KanSan/SampleData/SchaedenEditViewModelSampleData.cs
Normal file
16
KanSan/SampleData/SchaedenEditViewModelSampleData.cs
Normal 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(); }
|
||||
}
|
||||
}
|
||||
38
KanSan/UI/Schäden/UCSchaedenEdit.xaml
Normal file
38
KanSan/UI/Schäden/UCSchaedenEdit.xaml
Normal 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>
|
||||
26
KanSan/UI/Schäden/UCSchaedenEdit.xaml.cs
Normal file
26
KanSan/UI/Schäden/UCSchaedenEdit.xaml.cs
Normal 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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,11 @@
|
||||
<sd:SchaedenListViewModelSampleData />
|
||||
</d:UserControl.DataContext>
|
||||
<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>
|
||||
<Style TargetType="DataGridRow">
|
||||
<Setter Property="Background" Value="Gray" />
|
||||
@@ -33,5 +37,6 @@
|
||||
<DataGridCheckBoxColumn Header="Einragende
Stutzen" Width="auto" IsReadOnly="True" ElementStyle="{StaticResource checkBoxCircleSmall}" Binding="{Binding StutzenEinragend}" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Button Grid.Row="1">Neue Schaden Hinzufügen</Button>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace KanSan.UI
|
||||
OnSewerMenuSelected(new SewerMainMenuItemSelectedEventArgs()
|
||||
{
|
||||
Command = command
|
||||
}) ;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,7 +66,8 @@ namespace KanSan.UI
|
||||
NONE,
|
||||
STAMMDATEN,
|
||||
SCHAEDEN,
|
||||
SANIERUNG
|
||||
SANIERUNG,
|
||||
SCHAEDENEDIT
|
||||
}
|
||||
public class SewerMainMenuItemSelectedEventArgs : EventArgs
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user