SchachtDataService hinzugefügt

This commit is contained in:
2023-04-13 14:08:48 +02:00
parent 047e036442
commit 47aba01cb4
28 changed files with 360 additions and 237 deletions

View File

@@ -15,22 +15,22 @@ namespace SewerStammGen.WPF.Commands
{
private readonly IActualState actualState;
private readonly IRenavigator renavigator;
private readonly IDataService<Projekt> projektService;
public SchachtAddCommand(IDataService<Projekt> projektService, IActualState actualState, IRenavigator renavigator)
public SchachtAddCommand(IActualState actualState, IRenavigator renavigator)
{
this.actualState = actualState;
this.renavigator = renavigator;
this.projektService = projektService;
}
public override async Task ExecuteAsync(object? parameter)
{
Projekt aktuelleProjekt = await projektService.Get(actualState.ProjektID);
// Schacht schacht = await schachtService.CreateSchacht(aktuelleProjekt);
Schacht newSchacht = new Schacht()
{
Projekt = new Projekt() { Id = actualState.ProjektID },
};
actualState.SetSchacht(newSchacht);
renavigator.Renavigate();
}
}
}