Sewerdamages angefangen
This commit is contained in:
@@ -12,7 +12,9 @@
|
||||
<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}" />
|
||||
</StackPanel>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
25
DaSaSo.Wpf/Converters/EqualDamageTypeToBooleanConverter.cs
Normal file
25
DaSaSo.Wpf/Converters/EqualDamageTypeToBooleanConverter.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using DaSaSo.Domain.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace DaSaSo.Wpf.Converters
|
||||
{
|
||||
class EqualDamageTypeToBooleanConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return (((int)value & (int)parameter) == (int)value);
|
||||
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using DaSaSo.Domain.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace DaSaSo.Wpf.Converters
|
||||
{
|
||||
class EqualPreperationTypeToBooleanConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
EPreparationType damagevalue = (EPreparationType)value;
|
||||
EPreparationType damageParameter = (EPreparationType)parameter;
|
||||
return damagevalue.HasFlag(damageParameter);
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,6 +28,8 @@ namespace DaSaSo.Wpf.HostBuilders
|
||||
services.AddTransient<MainWindowViewModel>();
|
||||
services.AddSingleton<ClientListViewModel>();
|
||||
|
||||
services.AddTransient<SewerMainListViewModel>();
|
||||
|
||||
services.AddSingleton<CreateViewModel<HomeViewModel>>(services =>
|
||||
{
|
||||
return () => new HomeViewModel();
|
||||
@@ -57,7 +59,10 @@ namespace DaSaSo.Wpf.HostBuilders
|
||||
{
|
||||
return () => new SewerDamageListViewModel(
|
||||
services.GetRequiredService<IActualProject>(),
|
||||
services.GetRequiredService<IDataService<SewerObject>>());
|
||||
services.GetRequiredService<IDataService<SewerObject>>()//,
|
||||
//services.GetRequiredService<SewerMainListViewModel>()
|
||||
|
||||
);
|
||||
});
|
||||
|
||||
services.AddSingleton<CreateViewModel<ClientListViewModel>>(services =>
|
||||
|
||||
25
DaSaSo.Wpf/Sampledata/SewerDamageListSampleData.cs
Normal file
25
DaSaSo.Wpf/Sampledata/SewerDamageListSampleData.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using DaSaSo.Domain.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DaSaSo.Wpf.Sampledata
|
||||
{
|
||||
public class SewerDamageListSampleData
|
||||
{
|
||||
public ObservableCollection<SewerDamage> Damages { get; private set; } = new ObservableCollection<SewerDamage>();
|
||||
public SewerDamageListSampleData()
|
||||
{
|
||||
Damages.Add(new SewerDamage()
|
||||
{
|
||||
DamageType = EDamageType.Bruch | EDamageType.EinrageneStutzen,
|
||||
PreparationType = EPreparationType.CleanedHD | EPreparationType.CleanedRoborter,
|
||||
Distance = 12.5m
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,35 @@
|
||||
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" xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:SewerDamageListViewModel}"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:sd="clr-namespace:DaSaSo.Wpf.Sampledata"
|
||||
xmlns:damagetype ="clr-namespace:DaSaSo.Domain.Model;assembly=DaSaSo.Domain"
|
||||
xmlns:local="clr-namespace:DaSaSo.Wpf.View.SewerObject" xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel"
|
||||
xmlns:converters="clr-namespace:DaSaSo.Wpf.Converters"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="1020">
|
||||
<UserControl.Resources>
|
||||
<converters:EqualDamageTypeToBooleanConverter x:Key="EqualDamageTypeToBooleanConverter" />
|
||||
<converters:EqualPreperationTypeToBooleanConverter x:Key="EqualPreperationTypeToBooleanConverter" />
|
||||
</UserControl.Resources>
|
||||
<d:UserControl.DataContext>
|
||||
<sd:SewerDamageListSampleData />
|
||||
</d:UserControl.DataContext>
|
||||
<Grid>
|
||||
<DataGrid ItemsSource="{Binding Damages}" />
|
||||
<DataGrid ItemsSource="{Binding Damages}" AutoGenerateColumns="False" IsReadOnly="True" SelectedItem="{Binding SelectedDamage}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Entfernung" Binding="{Binding Distance}" />
|
||||
<DataGridCheckBoxColumn Header="Statik (Riss / Bruch / Scherbe)" Binding="{Binding DamageType, Converter={StaticResource EqualDamageTypeToBooleanConverter}, ConverterParameter={x:Static damagetype:EDamageType.Static}}" />
|
||||
<DataGridCheckBoxColumn Header="Betrieb (Wurzeln / Inkrustation / Ablagerungen)" Binding="{Binding DamageType, Converter={StaticResource EqualDamageTypeToBooleanConverter}, ConverterParameter={x:Static damagetype:EDamageType.Betrieb}}" />
|
||||
<DataGridCheckBoxColumn Header="Sonstiges (Infiltration / Einragene Stutzen)" Binding="{Binding DamageType, Converter={StaticResource EqualDamageTypeToBooleanConverter}, ConverterParameter={x:Static damagetype:EDamageType.Other}}" />
|
||||
|
||||
|
||||
<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="Fäkalienfrei" Binding="{Binding PreparationType, Converter={StaticResource EqualPreperationTypeToBooleanConverter}, ConverterParameter={x:Static damagetype:EPreparationType.FaekalienFrei}}" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"databaseToUse": "sqlite",
|
||||
"databaseToUse": "default",
|
||||
"default": "Host = localhost; Database = dasaso; Username = kansan; Password = kansan",
|
||||
"sqlite": "Data Source=database.db"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user