viewmodel ins wpf gepackt, build failed

This commit is contained in:
HuskyTeufel
2022-03-30 14:59:12 +02:00
parent f34f4517ca
commit 1bf0c3b615
87 changed files with 157 additions and 213 deletions

View File

@@ -0,0 +1,50 @@
using DaSaSo.Domain.Model;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DaSaSo.Wpf.ViewModel.Controls
{
public class SewerDamageControllViewModel : BaseViewModel
{
public bool Riss { get; set; }
public bool Bruch { get; set; }
public bool Scherbe { get; set; }
public bool Wurzel { get; set; }
public bool Inkrustation { get; set; }
public bool Ablagerungen { get; set; }
public bool EinrageneStutzen { get; set; }
public bool Infiltration { get; set; }
public SewerDamageControllViewModel(EDamageType damageType)
{
Riss = damageType.HasFlag(EDamageType.Riss);
Bruch = damageType.HasFlag(EDamageType.Bruch);
Scherbe = damageType.HasFlag(EDamageType.Scherbe);
Wurzel = damageType.HasFlag(EDamageType.Wurzel);
Inkrustation = damageType.HasFlag(EDamageType.Inkrustation);
Ablagerungen = damageType.HasFlag(EDamageType.Ablagerung);
EinrageneStutzen = damageType.HasFlag(EDamageType.EinrageneStutzen);
Infiltration = damageType.HasFlag(EDamageType.Infiltration);
}
public EDamageType CalculateDamageFlags()
{
EDamageType result = EDamageType.NONE;
if (Riss) result |= EDamageType.Riss;
if (Bruch) result |= EDamageType.Bruch;
if (Scherbe) result |= EDamageType.Scherbe;
if (Wurzel) result |= EDamageType.Wurzel;
if (Inkrustation) result |= EDamageType.Inkrustation;
if (Ablagerungen) result |= EDamageType.Ablagerung;
if (EinrageneStutzen) result |= EDamageType.EinrageneStutzen;
if (Infiltration) result |= EDamageType.Infiltration;
return result;
}
}
}

View File

@@ -0,0 +1,45 @@
using DaSaSo.Domain.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DaSaSo.Wpf.ViewModel.Controls
{
public class SewerPreperationControllViewModel : BaseViewModel
{
public bool HD { get; set; }
public bool Mechanisch { get; set; }
public bool Roboter { 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)
{
HD = preparationType.HasFlag(EPreparationType.CleanedHD);
Mechanisch = preparationType.HasFlag(EPreparationType.CleanedMechanisch);
Roboter = preparationType.HasFlag(EPreparationType.CleanedRoboter);
Faekalienfrei = preparationType.HasFlag(EPreparationType.FaekalienFrei);
Genehmigung = preparationType.HasFlag(EPreparationType.PermitNeeded);
WaterBaried = preparationType.HasFlag(EPreparationType.WaterBaried);
STVO = preparationType.HasFlag(EPreparationType.STVO);
}
public EPreparationType CalculatePreparationFlags()
{
EPreparationType result = EPreparationType.NONE;
if (HD) result |= EPreparationType.CleanedHD;
if (Mechanisch) result |= EPreparationType.CleanedMechanisch;
if (Roboter) result |= EPreparationType.CleanedRoboter;
if (Faekalienfrei) result |= EPreparationType.FaekalienFrei;
if (Genehmigung) result |= EPreparationType.PermitNeeded;
if (WaterBaried) result |= EPreparationType.WaterBaried;
if (STVO) result |= EPreparationType.STVO;
return result;
}
}
}

View File

@@ -0,0 +1,92 @@
using DaSaSo.Domain.Model;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DaSaSo.Wpf.ViewModel.Controls
{
public class SewerRhebalationControllViewModel : BaseViewModel
{
public string Bediener
{
get => model.Operator;
set
{
if(model.Operator != value)
{
model.Operator = value;
OnPropertyChanged();
}
}
}
public decimal TemperaturAussen
{
get => model.TemperatureOutdoors;
set
{
if(model.TemperatureOutdoors != value)
{
model.TemperatureOutdoors = value;
OnPropertyChanged();
}
}
}
public decimal TemperaturSewer
{
get => model.TemperatureSewer;
set
{
if(model.TemperatureSewer != value)
{
model.TemperatureSewer = value;
OnPropertyChanged();
}
}
}
public string Weather
{
get => model.Weather;
set
{
if(model.Weather != value)
{
model.Weather = value;
OnPropertyChanged();
}
}
}
private DateTime _date;
public DateTime Datum
{
get => _date;
set
{
if(_date != value)
{
_date = value;
model.Date = DateOnly.FromDateTime(_date);
OnPropertyChanged();
}
}
}
public SewerPreperationControllViewModel SewerPreperationControllViewModel { get; set; }
private PipeLiner model;
public SewerRhebalationControllViewModel(PipeLiner model)
{
this.model = model;
SewerPreperationControllViewModel = new SewerPreperationControllViewModel(model.PreparationType);
_date = model.Date.ToDateTime(new TimeOnly(0));
}
public override void Dispose()
{
model.PreparationType = SewerPreperationControllViewModel.CalculatePreparationFlags();
base.Dispose();
}
}
}