Code cleanup

This commit is contained in:
2023-04-12 22:29:49 +02:00
parent b100eca490
commit 7a036b3404
22 changed files with 184 additions and 183 deletions

View File

@@ -18,7 +18,7 @@ namespace SewerStammGen.WPF.ViewModel
{
private readonly IActualState _actualState;
//private readonly IHaltungDataService _kanalDataService;
private readonly ISchachtService _schachtService;
private Kanal _model;
public Kanal Model
@@ -113,14 +113,14 @@ namespace SewerStammGen.WPF.ViewModel
public ICommand Speichern { get; set; }
public HaltungEditViewModel(
ISchachtService schachtService,
IActualState actualState)
{
_actualState = actualState;
//_kanalDataService = kanalDataService;
_schachtService = schachtService;
_model = new Kanal();
Speichern = new HaltungEditSaveCommand(this, schachtService);
Speichern = new HaltungEditSaveCommand(this);
LoadModel();

View File

@@ -109,7 +109,7 @@ namespace SewerStammGen.WPF.ViewModel
}
else
{
_dataService.Update(_model.Id, _model);
_dataService.Update(_model);
}
_renavigator.Renavigate();
}

View File

@@ -61,7 +61,9 @@ namespace SewerStammGen.WPF.ViewModel
private async void LoadProjekte()
{
var projects = await genericDataService.GetAll();
InitCollection(_projekte, projects);
}
private void InitCollection(ObservableCollection<Projekt> projekte, IEnumerable<Projekt> projects)

View File

@@ -109,7 +109,7 @@ namespace SewerStammGen.WPF.ViewModel
private void SaveSchacht()
{
_schachtDataService.Update(_model.Id, _model);
//_schachtDataService.Update(_model.Id, _model);
}
private async void LoadModel()

View File

@@ -19,7 +19,7 @@ namespace SewerStammGen.WPF.ViewModel
private ISchachtDataService _schachtDataService;
private readonly ObservableCollection<Schacht> _schaechte;
private readonly IActualState _actualState;
private readonly ISchachtService _schachtService;
public ObservableCollection<Schacht> Schaechte { get => _schaechte; }
public Schacht? SelectedSchacht { get; set; }
@@ -29,15 +29,15 @@ namespace SewerStammGen.WPF.ViewModel
public ICommand DeleteSchachtCommand { get; set; }
public ManholeListViewModel(ISchachtDataService schachtDataService, IDataService<Projekt> projektService,IRenavigator renavigator ,IActualState actualState, ISchachtService schachtService)
public ManholeListViewModel(ISchachtDataService schachtDataService, IDataService<Projekt> projektService,IRenavigator renavigator ,IActualState actualState)
{
_schachtDataService = schachtDataService;
_actualState = actualState;
_schaechte = new ObservableCollection<Schacht>();
_schachtService = schachtService;
AddSchachtCommand = new SchachtAddCommand(projektService, actualState,renavigator,schachtService);
AddSchachtCommand = new SchachtAddCommand(projektService, actualState,renavigator);
EditSchachtCommand = new SchachtEditCommand(schachtDataService, actualState, renavigator,this);
DeleteSchachtCommand = new SchachtDeleteCommand(schachtDataService, actualState, renavigator, this);
@@ -46,8 +46,8 @@ namespace SewerStammGen.WPF.ViewModel
private async void LoadSchaechte()
{
var schaechte = await _schachtDataService.GetAll(_actualState.ProjektID);
InitCollection(_schaechte, schaechte);
//var schaechte = await _schachtDataService.GetAll(_actualState.ProjektID);
//InitCollection(_schaechte, schaechte);
}
private void InitCollection(ObservableCollection<Schacht> dest, IEnumerable<Schacht> source)