2016-06-27 01:45:38 +02:00
|
|
|
|
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";
|
|
|
|
|
|
|
2016-09-13 11:32:25 +02:00
|
|
|
|
public static string PropertyName_IsDelivered = "IsDelivered";
|
2016-07-25 14:45:38 +02:00
|
|
|
|
|
2016-08-05 12:48:13 +02:00
|
|
|
|
public static string PropertyName_IstGelesen = "IstGelesen";
|
|
|
|
|
|
|
2016-10-21 09:41:14 +02:00
|
|
|
|
public static string PropertyName_MessageId = "MessageId";
|
|
|
|
|
|
|
2016-11-08 13:50:58 +01:00
|
|
|
|
public static string PropertyName_MediaDatei = "MediaDatei";
|
2016-10-21 11:26:42 +02:00
|
|
|
|
|
2016-11-17 14:46:54 +01:00
|
|
|
|
public static string PropertyName_ImageThumbNail = "ImageThumbNail";
|
|
|
|
|
|
|
2016-11-08 13:50:58 +01:00
|
|
|
|
public static string PropertyName_MediaTyp = "MediaTyp";
|
|
|
|
|
|
|
2016-06-27 01:45:38 +02:00
|
|
|
|
private string _ChatText;
|
|
|
|
|
|
|
2016-11-08 13:50:58 +01:00
|
|
|
|
private byte[] _MediaDatei;
|
2016-10-21 11:26:42 +02:00
|
|
|
|
|
2016-11-17 14:46:54 +01:00
|
|
|
|
private byte[] _ImageThumbNail;
|
|
|
|
|
|
|
2016-11-08 13:50:58 +01:00
|
|
|
|
private int _MediaTyp;
|
2016-10-21 11:26:42 +02:00
|
|
|
|
|
2016-06-27 01:45:38 +02:00
|
|
|
|
private DateTime _Uhrzeit;
|
|
|
|
|
|
|
|
|
|
|
|
private long? _SenderPersonOid;
|
|
|
|
|
|
|
|
|
|
|
|
private long? _Empf<EFBFBD>ngerPersonOid;
|
|
|
|
|
|
|
2016-09-13 11:32:25 +02:00
|
|
|
|
private bool _IsDelivered;
|
2016-07-25 14:45:38 +02:00
|
|
|
|
|
2016-08-05 12:48:13 +02:00
|
|
|
|
private int _IstGelesen;
|
|
|
|
|
|
|
|
|
|
|
|
private long? _TeamOid;
|
|
|
|
|
|
|
2016-10-21 09:41:14 +02:00
|
|
|
|
private string _MessageId;
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
|
|
|
|
|
public ChatMessageVM(ChatMessageDC pDC)
|
|
|
|
|
|
: base(pDC, true)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-10-21 09:41:14 +02:00
|
|
|
|
public virtual string MessageId
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _MessageId; }
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
if(AreDifferent(_MessageId, value))
|
|
|
|
|
|
{
|
|
|
|
|
|
_MessageId = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
|
|
|
|
|
public virtual string ChatText
|
|
|
|
|
|
{
|
2016-09-13 11:32:25 +02:00
|
|
|
|
get { return _ChatText; }
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
2016-09-13 11:32:25 +02:00
|
|
|
|
if (AreDifferent(_ChatText, value))
|
2016-06-27 01:45:38 +02:00
|
|
|
|
{
|
2016-09-13 11:32:25 +02:00
|
|
|
|
_ChatText = value;
|
2016-06-27 01:45:38 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-11-08 13:50:58 +01:00
|
|
|
|
public virtual byte[] MediaDatei
|
2016-10-21 11:26:42 +02:00
|
|
|
|
{
|
2016-11-08 13:50:58 +01:00
|
|
|
|
get { return _MediaDatei; }
|
2016-10-21 11:26:42 +02:00
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
2016-11-08 13:50:58 +01:00
|
|
|
|
if (AreDifferent(_MediaDatei, value))
|
2016-10-21 11:26:42 +02:00
|
|
|
|
{
|
2016-11-08 13:50:58 +01:00
|
|
|
|
_MediaDatei = value;
|
2016-10-21 11:26:42 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-11-17 14:46:54 +01:00
|
|
|
|
public virtual byte[] ImageThumbNail
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return _ImageThumbNail; }
|
|
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
if (AreDifferent(_ImageThumbNail, value))
|
|
|
|
|
|
{
|
|
|
|
|
|
_ImageThumbNail = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-06-27 01:45:38 +02:00
|
|
|
|
public DateTime Uhrzeit
|
|
|
|
|
|
{
|
2016-09-13 11:32:25 +02:00
|
|
|
|
get { return _Uhrzeit; }
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
2016-09-13 11:32:25 +02:00
|
|
|
|
if (AreDifferent(_Uhrzeit, value))
|
2016-06-27 01:45:38 +02:00
|
|
|
|
{
|
2016-09-13 11:32:25 +02:00
|
|
|
|
_Uhrzeit = value;
|
|
|
|
|
|
StoreDirtyInformation(AreDifferent(DataContract.Uhrzeit, value), PropertyName_Uhrzeit);
|
|
|
|
|
|
FirePropertyChanged(PropertyName_Uhrzeit);
|
2016-06-27 01:45:38 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public virtual long? SenderPersonOid
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return this._SenderPersonOid;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
2016-09-13 11:32:25 +02:00
|
|
|
|
if (AreDifferent(_SenderPersonOid, value))
|
2016-06-27 01:45:38 +02:00
|
|
|
|
{
|
2016-09-13 11:32:25 +02:00
|
|
|
|
_SenderPersonOid = value;
|
2016-06-27 01:45:38 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public virtual long? Empf<EFBFBD>ngerPersonOid
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
2016-09-13 11:32:25 +02:00
|
|
|
|
return _Empf<EFBFBD>ngerPersonOid;
|
2016-06-27 01:45:38 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
2016-09-13 11:32:25 +02:00
|
|
|
|
if (AreDifferent(_Empf<EFBFBD>ngerPersonOid, value))
|
2016-06-27 01:45:38 +02:00
|
|
|
|
{
|
2016-09-13 11:32:25 +02:00
|
|
|
|
_Empf<EFBFBD>ngerPersonOid = value;
|
2016-06-27 01:45:38 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-09-13 11:32:25 +02:00
|
|
|
|
public virtual bool IsDelivered
|
2016-07-25 14:45:38 +02:00
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
2016-09-13 11:32:25 +02:00
|
|
|
|
return _IsDelivered;
|
2016-07-25 14:45:38 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
2016-09-13 11:32:25 +02:00
|
|
|
|
if (AreDifferent(_IsDelivered, value))
|
2016-07-25 14:45:38 +02:00
|
|
|
|
{
|
2016-09-13 11:32:25 +02:00
|
|
|
|
_IsDelivered = value;
|
2016-07-25 14:45:38 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-08-05 12:48:13 +02:00
|
|
|
|
public virtual int IstGelesen
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return _IstGelesen;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
if (AreDifferent(_IstGelesen, value))
|
|
|
|
|
|
{
|
|
|
|
|
|
_IstGelesen = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public virtual long? TeamOid
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return _TeamOid;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
2016-09-13 11:32:25 +02:00
|
|
|
|
if (AreDifferent(_TeamOid, value))
|
2016-08-05 12:48:13 +02:00
|
|
|
|
{
|
2016-09-13 11:32:25 +02:00
|
|
|
|
_TeamOid = value;
|
2016-08-05 12:48:13 +02:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-11-08 13:50:58 +01:00
|
|
|
|
public virtual int MediaTyp
|
|
|
|
|
|
{
|
|
|
|
|
|
get
|
|
|
|
|
|
{
|
|
|
|
|
|
return _MediaTyp;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
if (AreDifferent(_MediaTyp, value))
|
|
|
|
|
|
{
|
|
|
|
|
|
_MediaTyp = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-27 01:45:38 +02:00
|
|
|
|
protected override void InitByDataContract(ChatMessageDC pDataContract)
|
|
|
|
|
|
{
|
2016-10-21 09:41:14 +02:00
|
|
|
|
_SenderPersonOid = pDataContract.SenderPersonOid;
|
2016-09-13 11:32:25 +02:00
|
|
|
|
_Empf<EFBFBD>ngerPersonOid = pDataContract.Empf<EFBFBD>ngerPersonOid;
|
2016-10-21 09:41:14 +02:00
|
|
|
|
_Uhrzeit = pDataContract.Uhrzeit;
|
|
|
|
|
|
_ChatText = pDataContract.ChatText;
|
|
|
|
|
|
_IsDelivered = pDataContract.IsDelivered;
|
|
|
|
|
|
_IstGelesen = pDataContract.IstGelesen;
|
|
|
|
|
|
_TeamOid = pDataContract.TeamOid;
|
|
|
|
|
|
_MessageId = pDataContract.MessageId;
|
2016-11-08 13:50:58 +01:00
|
|
|
|
_MediaDatei = pDataContract.MediaDatei;
|
2016-11-17 14:46:54 +01:00
|
|
|
|
_ImageThumbNail = pDataContract.ImageThumpNail;
|
2016-11-08 13:50:58 +01:00
|
|
|
|
_MediaTyp = pDataContract.MediaTyp;
|
2016-11-17 14:46:54 +01:00
|
|
|
|
|
2016-11-08 13:50:58 +01:00
|
|
|
|
|
2016-06-27 01:45:38 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
protected override ChatMessageDC MapToDataContract(ChatMessageDC pDataContract, bool doCommit)
|
|
|
|
|
|
{
|
2016-10-21 09:41:14 +02:00
|
|
|
|
pDataContract.SenderPersonOid = _SenderPersonOid;
|
2016-06-27 01:45:38 +02:00
|
|
|
|
pDataContract.Empf<EFBFBD>ngerPersonOid = _Empf<EFBFBD>ngerPersonOid;
|
2016-10-21 09:41:14 +02:00
|
|
|
|
pDataContract.Uhrzeit = _Uhrzeit;
|
|
|
|
|
|
pDataContract.ChatText = _ChatText;
|
|
|
|
|
|
pDataContract.IsDelivered = _IsDelivered;
|
|
|
|
|
|
pDataContract.IstGelesen = _IstGelesen;
|
|
|
|
|
|
pDataContract.TeamOid = _TeamOid;
|
|
|
|
|
|
pDataContract.MessageId = _MessageId;
|
2016-11-08 13:50:58 +01:00
|
|
|
|
pDataContract.MediaDatei = _MediaDatei;
|
2016-11-17 14:46:54 +01:00
|
|
|
|
pDataContract.ImageThumpNail = _ImageThumbNail;
|
2016-11-08 13:50:58 +01:00
|
|
|
|
pDataContract.MediaTyp = _MediaTyp;
|
2016-06-27 01:45:38 +02:00
|
|
|
|
|
|
|
|
|
|
return pDataContract;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|