92 lines
2.2 KiB
C#
92 lines
2.2 KiB
C#
using System;
|
|
using System.Windows.Input;
|
|
using Aufgabe17.Framework;
|
|
using Aufgabe17.Models;
|
|
|
|
namespace Aufgabe17.ViewModels
|
|
{
|
|
public class WindowAddViewModel : ViewModelBase
|
|
{
|
|
public Employee Model { get; set; } = new Employee();
|
|
|
|
public ICommand OkCommand { get; set; }
|
|
|
|
public ICommand CancelCommand { get; set; }
|
|
|
|
public Gender[] Genders
|
|
{
|
|
get { return (Gender[]) Enum.GetValues(typeof(Gender)); }
|
|
}
|
|
|
|
|
|
public string Firstname
|
|
{
|
|
get { return Model.Firstname; }
|
|
set
|
|
{
|
|
Model.Firstname = value;
|
|
OnPropertyChanged(); // Hoffentlich richtig
|
|
}
|
|
}
|
|
|
|
public string Lastname
|
|
{
|
|
get { return Model.Lastname; }
|
|
set
|
|
{
|
|
Model.Lastname = value;
|
|
OnPropertyChanged(); // Hoffentlich richtig
|
|
}
|
|
}
|
|
|
|
public Gender Gender
|
|
{
|
|
get { return Model.Gender; }
|
|
set
|
|
{
|
|
Model.Gender = value;
|
|
OnPropertyChanged(); // Hoffentlich richtig
|
|
}
|
|
}
|
|
|
|
public string Street
|
|
{
|
|
get { return Model.Address.Street; }
|
|
set
|
|
{
|
|
Model.Address.Street = value;
|
|
OnPropertyChanged(); // Hoffentlich richtig
|
|
}
|
|
}
|
|
|
|
public string StreetNumber
|
|
{
|
|
get { return Model.Address.StreetNumber; }
|
|
set
|
|
{
|
|
Model.Address.StreetNumber = value;
|
|
OnPropertyChanged(); // Hoffentlich richtig
|
|
}
|
|
}
|
|
|
|
public int PostCode
|
|
{
|
|
get { return Model.Address.PostCode; }
|
|
set
|
|
{
|
|
Model.Address.PostCode = value;
|
|
OnPropertyChanged(); // Hoffentlich richtig
|
|
}
|
|
}
|
|
|
|
public string City
|
|
{
|
|
get { return Model.Address.City; }
|
|
set
|
|
{
|
|
Model.Address.City = value;
|
|
OnPropertyChanged(); // Hoffentlich richtig
|
|
}
|
|
}
|
|
}
|
|
} |