148 lines
4.7 KiB
C#
148 lines
4.7 KiB
C#
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 DokumentvorlageVM : AbstractDCMapperVM<DokumentvorlageDC>
|
|
{
|
|
private string _Name;
|
|
private string _Beschreibung;
|
|
private byte[] _Data;
|
|
private long? _Parent;
|
|
private long _Tabellenzugehoerigkeit;
|
|
|
|
private String _Text;
|
|
private String _RTFText;
|
|
|
|
public DokumentvorlageVM(DokumentvorlageDC dokumentvorlageDC) : base(dokumentvorlageDC, dokumentvorlageDC.DokumentvorlageOid == null)
|
|
{ }
|
|
|
|
public string Name
|
|
{
|
|
get { return _Name; }
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._Name, value))
|
|
{
|
|
this._Name = value;
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Name, value), nameof(_Name));
|
|
this.FirePropertyChanged(nameof(_Name));
|
|
}
|
|
}
|
|
}
|
|
public string Beschreibung
|
|
{
|
|
get { return _Beschreibung; }
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._Beschreibung, value))
|
|
{
|
|
this._Beschreibung = value;
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Beschreibung, value), nameof(_Beschreibung));
|
|
this.FirePropertyChanged(nameof(_Beschreibung));
|
|
}
|
|
}
|
|
}
|
|
public byte[] Data
|
|
{
|
|
get { return _Data; }
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._Data, value))
|
|
{
|
|
this._Data = value;
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Data, value), nameof(_Data));
|
|
this.FirePropertyChanged(nameof(_Data));
|
|
}
|
|
}
|
|
}
|
|
public long? Parent
|
|
{
|
|
get { return _Parent; }
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._Parent, value))
|
|
{
|
|
this._Parent = value;
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Parent, value), nameof(_Parent));
|
|
this.FirePropertyChanged(nameof(_Parent));
|
|
}
|
|
}
|
|
}
|
|
public long Tabellenzugehoerigkeit
|
|
{
|
|
get { return _Tabellenzugehoerigkeit; }
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._Tabellenzugehoerigkeit, value))
|
|
{
|
|
this._Tabellenzugehoerigkeit = value;
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Tabellenzugehoerigkeit, value), nameof(_Tabellenzugehoerigkeit));
|
|
this.FirePropertyChanged(nameof(_Tabellenzugehoerigkeit));
|
|
}
|
|
}
|
|
}
|
|
|
|
public string Text
|
|
{
|
|
get
|
|
{
|
|
return this._Text;
|
|
}
|
|
|
|
set
|
|
{
|
|
if (this.AreDifferent(this._Text, value))
|
|
{
|
|
this._Text = value;
|
|
this.StoreDirtyInformation(this.AreDifferent(this.DataContract.Text, value), nameof(_Text));
|
|
this.FirePropertyChanged(nameof(_Text));
|
|
}
|
|
}
|
|
}
|
|
|
|
public string RTFText
|
|
{
|
|
get { return _RTFText; }
|
|
|
|
set
|
|
{
|
|
if (AreDifferent(_RTFText, value))
|
|
{
|
|
_RTFText = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.RTFText, value), nameof(_RTFText));
|
|
FirePropertyChanged(nameof(_RTFText));
|
|
}
|
|
}
|
|
}
|
|
|
|
protected override void InitByDataContract(DokumentvorlageDC pDataContract)
|
|
{
|
|
Name = pDataContract.Name;
|
|
Beschreibung = pDataContract.Beschreibung;
|
|
Data = pDataContract.Data;
|
|
Parent = pDataContract.Parent;
|
|
Tabellenzugehoerigkeit = pDataContract.Tabellenzugehoerigkeit;
|
|
Text = pDataContract.Text;
|
|
RTFText = pDataContract.RTFText;
|
|
}
|
|
|
|
protected override DokumentvorlageDC MapToDataContract(DokumentvorlageDC pDataContract, bool doCommit)
|
|
{
|
|
pDataContract.Name = Name;
|
|
pDataContract.Beschreibung = Beschreibung;
|
|
pDataContract.Data = Data;
|
|
pDataContract.Parent = Parent;
|
|
pDataContract.Tabellenzugehoerigkeit = Tabellenzugehoerigkeit;
|
|
pDataContract.Text = Text;
|
|
pDataContract.RTFText = RTFText;
|
|
|
|
return pDataContract;
|
|
}
|
|
}
|
|
}
|