114 lines
2.9 KiB
C#
114 lines
2.9 KiB
C#
using BS.Shared;
|
|
using BS.Shared.DataContracts;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BeWo.ViewModel
|
|
{
|
|
public class PreisVM : AbstractDCMapperVM<PreisDC>
|
|
{
|
|
private DateTime? _PreisInsTs;
|
|
private long? _PreisOid;
|
|
private long? _PreisVersion;
|
|
private SystemEntryID? _PreisSystemEntryID;
|
|
private string _Name;
|
|
private decimal? _Betrag;
|
|
|
|
public PreisVM(PreisDC preisDC) : base(preisDC, preisDC.PreisOid == null)
|
|
{ }
|
|
|
|
public long? PreisOid
|
|
{
|
|
get { return _PreisOid; }
|
|
set
|
|
{
|
|
_PreisOid = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.PreisOid, value), nameof(_PreisOid));
|
|
FirePropertyChanged(nameof(_PreisOid));
|
|
}
|
|
}
|
|
|
|
public DateTime? PreisInsTs
|
|
{
|
|
get { return _PreisInsTs; }
|
|
set
|
|
{
|
|
if (AreDifferent(_PreisInsTs, value))
|
|
{
|
|
_PreisInsTs = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.PreisInsTs, value), nameof(_PreisInsTs));
|
|
FirePropertyChanged(nameof(_PreisInsTs));
|
|
}
|
|
}
|
|
}
|
|
|
|
public long? PreisVersion
|
|
{
|
|
get { return _PreisVersion; }
|
|
set
|
|
{
|
|
_PreisVersion = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.PreisVersion, value), nameof(_PreisVersion));
|
|
FirePropertyChanged(nameof(_PreisVersion));
|
|
}
|
|
}
|
|
|
|
public SystemEntryID? PreisSystemEntryID
|
|
{
|
|
get { return _PreisSystemEntryID; }
|
|
set
|
|
{
|
|
_PreisSystemEntryID = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.PreisSystemEntryID, value), nameof(_PreisSystemEntryID));
|
|
FirePropertyChanged(nameof(_PreisSystemEntryID));
|
|
}
|
|
}
|
|
|
|
public string Name
|
|
{
|
|
get { return _Name; }
|
|
set
|
|
{
|
|
_Name = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.Name, value), nameof(_Name));
|
|
FirePropertyChanged(nameof(_Name));
|
|
}
|
|
}
|
|
|
|
public decimal? Betrag
|
|
{
|
|
get { return _Betrag; }
|
|
set
|
|
{
|
|
_Betrag = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.Betrag, value), nameof(_Betrag));
|
|
FirePropertyChanged(nameof(_Betrag));
|
|
}
|
|
}
|
|
|
|
protected override void InitByDataContract(PreisDC bDataContract)
|
|
{
|
|
_PreisOid = bDataContract.PreisOid;
|
|
_PreisVersion = bDataContract.PreisVersion;
|
|
_PreisSystemEntryID = bDataContract.PreisSystemEntryID;
|
|
Name = bDataContract.Name;
|
|
Betrag = bDataContract.Betrag;
|
|
PreisInsTs = bDataContract.PreisInsTs;
|
|
}
|
|
|
|
protected override PreisDC MapToDataContract(PreisDC bDataContract, bool doCommit)
|
|
{
|
|
bDataContract.PreisOid = _PreisOid;
|
|
bDataContract.PreisVersion = _PreisVersion;
|
|
bDataContract.PreisSystemEntryID = _PreisSystemEntryID;
|
|
bDataContract.Name = _Name;
|
|
bDataContract.Betrag = _Betrag;
|
|
bDataContract.PreisInsTs = _PreisInsTs;
|
|
return bDataContract;
|
|
}
|
|
}
|
|
}
|