viewmodel ins wpf gepackt, build failed
This commit is contained in:
102
DaSaSo.Wpf/ViewModel/State/ActualState/ActualProject.cs
Normal file
102
DaSaSo.Wpf/ViewModel/State/ActualState/ActualProject.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
using DaSaSo.Domain.Model;
|
||||
using DaSaSo.Wpf.ViewModel.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DaSaSo.Wpf.ViewModel.State.ActualState
|
||||
{
|
||||
public class ActualProject : IActualProject
|
||||
{
|
||||
public Client? AktuellClient { get; private set; }
|
||||
public Buildingsite? AktuellBaustelle { get; private set; }
|
||||
public Project? AktuellProjekt { get; private set; }
|
||||
public SewerObject? AktuellSewerObject { get; private set; }
|
||||
public SewerDamage? AktuellSewerDamage { get; private set; }
|
||||
public Impregnation? AktuellImpregnation { get; private set; }
|
||||
|
||||
|
||||
#region events
|
||||
public event EventHandler? ClientChanged;
|
||||
public event EventHandler? ProjectChanged;
|
||||
public event EventHandler? BuildingSiteChanged;
|
||||
public event EventHandler? SewerObjectChanged;
|
||||
public event EventHandler? SewerDamageChanged;
|
||||
|
||||
protected void OnClientChanged()
|
||||
{
|
||||
ClientChanged?.Invoke(this, new EventArgs());
|
||||
}
|
||||
protected void OnProjectChanged()
|
||||
{
|
||||
ProjectChanged?.Invoke(this, new EventArgs());
|
||||
}
|
||||
protected void OnBuildingSiteChanged()
|
||||
{
|
||||
BuildingSiteChanged?.Invoke(this, new EventArgs());
|
||||
}
|
||||
protected void OnSewerObjectChanged()
|
||||
{
|
||||
SewerObjectChanged?.Invoke(this, new EventArgs());
|
||||
}
|
||||
protected void OnSewerDamageChanged()
|
||||
{
|
||||
SewerDamageChanged?.Invoke(this, new EventArgs());
|
||||
}
|
||||
#endregion
|
||||
public void SetClient(Client client, bool notification = true)
|
||||
{
|
||||
//ResetProject();
|
||||
//ResetBuildingSite();
|
||||
AktuellClient = client;
|
||||
if(notification)
|
||||
OnClientChanged();
|
||||
}
|
||||
|
||||
public void SetProject(Project project, bool notification = true)
|
||||
{
|
||||
AktuellProjekt = project;
|
||||
if(notification)
|
||||
OnProjectChanged();
|
||||
}
|
||||
|
||||
public void SetBuildingSite(Buildingsite buildingsite)
|
||||
{
|
||||
AktuellBaustelle = buildingsite;
|
||||
OnBuildingSiteChanged();
|
||||
}
|
||||
|
||||
public void SetSewerObject(SewerObject sewerObject,bool notification = true)
|
||||
{
|
||||
AktuellSewerObject = sewerObject;
|
||||
if(notification)
|
||||
OnSewerObjectChanged();
|
||||
}
|
||||
|
||||
public void SetImpregnation(Impregnation impregnation, bool notification = true)
|
||||
{
|
||||
AktuellImpregnation = impregnation;
|
||||
if (notification)
|
||||
return; // TODO notification wird aktuell nicht benötigt
|
||||
}
|
||||
public void ResetProject()
|
||||
{
|
||||
SetProject(null);
|
||||
ResetBuildingSite();
|
||||
}
|
||||
|
||||
public void ResetBuildingSite()
|
||||
{
|
||||
SetBuildingSite(null);
|
||||
}
|
||||
|
||||
public void SetSewerDamage(SewerDamage sewerDamage, bool notification = true)
|
||||
{
|
||||
AktuellSewerDamage = sewerDamage;
|
||||
if (notification)
|
||||
OnSewerDamageChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user