Imprägnierungedit weitergeschrieben
This commit is contained in:
@@ -14,20 +14,24 @@ namespace DaSaSo.ViewModel.Commands
|
||||
private IDataService<Impregnation> _impregnationService;
|
||||
private ImpregnierungListViewModel _impregnierungListViewModel;
|
||||
private IRenavigator _editRenavigator;
|
||||
private IActualProject _actualProject;
|
||||
|
||||
public EditImpregnationCommand(
|
||||
IDataService<Impregnation> impregnationService,
|
||||
ImpregnierungListViewModel impregnierungListViewModel,
|
||||
IActualProject actualProject,
|
||||
IRenavigator editRenavigator)
|
||||
{
|
||||
_impregnationService = impregnationService;
|
||||
_impregnierungListViewModel = impregnierungListViewModel;
|
||||
_actualProject = actualProject;
|
||||
_editRenavigator = editRenavigator;
|
||||
}
|
||||
|
||||
public override Task ExecuteAsync(object? parameter)
|
||||
public override async Task ExecuteAsync(object? parameter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
_actualProject.SetImpregnation(_impregnierungListViewModel.SelectedImpregnation);
|
||||
_editRenavigator.Renavigate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using DaSaSo.Domain.Model;
|
||||
using DaSaSo.ViewModel.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -8,5 +10,52 @@ namespace DaSaSo.ViewModel
|
||||
{
|
||||
public class ImpregnierungEditViewModel : BaseViewModel
|
||||
{
|
||||
private Impregnation _model;
|
||||
|
||||
public int DN
|
||||
{
|
||||
get => _model.DN;
|
||||
set
|
||||
{
|
||||
_model.DN = value;
|
||||
}
|
||||
}
|
||||
public string LinerCharge
|
||||
{
|
||||
get => _model.LinerNumber;
|
||||
set
|
||||
{
|
||||
_model.LinerNumber = value;
|
||||
}
|
||||
}
|
||||
public decimal Wandstärke
|
||||
{
|
||||
get => _model.WallThickness;
|
||||
set
|
||||
{
|
||||
_model.WallThickness = value;
|
||||
}
|
||||
}
|
||||
public decimal LinerLänge
|
||||
{
|
||||
get => _model.Linerlength;
|
||||
set
|
||||
{
|
||||
_model.Linerlength = value;
|
||||
}
|
||||
}
|
||||
public string Imprägniernummer
|
||||
{
|
||||
get => _model.Number;
|
||||
set
|
||||
{
|
||||
_model.Number = value;
|
||||
}
|
||||
}
|
||||
|
||||
public ImpregnierungEditViewModel(IActualProject actualProject)
|
||||
{
|
||||
_model = actualProject.AktuellImpregnation;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace DaSaSo.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
public ImpregnierungListViewModel(IDataService<Impregnation> impregnationService, IRenavigator editRenavigator)
|
||||
public ImpregnierungListViewModel(IDataService<Impregnation> impregnationService,IActualProject actualProject, IRenavigator editRenavigator)
|
||||
{
|
||||
IsLoading = true;
|
||||
Impregnations = new ObservableCollection<Impregnation>();
|
||||
@@ -63,7 +63,7 @@ namespace DaSaSo.ViewModel
|
||||
});
|
||||
|
||||
//AddImpregnationCommand = //new AddImpregnationCommand(_impregnationService, editRenavigator);
|
||||
EditImpregnationCommand = new EditImpregnationCommand(_impregnationService, this, editRenavigator);
|
||||
EditImpregnationCommand = new EditImpregnationCommand(_impregnationService, this,actualProject, editRenavigator);
|
||||
LoadImpregnations();
|
||||
|
||||
}
|
||||
|
||||
@@ -19,12 +19,14 @@ namespace DaSaSo.ViewModel.Interface
|
||||
Buildingsite AktuellBaustelle { get; }
|
||||
SewerObject AktuellSewerObject { get; }
|
||||
SewerDamage AktuellSewerDamage { get; }
|
||||
Impregnation AktuellImpregnation { get; }
|
||||
|
||||
void SetClient(Client client, bool notification = true);
|
||||
void SetProject(Project project, bool notification = true);
|
||||
void SetBuildingSite(Buildingsite buildingsite);
|
||||
void SetSewerObject(SewerObject sewerObject, bool notification = true);
|
||||
void SetSewerDamage(SewerDamage sewerDamage, bool notification = true);
|
||||
void SetImpregnation(Impregnation impregnation, bool notification = true);
|
||||
void ResetProject();
|
||||
void ResetBuildingSite();
|
||||
}
|
||||
|
||||
@@ -14,8 +14,8 @@ namespace DaSaSo.ViewModel.State.ActualState
|
||||
public Buildingsite? AktuellBaustelle { get; private set; }
|
||||
public Project? AktuellProjekt { get; private set; }
|
||||
public SewerObject? AktuellSewerObject { get; private set; }
|
||||
|
||||
public SewerDamage? AktuellSewerDamage { get; private set; }
|
||||
public Impregnation? AktuellImpregnation { get; private set; }
|
||||
|
||||
|
||||
#region events
|
||||
@@ -57,7 +57,6 @@ namespace DaSaSo.ViewModel.State.ActualState
|
||||
|
||||
public void SetProject(Project project, bool notification = true)
|
||||
{
|
||||
|
||||
AktuellProjekt = project;
|
||||
if(notification)
|
||||
OnProjectChanged();
|
||||
@@ -76,7 +75,12 @@ namespace DaSaSo.ViewModel.State.ActualState
|
||||
OnSewerObjectChanged();
|
||||
}
|
||||
|
||||
|
||||
public void SetImpregnation(Impregnation impregnation, bool notification = true)
|
||||
{
|
||||
AktuellImpregnation = impregnation;
|
||||
if (notification)
|
||||
return; // TODO notification wird aktuell nicht benötigt
|
||||
}
|
||||
public void ResetProject()
|
||||
{
|
||||
SetProject(null);
|
||||
|
||||
Reference in New Issue
Block a user