NotifyMsg.cs 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. using Muchinfo.MTPClient.Data.Enums;
  2. using Muchinfo.MTPClient.Data.Helper;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Windows;
  8. using System.Windows.Media;
  9. //----------------------------------------------------------------
  10. //Module Name: $safeprojectname$
  11. //Purpose:
  12. //CopyRight: Muchinfo
  13. //History:
  14. //----------------------------------------------------------------
  15. //DateTime 2016/6/27 16:42:21
  16. //Author DK.Huang
  17. //Description Create
  18. //----------------------------------------------------------------
  19. namespace Muchinfo.MTPClient.Data.Model.Message
  20. {
  21. /// <summary>
  22. /// 通知消息
  23. /// </summary>
  24. public class NotifyMsg
  25. {
  26. private long _MSG_ID;
  27. /// <summary>
  28. /// 消息ID NUMBER(20) not null
  29. /// </summary>
  30. [PropertyDisc("MSG_ID")]
  31. public long MSG_ID
  32. {
  33. get { return _MSG_ID; }
  34. set { _MSG_ID = value; }
  35. }
  36. private NotifyMsgEnum _NOTIFY_MSG_PARAMETERS;
  37. /// <summary>
  38. ///消息参数 VARCHAR2(1000) null,
  39. /// </summary>
  40. [PropertyDisc("NOTIFY_MSG_PARAMETERS")]
  41. public NotifyMsgEnum NOTIFY_MSG_PARAMETERS
  42. {
  43. get { return _NOTIFY_MSG_PARAMETERS; }
  44. set { _NOTIFY_MSG_PARAMETERS = value; }
  45. }
  46. private string _CONTENT;
  47. /// <summary>
  48. /// 内容VARCHAR2(4000) null,
  49. /// </summary>
  50. [PropertyDisc("CONTENT")]
  51. public string CONTENT
  52. {
  53. get { return _CONTENT; }
  54. set { _CONTENT = value; }
  55. }
  56. private int _SEND_STATUS;
  57. /// <summary>
  58. /// 发送状态NUMBER(1) null,
  59. /// </summary>
  60. [PropertyDisc("SEND_STATUS")]
  61. public int SEND_STATUS
  62. {
  63. get { return _SEND_STATUS; }
  64. set { _SEND_STATUS = value; }
  65. }
  66. private long _FUNC_NO;
  67. /// <summary>
  68. /// 功能码 NUMBER(20) null,
  69. /// </summary>
  70. [PropertyDisc("FUNC_NO")]
  71. public long FUNC_NO
  72. {
  73. get { return _FUNC_NO; }
  74. set { _FUNC_NO = value; }
  75. }
  76. private long _SUB_FUNC_NO;
  77. /// <summary>
  78. /// 子功能码NUMBER(20) null,
  79. /// </summary>
  80. [PropertyDisc("SUB_FUNC_NO")]
  81. public long SUB_FUNC_NO
  82. {
  83. get { return _SUB_FUNC_NO; }
  84. set { _SUB_FUNC_NO = value; }
  85. }
  86. private DateTime _RecordTime;
  87. /// <summary>
  88. ///记录时间Date null,
  89. /// </summary>
  90. [PropertyDisc("RecordTime")]
  91. public DateTime RecordTime
  92. {
  93. get { return _RecordTime; }
  94. set { _RecordTime = value; }
  95. }
  96. private int _notify_action;
  97. /// <summary>
  98. /// 消息行为 NUMBER null,
  99. /// </summary>
  100. [PropertyDisc("Notify_action")]
  101. public int Notify_action
  102. {
  103. get { return _notify_action; }
  104. set { _notify_action = value; }
  105. }
  106. private int _receiver_type;
  107. /// <summary>
  108. /// 接收类型NUMBER null
  109. /// </summary>
  110. [PropertyDisc("Receiver_type")]
  111. public int Receiver_type
  112. {
  113. get { return _receiver_type; }
  114. set { _receiver_type = value; }
  115. }
  116. private int _ACCOUNTID;
  117. /// <summary>
  118. /// 用户ID
  119. /// </summary>
  120. [PropertyDisc("ACCOUNTID")]
  121. public int ACCOUNTID
  122. {
  123. get { return _ACCOUNTID; }
  124. set { _ACCOUNTID = value; }
  125. }
  126. public string NOTIFY_MSG_PARAMETERSDisplay
  127. {
  128. get
  129. {
  130. return NOTIFY_MSG_PARAMETERS.Discription();
  131. }
  132. }
  133. public Brush STATUSBrush
  134. {
  135. get
  136. {
  137. if (SEND_STATUS > 0)
  138. {
  139. return GetFromeResource<Brush>("List_Item_NotRead");
  140. }
  141. else
  142. {
  143. return GetFromeResource<Brush>("List_Item_IsRead");
  144. }
  145. }
  146. }
  147. internal T GetFromeResource<T>(string resourceName) where T : class
  148. {
  149. try
  150. {
  151. var brush = (T)Application.Current.TryFindResource(resourceName);
  152. if (brush == null)
  153. {
  154. return default(T);
  155. }
  156. return brush;
  157. }
  158. catch
  159. {
  160. return null;
  161. }
  162. }
  163. }
  164. }