37 lines
957 B
C#
37 lines
957 B
C#
using DaSaSo.Domain.Model;
|
|
using DaSaSo.Domain.Services;
|
|
using Microsoft.Toolkit.Mvvm.Input;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace DaSaSo.ViewModel
|
|
{
|
|
public class ClientEditViewModel : BaseViewModel
|
|
{
|
|
private Client _model;
|
|
private IDataService<Client> _dataService;
|
|
|
|
public Client Model { get => _model; set => _model = value; }
|
|
|
|
public IRelayCommand SaveClientCommand { get; set; }
|
|
|
|
|
|
public ClientEditViewModel(IDataService<Client> dataService, Client model)
|
|
{
|
|
this._model = model;
|
|
this._dataService = dataService;
|
|
SaveClientCommand = new RelayCommand(SaveClient);
|
|
}
|
|
|
|
private void SaveClient()
|
|
{
|
|
_dataService.Update(Model.Id, Model);
|
|
Mediator.Notify(Enums.EMediator.SHOWCLIENT);
|
|
}
|
|
}
|
|
}
|