62 lines
1.7 KiB
C#
62 lines
1.7 KiB
C#
using BeWo.Validation;
|
|
using BS.Shared.DataContracts;
|
|
|
|
namespace BeWo.ViewModel
|
|
{
|
|
public class MedArtVM : AbstractDCMapperVM<MedArtDC>
|
|
{
|
|
public static string PropertyName_Bezeichnung = "Bezeichnung";
|
|
public static string PropertyName_BezeichnungLang = "BezeichnungLang";
|
|
|
|
private string _Bezeichnung;
|
|
private string _BezeichnungLang;
|
|
|
|
[Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
|
|
public string Bezeichnung
|
|
{
|
|
get { return _Bezeichnung; }
|
|
set
|
|
{
|
|
if (!AreDifferent(_Bezeichnung, value)) return;
|
|
|
|
_Bezeichnung = value;
|
|
|
|
StoreDirtyInformation(AreDifferent(DataContract.Bezeichnung, value), PropertyName_Bezeichnung);
|
|
FirePropertyChanged(PropertyName_Bezeichnung);
|
|
}
|
|
}
|
|
|
|
[Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
|
|
public string BezeichnungLang
|
|
{
|
|
get { return _BezeichnungLang; }
|
|
set
|
|
{
|
|
if (!AreDifferent(_BezeichnungLang, value)) return;
|
|
|
|
_BezeichnungLang = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.BezeichnungLang, value), PropertyName_BezeichnungLang);
|
|
FirePropertyChanged(PropertyName_BezeichnungLang);
|
|
}
|
|
}
|
|
|
|
public MedArtVM(MedArtDC pDC) : base(pDC, pDC.MedArtOid == null) {}
|
|
|
|
protected override void InitByDataContract(MedArtDC pDataContract)
|
|
{
|
|
if (IsNew) return;
|
|
|
|
_Bezeichnung = pDataContract.Bezeichnung;
|
|
_BezeichnungLang = pDataContract.BezeichnungLang;
|
|
}
|
|
|
|
protected override MedArtDC MapToDataContract(MedArtDC pDataContract, bool doCommit)
|
|
{
|
|
pDataContract.Bezeichnung = _Bezeichnung;
|
|
pDataContract.BezeichnungLang = _BezeichnungLang;
|
|
|
|
return pDataContract;
|
|
}
|
|
}
|
|
}
|