53 lines
1.4 KiB
C#
53 lines
1.4 KiB
C#
using DaSaSo.Domain.Model;
|
|
using DaSaSo.ViewModel.Interface;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace DaSaSo.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; }
|
|
|
|
#region events
|
|
public event EventHandler? ClientChanged;
|
|
public event EventHandler? ProjectChanged;
|
|
public event EventHandler? BuildingSiteChanged;
|
|
protected void OnClientChanged()
|
|
{
|
|
ClientChanged?.Invoke(this, new EventArgs());
|
|
}
|
|
protected void OnProjectChanged()
|
|
{
|
|
ProjectChanged?.Invoke(this, new EventArgs());
|
|
}
|
|
protected void OnBuildingSiteChanged()
|
|
{
|
|
BuildingSiteChanged?.Invoke(this, new EventArgs());
|
|
}
|
|
#endregion
|
|
public void SetClient(Client client)
|
|
{
|
|
AktuellClient = client;
|
|
OnClientChanged();
|
|
}
|
|
|
|
public void SetProject(Project project)
|
|
{
|
|
AktuellProjekt = project;
|
|
OnProjectChanged();
|
|
}
|
|
|
|
public void SetBuildingSite(Buildingsite buildingsite)
|
|
{
|
|
AktuellBaustelle = buildingsite;
|
|
OnBuildingSiteChanged();
|
|
}
|
|
}
|
|
}
|