Client wird gespeichert mittels interface

This commit is contained in:
HuskyTeufel
2021-09-14 19:08:55 +02:00
parent 8eccf7c478
commit bbffb270bc
13 changed files with 149 additions and 70 deletions

View File

@@ -1,5 +1,6 @@
using DaSaSo.Domain.Model;
using DaSaSo.Domain.Services;
using DaSaSo.ViewModel.Interface;
using Microsoft.Toolkit.Mvvm.Input;
using System;
using System.Collections.Generic;
@@ -14,17 +15,19 @@ namespace DaSaSo.ViewModel
{
private Client _model;
private IDataService<Client> _dataService;
private readonly IActualProject _actualProject;
public Client Model { get => _model; set => _model = value; }
public IRelayCommand SaveClientCommand { get; set; }
public ClientEditViewModel(IDataService<Client> dataService, Client model)
public ClientEditViewModel(IDataService<Client> dataService, IActualProject actualProject)
{
this._model = model;
this._dataService = dataService;
SaveClientCommand = new RelayCommand(SaveClient);
_actualProject = actualProject;
this._model = _actualProject.AktuellClient;
}
private void SaveClient()