Files
SewerGenerator/SewerStammGen/Commands/SchachtAddCommand.cs

47 lines
1.6 KiB
C#

using SewerStammGen.Shared.Contracts;
using SewerStammGen.WPF.Interface.Navigator;
using SewerStammGen.WPF.ViewModel.State;
using Shared.Contracts;
using Shared.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SewerStammGen.WPF.Commands
{
class SchachtAddCommand : AsyncCommandBase
{
private readonly ISchachtDataService schachtDataService;
private readonly IActualState actualState;
private readonly IRenavigator renavigator;
private readonly IDataService<Projekt> projektService;
private readonly ISchachtService schachtService;
public SchachtAddCommand(ISchachtDataService schachtDataService,IDataService<Projekt> projektService, IActualState actualState, IRenavigator renavigator, ISchachtService schachtService)
{
this.schachtDataService = schachtDataService;
this.actualState = actualState;
this.renavigator = renavigator;
this.projektService = projektService;
this.schachtService = schachtService;
}
public override async Task ExecuteAsync(object? parameter)
{
/*var d = await projektService.Get(actualState.ProjektID);
Schacht newSchacht = new Schacht();
newSchacht.Projekt = d;
newSchacht.Objektbezeichnung = "test";
await schachtDataService.Create(newSchacht);
*/
Projekt aktuelleProjekt = await projektService.Get(actualState.ProjektID);
Schacht schacht = await schachtService.CreateSchacht(aktuelleProjekt);
}
}
}