228 lines
5.8 KiB
C#
228 lines
5.8 KiB
C#
using BS.Shared.DataContracts;
|
|
using System;
|
|
|
|
namespace BeWo.ViewModel
|
|
{
|
|
public class ChatMessageVM : AbstractDCMapperVM<ChatMessageDC>
|
|
{
|
|
public static string PropertyName_ChatText = "ChatText";
|
|
|
|
public static string PropertyName_Uhrzeit = "Uhrzeit";
|
|
|
|
public static string PropertyName_IsDelivered = "IsDelivered";
|
|
|
|
public static string PropertyName_IstGelesen = "IstGelesen";
|
|
|
|
public static string PropertyName_MessageId = "MessageId";
|
|
|
|
public static string PropertyName_MediaDatei = "MediaDatei";
|
|
|
|
public static string PropertyName_MediaTyp = "MediaTyp";
|
|
|
|
private string _ChatText;
|
|
|
|
private byte[] _MediaDatei;
|
|
|
|
private int _MediaTyp;
|
|
|
|
private DateTime _Uhrzeit;
|
|
|
|
private long? _SenderPersonOid;
|
|
|
|
private long? _EmpfängerPersonOid;
|
|
|
|
private bool _IsDelivered;
|
|
|
|
private int _IstGelesen;
|
|
|
|
private long? _TeamOid;
|
|
|
|
private string _MessageId;
|
|
|
|
public ChatMessageVM(ChatMessageDC pDC)
|
|
: base(pDC, true)
|
|
{
|
|
}
|
|
|
|
public virtual string MessageId
|
|
{
|
|
get { return _MessageId; }
|
|
set
|
|
{
|
|
if(AreDifferent(_MessageId, value))
|
|
{
|
|
_MessageId = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
public virtual string ChatText
|
|
{
|
|
get { return _ChatText; }
|
|
|
|
set
|
|
{
|
|
if (AreDifferent(_ChatText, value))
|
|
{
|
|
_ChatText = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
public virtual byte[] MediaDatei
|
|
{
|
|
get { return _MediaDatei; }
|
|
|
|
set
|
|
{
|
|
if (AreDifferent(_MediaDatei, value))
|
|
{
|
|
_MediaDatei = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
public DateTime Uhrzeit
|
|
{
|
|
get { return _Uhrzeit; }
|
|
|
|
set
|
|
{
|
|
if (AreDifferent(_Uhrzeit, value))
|
|
{
|
|
_Uhrzeit = value;
|
|
StoreDirtyInformation(AreDifferent(DataContract.Uhrzeit, value), PropertyName_Uhrzeit);
|
|
FirePropertyChanged(PropertyName_Uhrzeit);
|
|
}
|
|
}
|
|
}
|
|
|
|
public virtual long? SenderPersonOid
|
|
{
|
|
get
|
|
{
|
|
return this._SenderPersonOid;
|
|
}
|
|
|
|
set
|
|
{
|
|
if (AreDifferent(_SenderPersonOid, value))
|
|
{
|
|
_SenderPersonOid = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
public virtual long? EmpfängerPersonOid
|
|
{
|
|
get
|
|
{
|
|
return _EmpfängerPersonOid;
|
|
}
|
|
|
|
set
|
|
{
|
|
if (AreDifferent(_EmpfängerPersonOid, value))
|
|
{
|
|
_EmpfängerPersonOid = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
public virtual bool IsDelivered
|
|
{
|
|
get
|
|
{
|
|
return _IsDelivered;
|
|
}
|
|
|
|
set
|
|
{
|
|
if (AreDifferent(_IsDelivered, value))
|
|
{
|
|
_IsDelivered = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
public virtual int IstGelesen
|
|
{
|
|
get
|
|
{
|
|
return _IstGelesen;
|
|
}
|
|
|
|
set
|
|
{
|
|
if (AreDifferent(_IstGelesen, value))
|
|
{
|
|
_IstGelesen = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
public virtual long? TeamOid
|
|
{
|
|
get
|
|
{
|
|
return _TeamOid;
|
|
}
|
|
|
|
set
|
|
{
|
|
if (AreDifferent(_TeamOid, value))
|
|
{
|
|
_TeamOid = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
public virtual int MediaTyp
|
|
{
|
|
get
|
|
{
|
|
return _MediaTyp;
|
|
}
|
|
|
|
set
|
|
{
|
|
if (AreDifferent(_MediaTyp, value))
|
|
{
|
|
_MediaTyp = value;
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
protected override void InitByDataContract(ChatMessageDC pDataContract)
|
|
{
|
|
_SenderPersonOid = pDataContract.SenderPersonOid;
|
|
_EmpfängerPersonOid = pDataContract.EmpfängerPersonOid;
|
|
_Uhrzeit = pDataContract.Uhrzeit;
|
|
_ChatText = pDataContract.ChatText;
|
|
_IsDelivered = pDataContract.IsDelivered;
|
|
_IstGelesen = pDataContract.IstGelesen;
|
|
_TeamOid = pDataContract.TeamOid;
|
|
_MessageId = pDataContract.MessageId;
|
|
_MediaDatei = pDataContract.MediaDatei;
|
|
_MediaTyp = pDataContract.MediaTyp;
|
|
|
|
}
|
|
|
|
protected override ChatMessageDC MapToDataContract(ChatMessageDC pDataContract, bool doCommit)
|
|
{
|
|
pDataContract.SenderPersonOid = _SenderPersonOid;
|
|
pDataContract.EmpfängerPersonOid = _EmpfängerPersonOid;
|
|
pDataContract.Uhrzeit = _Uhrzeit;
|
|
pDataContract.ChatText = _ChatText;
|
|
pDataContract.IsDelivered = _IsDelivered;
|
|
pDataContract.IstGelesen = _IstGelesen;
|
|
pDataContract.TeamOid = _TeamOid;
|
|
pDataContract.MessageId = _MessageId;
|
|
pDataContract.MediaDatei = _MediaDatei;
|
|
pDataContract.MediaTyp = _MediaTyp;
|
|
|
|
return pDataContract;
|
|
}
|
|
}
|
|
} |