Kanalschaden werden richtig geparsed
This commit is contained in:
50
DaSaSo.ViewModel/Controls/SewerDamageControllViewModel.cs
Normal file
50
DaSaSo.ViewModel/Controls/SewerDamageControllViewModel.cs
Normal 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.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using DaSaSo.Domain.Model;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DaSaSo.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 SewerPreperationControllViewModel(EPreparationType preparationType)
|
||||
{
|
||||
HD = preparationType.HasFlag(EPreparationType.CleanedHD);
|
||||
Mechanisch = preparationType.HasFlag(EPreparationType.CleanedMechanisch);
|
||||
Roboter = preparationType.HasFlag(EPreparationType.CleanedRoboter);
|
||||
Faekalienfrei = preparationType.HasFlag(EPreparationType.FaekalienFrei);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user