Code cleanup
This commit is contained in:
@@ -15,23 +15,23 @@ namespace SewerStammGen.WPF.Commands
|
||||
{
|
||||
private HaltungEditViewModel haltungEditViewModel;
|
||||
private IDataService<Kanal> kanalDataService;
|
||||
private ISchachtService schachtService;
|
||||
|
||||
|
||||
public HaltungEditSaveCommand(HaltungEditViewModel haltungEditViewModel, ISchachtService schachtService)
|
||||
public HaltungEditSaveCommand(HaltungEditViewModel haltungEditViewModel)
|
||||
{
|
||||
this.haltungEditViewModel = haltungEditViewModel;
|
||||
//this.kanalDataService = kanalDataService;
|
||||
this.schachtService = schachtService;
|
||||
|
||||
}
|
||||
|
||||
public override async Task ExecuteAsync(object? parameter)
|
||||
{
|
||||
if(haltungEditViewModel._oberePunkt != haltungEditViewModel.Model.StartSchacht.Objektbezeichnung)
|
||||
{
|
||||
Schacht s = await schachtService.FindSchachtByNameAndProjektID(haltungEditViewModel._oberePunkt, haltungEditViewModel.Model.Projekt.Id);
|
||||
haltungEditViewModel.Model.StartSchacht = s;
|
||||
//Schacht s = await schachtService.FindSchachtByNameAndProjektID(haltungEditViewModel._oberePunkt, haltungEditViewModel.Model.Projekt.Id);
|
||||
//haltungEditViewModel.Model.StartSchacht = s;
|
||||
}
|
||||
haltungEditViewModel.Model = await kanalDataService.Update(haltungEditViewModel.Model.Id, haltungEditViewModel.Model);
|
||||
//haltungEditViewModel.Model = await kanalDataService.Update(haltungEditViewModel.Model.Id, haltungEditViewModel.Model);
|
||||
Trace.WriteLine("Daten gespeichert");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,21 +16,20 @@ namespace SewerStammGen.WPF.Commands
|
||||
private readonly IActualState actualState;
|
||||
private readonly IRenavigator renavigator;
|
||||
private readonly IDataService<Projekt> projektService;
|
||||
private readonly ISchachtService schachtService;
|
||||
|
||||
|
||||
public SchachtAddCommand(IDataService<Projekt> projektService, IActualState actualState, IRenavigator renavigator, ISchachtService schachtService)
|
||||
public SchachtAddCommand(IDataService<Projekt> projektService, IActualState actualState, IRenavigator renavigator)
|
||||
{
|
||||
this.actualState = actualState;
|
||||
this.renavigator = renavigator;
|
||||
this.projektService = projektService;
|
||||
this.schachtService = schachtService;
|
||||
|
||||
}
|
||||
|
||||
public override async Task ExecuteAsync(object? parameter)
|
||||
{
|
||||
Projekt aktuelleProjekt = await projektService.Get(actualState.ProjektID);
|
||||
Schacht schacht = await schachtService.CreateSchacht(aktuelleProjekt);
|
||||
// Schacht schacht = await schachtService.CreateSchacht(aktuelleProjekt);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user