117 lines
2.6 KiB
C#
117 lines
2.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
using BeWo.Validation;
|
|
|
|
using BS.Shared.DataContracts;
|
|
|
|
namespace BeWo.ViewModel
|
|
{
|
|
public class OvertimeVM : AbstractDCMapperVM<OvertimeDC>
|
|
{
|
|
public static string PropertyName_Notice = "Notice";
|
|
public static string PropertyName_Date = "Date";
|
|
public static string PropertyName_Auszahlungsart = "Auszahlungsart";
|
|
public static string PropertyName_Betrag = "Betrag";
|
|
|
|
|
|
private AuszahlungsartDC _Auszahlungsart;
|
|
private DateTime? _Date;
|
|
private string _Notice;
|
|
private decimal _Betrag;
|
|
|
|
public OvertimeVM(OvertimeDC pDC)
|
|
: base(pDC, pDC.OvertimeOid == null)
|
|
{
|
|
}
|
|
|
|
|
|
public string Notice
|
|
{
|
|
get { return _Notice; }
|
|
|
|
set
|
|
{
|
|
if (AreDifferent(_Notice, value))
|
|
{
|
|
_Notice = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.Notice, value), PropertyName_Notice);
|
|
FirePropertyChanged(PropertyName_Notice);
|
|
}
|
|
}
|
|
}
|
|
|
|
[Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
|
|
public DateTime? Date
|
|
{
|
|
get { return _Date; }
|
|
|
|
set
|
|
{
|
|
if (AreDifferent(_Date, value))
|
|
{
|
|
_Date = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.Date, value), PropertyName_Date);
|
|
FirePropertyChanged(PropertyName_Date);
|
|
}
|
|
}
|
|
}
|
|
|
|
public decimal Betrag
|
|
{
|
|
get { return _Betrag; }
|
|
set
|
|
{
|
|
if (AreDifferent(_Betrag, value))
|
|
{
|
|
_Betrag = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.Betrag, value), PropertyName_Betrag);
|
|
FirePropertyChanged(PropertyName_Betrag);
|
|
}
|
|
}
|
|
}
|
|
|
|
public AuszahlungsartDC Auszahlungsart
|
|
{
|
|
get { return _Auszahlungsart; }
|
|
|
|
set
|
|
{
|
|
if (AreDifferent(_Auszahlungsart, value))
|
|
{
|
|
_Auszahlungsart = value;
|
|
StoreDirtyInformation(!AreEqual(value, DataContract.Auszahlungsart), PropertyName_Auszahlungsart);
|
|
FirePropertyChanged(PropertyName_Auszahlungsart);
|
|
}
|
|
}
|
|
}
|
|
|
|
public String InsUser
|
|
{
|
|
get { return DataContract.InsUser; }
|
|
}
|
|
|
|
protected override void InitByDataContract(OvertimeDC pDataContract)
|
|
{
|
|
if (IsNew) return;
|
|
|
|
_Notice = pDataContract.Notice;
|
|
_Date = pDataContract.Date;
|
|
_Auszahlungsart = pDataContract.Auszahlungsart;
|
|
_Betrag = pDataContract.Betrag;
|
|
|
|
}
|
|
|
|
protected override OvertimeDC MapToDataContract(OvertimeDC pDataContract, bool doCommit)
|
|
{
|
|
pDataContract.Notice = _Notice;
|
|
pDataContract.Date = _Date;
|
|
pDataContract.Betrag = _Betrag;
|
|
|
|
if(_Auszahlungsart != null)
|
|
pDataContract.Auszahlungsart = _Auszahlungsart;
|
|
|
|
return pDataContract;
|
|
}
|
|
}
|
|
} |