Schächte werden nun hinzugefügt
This commit is contained in:
46
SewerStammGen/Commands/SchachtAddCommand.cs
Normal file
46
SewerStammGen/Commands/SchachtAddCommand.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
33
SewerStammGen/Commands/SchachtDeleteCommand.cs
Normal file
33
SewerStammGen/Commands/SchachtDeleteCommand.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using SewerStammGen.Shared.Contracts;
|
||||
using SewerStammGen.WPF.Interface.Navigator;
|
||||
using SewerStammGen.WPF.ViewModel;
|
||||
using SewerStammGen.WPF.ViewModel.State;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.Commands
|
||||
{
|
||||
class SchachtDeleteCommand : AsyncCommandBase
|
||||
{
|
||||
private ISchachtDataService schachtService;
|
||||
private IActualState actualState;
|
||||
private IRenavigator renavigator;
|
||||
private ManholeListViewModel manholeListViewModel;
|
||||
|
||||
public SchachtDeleteCommand(ISchachtDataService schachtService, IActualState actualState, IRenavigator renavigator, ManholeListViewModel manholeListViewModel)
|
||||
{
|
||||
this.schachtService = schachtService;
|
||||
this.actualState = actualState;
|
||||
this.renavigator = renavigator;
|
||||
this.manholeListViewModel = manholeListViewModel;
|
||||
}
|
||||
|
||||
public override Task ExecuteAsync(object? parameter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
33
SewerStammGen/Commands/SchachtEditCommand.cs
Normal file
33
SewerStammGen/Commands/SchachtEditCommand.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using SewerStammGen.Shared.Contracts;
|
||||
using SewerStammGen.WPF.Interface.Navigator;
|
||||
using SewerStammGen.WPF.ViewModel;
|
||||
using SewerStammGen.WPF.ViewModel.State;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.Commands
|
||||
{
|
||||
class SchachtEditCommand : AsyncCommandBase
|
||||
{
|
||||
private ISchachtDataService schachtService;
|
||||
private IActualState actualState;
|
||||
private IRenavigator renavigator;
|
||||
private ManholeListViewModel manholeListViewModel;
|
||||
|
||||
public SchachtEditCommand(ISchachtDataService schachtService, IActualState actualState, IRenavigator renavigator, ManholeListViewModel manholeListViewModel)
|
||||
{
|
||||
this.schachtService = schachtService;
|
||||
this.actualState = actualState;
|
||||
this.renavigator = renavigator;
|
||||
this.manholeListViewModel = manholeListViewModel;
|
||||
}
|
||||
|
||||
public override Task ExecuteAsync(object? parameter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user