178 lines
6.4 KiB
C#
178 lines
6.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using BeWo.Validation;
|
|
using BS.Shared;
|
|
using BS.Shared.Core;
|
|
using BS.Shared.DataContracts.Wohnhilfe;
|
|
|
|
namespace BeWo.ViewModel.Wohnhilfe
|
|
{
|
|
public class CustomerWohnhilfeBereichBundVM : AbstractDCMapperVM<CustomerWohnhilfeBereichBundDC>
|
|
{
|
|
private Verbandszugehorigkeit? _Verbandszugehorigkeit;
|
|
private Geschlecht? _Geschlecht;
|
|
private int? _AlterAmStichtag;
|
|
private int? _Haushaltsgrosse;
|
|
private string _BerichtseinheitID;
|
|
private Unterbringungsart? _Unterbringungsart;
|
|
private int? _OrtDerEinrichtung;
|
|
private Angebot? _Angebot;
|
|
|
|
public CustomerWohnhilfeBereichBundVM()
|
|
{
|
|
_Verbandszugehorigkeit = BS.Shared.DataContracts.Wohnhilfe.Verbandszugehorigkeit.Arbeiterwohlfahrt;
|
|
_Geschlecht = BS.Shared.DataContracts.Wohnhilfe.Geschlecht.Mannlich;
|
|
_AlterAmStichtag = 1000;
|
|
}
|
|
|
|
public CustomerWohnhilfeBereichBundVM(CustomerWohnhilfeBereichBundDC dc, bool isNew) : base(dc, isNew)
|
|
{
|
|
|
|
}
|
|
|
|
public IEnumerable<Verbandszugehorigkeit> VerbandszugehorigkeitTypes => Utils.GetAllEnumValues<Verbandszugehorigkeit>();
|
|
public IEnumerable<Geschlecht> GeschlechtTypes => Utils.GetAllEnumValues<Geschlecht>();
|
|
public IEnumerable<Unterbringungsart> UnterbringungsartTypes => Utils.GetAllEnumValues<Unterbringungsart>();
|
|
public IEnumerable<Angebot> AngebotTypes => Utils.GetAllEnumValues<Angebot>();
|
|
|
|
public Verbandszugehorigkeit? Verbandszugehorigkeit
|
|
{
|
|
get { return _Verbandszugehorigkeit; }
|
|
set
|
|
{
|
|
if (!AreDifferent(_Verbandszugehorigkeit, value))
|
|
return;
|
|
|
|
_Verbandszugehorigkeit = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.Verbandszugehorigkeit, value), nameof(Verbandszugehorigkeit));
|
|
FirePropertyChanged(nameof(Verbandszugehorigkeit));
|
|
}
|
|
}
|
|
|
|
public Geschlecht? Geschlecht
|
|
{
|
|
get { return _Geschlecht; }
|
|
set
|
|
{
|
|
if (!AreDifferent(_Geschlecht, value))
|
|
return;
|
|
|
|
_Geschlecht = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.Geschlecht, value), nameof(Geschlecht));
|
|
FirePropertyChanged(nameof(Geschlecht));
|
|
}
|
|
}
|
|
|
|
public int? AlterAmStichtag
|
|
{
|
|
get { return _AlterAmStichtag; }
|
|
set
|
|
{
|
|
if (!AreDifferent(_AlterAmStichtag, value))
|
|
return;
|
|
|
|
_AlterAmStichtag = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.AlterAmStichtag, value), nameof(AlterAmStichtag));
|
|
FirePropertyChanged(nameof(AlterAmStichtag));
|
|
}
|
|
}
|
|
|
|
public int? Haushaltsgrosse
|
|
{
|
|
get { return _Haushaltsgrosse; }
|
|
set
|
|
{
|
|
if (!AreDifferent(_Haushaltsgrosse, value))
|
|
return;
|
|
|
|
_Haushaltsgrosse = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.Haushaltsgrosse, value), nameof(Haushaltsgrosse));
|
|
FirePropertyChanged(nameof(Haushaltsgrosse));
|
|
}
|
|
}
|
|
|
|
public string BerichtseinheitID
|
|
{
|
|
get { return _BerichtseinheitID; }
|
|
set
|
|
{
|
|
if (!AreDifferent(_BerichtseinheitID, value))
|
|
return;
|
|
|
|
_BerichtseinheitID = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.BerichtseinheitID, value), nameof(BerichtseinheitID));
|
|
FirePropertyChanged(nameof(BerichtseinheitID));
|
|
}
|
|
}
|
|
|
|
public Unterbringungsart? Unterbringungsart
|
|
{
|
|
get { return _Unterbringungsart; }
|
|
set
|
|
{
|
|
if (!AreDifferent(_Unterbringungsart, value))
|
|
return;
|
|
|
|
_Unterbringungsart = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.Unterbringungsart, value), nameof(Unterbringungsart));
|
|
FirePropertyChanged(nameof(Unterbringungsart));
|
|
}
|
|
}
|
|
|
|
public int? OrtDerEinrichtung
|
|
{
|
|
get { return _OrtDerEinrichtung; }
|
|
set
|
|
{
|
|
if (!AreDifferent(_OrtDerEinrichtung, value))
|
|
return;
|
|
|
|
_OrtDerEinrichtung = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.OrtDerEinrichtung, value), nameof(OrtDerEinrichtung));
|
|
FirePropertyChanged(nameof(OrtDerEinrichtung));
|
|
}
|
|
}
|
|
|
|
public Angebot? Angebot
|
|
{
|
|
get { return _Angebot; }
|
|
set
|
|
{
|
|
if (!AreDifferent(_Angebot, value))
|
|
return;
|
|
|
|
_Angebot = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.Angebot, value), nameof(Angebot));
|
|
FirePropertyChanged(nameof(Angebot));
|
|
}
|
|
}
|
|
|
|
protected override void InitByDataContract(CustomerWohnhilfeBereichBundDC pDataContract)
|
|
{
|
|
_Verbandszugehorigkeit = pDataContract.Verbandszugehorigkeit;
|
|
_Geschlecht = pDataContract.Geschlecht;
|
|
_AlterAmStichtag = pDataContract.AlterAmStichtag;
|
|
_Haushaltsgrosse = pDataContract.Haushaltsgrosse;
|
|
_BerichtseinheitID = pDataContract.BerichtseinheitID;
|
|
_Unterbringungsart = pDataContract.Unterbringungsart;
|
|
_OrtDerEinrichtung = pDataContract.OrtDerEinrichtung;
|
|
_Angebot = pDataContract.Angebot;
|
|
}
|
|
|
|
protected override CustomerWohnhilfeBereichBundDC MapToDataContract(CustomerWohnhilfeBereichBundDC pDataContract, bool doCommit)
|
|
{
|
|
pDataContract.Verbandszugehorigkeit = _Verbandszugehorigkeit;
|
|
pDataContract.Geschlecht = _Geschlecht;
|
|
pDataContract.AlterAmStichtag = _AlterAmStichtag;
|
|
pDataContract.Haushaltsgrosse = _Haushaltsgrosse;
|
|
pDataContract.BerichtseinheitID = _BerichtseinheitID;
|
|
pDataContract.Unterbringungsart = _Unterbringungsart;
|
|
pDataContract.OrtDerEinrichtung = _OrtDerEinrichtung;
|
|
pDataContract.Angebot = _Angebot;
|
|
|
|
return pDataContract;
|
|
}
|
|
}
|
|
}
|