using Muchinfo.MTPClient.Data.Enums;
using Muchinfo.MTPClient.Data.Helper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media;
//----------------------------------------------------------------
//Module Name: $safeprojectname$
//Purpose:
//CopyRight: Muchinfo
//History:
//----------------------------------------------------------------
//DateTime 2016/6/27 16:42:21
//Author DK.Huang
//Description Create
//----------------------------------------------------------------
namespace Muchinfo.MTPClient.Data.Model.Message
{
///
/// 通知消息
///
public class NotifyMsg
{
private long _MSG_ID;
///
/// 消息ID NUMBER(20) not null
///
[PropertyDisc("MSG_ID")]
public long MSG_ID
{
get { return _MSG_ID; }
set { _MSG_ID = value; }
}
private NotifyMsgEnum _NOTIFY_MSG_PARAMETERS;
///
///消息参数 VARCHAR2(1000) null,
///
[PropertyDisc("NOTIFY_MSG_PARAMETERS")]
public NotifyMsgEnum NOTIFY_MSG_PARAMETERS
{
get { return _NOTIFY_MSG_PARAMETERS; }
set { _NOTIFY_MSG_PARAMETERS = value; }
}
private string _CONTENT;
///
/// 内容VARCHAR2(4000) null,
///
[PropertyDisc("CONTENT")]
public string CONTENT
{
get { return _CONTENT; }
set { _CONTENT = value; }
}
private int _SEND_STATUS;
///
/// 发送状态NUMBER(1) null,
///
[PropertyDisc("SEND_STATUS")]
public int SEND_STATUS
{
get { return _SEND_STATUS; }
set { _SEND_STATUS = value; }
}
private long _FUNC_NO;
///
/// 功能码 NUMBER(20) null,
///
[PropertyDisc("FUNC_NO")]
public long FUNC_NO
{
get { return _FUNC_NO; }
set { _FUNC_NO = value; }
}
private long _SUB_FUNC_NO;
///
/// 子功能码NUMBER(20) null,
///
[PropertyDisc("SUB_FUNC_NO")]
public long SUB_FUNC_NO
{
get { return _SUB_FUNC_NO; }
set { _SUB_FUNC_NO = value; }
}
private DateTime _RecordTime;
///
///记录时间Date null,
///
[PropertyDisc("RecordTime")]
public DateTime RecordTime
{
get { return _RecordTime; }
set { _RecordTime = value; }
}
private int _notify_action;
///
/// 消息行为 NUMBER null,
///
[PropertyDisc("Notify_action")]
public int Notify_action
{
get { return _notify_action; }
set { _notify_action = value; }
}
private int _receiver_type;
///
/// 接收类型NUMBER null
///
[PropertyDisc("Receiver_type")]
public int Receiver_type
{
get { return _receiver_type; }
set { _receiver_type = value; }
}
private int _ACCOUNTID;
///
/// 用户ID
///
[PropertyDisc("ACCOUNTID")]
public int ACCOUNTID
{
get { return _ACCOUNTID; }
set { _ACCOUNTID = value; }
}
public string NOTIFY_MSG_PARAMETERSDisplay
{
get
{
return NOTIFY_MSG_PARAMETERS.Discription();
}
}
public Brush STATUSBrush
{
get
{
if (SEND_STATUS > 0)
{
return GetFromeResource("List_Item_NotRead");
}
else
{
return GetFromeResource("List_Item_IsRead");
}
}
}
internal T GetFromeResource(string resourceName) where T : class
{
try
{
var brush = (T)Application.Current.TryFindResource(resourceName);
if (brush == null)
{
return default(T);
}
return brush;
}
catch
{
return null;
}
}
}
}