/EQT_V2/EQT/EQT.Model/MoNotice.auto.cs

http://sgsoft-las.googlecode.com/ · C# · 250 lines · 189 code · 15 blank · 46 comment · 39 complexity · 6a54b2a52745905fe9c5ffeeb11c7696 MD5 · raw file

  1. /*----------------------------------------------------------------//
  2. // ????MoNotice.cs
  3. // ????????? MoNotice.
  4. //
  5. // ?????Template ver 5.0.20090429 2009-11-20
  6. //
  7. // ?????
  8. // ?????
  9. //----------------------------------------------------------------*/
  10. #region MoNotice
  11. using System;
  12. using System.Data;
  13. namespace EQT.Model
  14. {
  15. /// <summary>
  16. /// ????MoNotice
  17. /// </summary>
  18. public partial class MoNotice : ICloneable
  19. {
  20. #region ?Notice???
  21. private string noticeId;
  22. private string uid;
  23. private int publishType;
  24. private string noticeContent;
  25. private DateTime createTime;
  26. private string title;
  27. #endregion
  28. #region ????
  29. public MoNotice()
  30. {
  31. createTime = new DateTime(1900, 1, 1);
  32. }
  33. #endregion
  34. #region ??????
  35. public MoNotice(MoNotice item)
  36. {
  37. item.CopyTo(this);
  38. }
  39. #endregion
  40. #region ???????
  41. public MoNotice(string noticeId, string uid, int publishType, string noticeContent, DateTime createTime, string title)
  42. {
  43. this.noticeId = noticeId;
  44. this.uid = uid;
  45. this.publishType = publishType;
  46. this.noticeContent = noticeContent;
  47. this.createTime = createTime;
  48. this.title = title;
  49. }
  50. #endregion
  51. #region ?Notice?????
  52. /// <summary>
  53. ///??GUID???
  54. /// </summary>
  55. public string NoticeId
  56. {
  57. get { return noticeId; }
  58. set { noticeId = value; }
  59. }
  60. /// <summary>
  61. /// UID
  62. /// </summary>
  63. public string Uid
  64. {
  65. get { return uid; }
  66. set { uid = value; }
  67. }
  68. /// <summary>
  69. ///????2?????????
  70. /// </summary>
  71. public int PublishType
  72. {
  73. get { return publishType; }
  74. set { publishType = value; }
  75. }
  76. /// <summary>
  77. /// NOTICE_CONTENT
  78. /// </summary>
  79. public string NoticeContent
  80. {
  81. get { return noticeContent; }
  82. set { noticeContent = value; }
  83. }
  84. /// <summary>
  85. /// CREATE_TIME
  86. /// </summary>
  87. public DateTime CreateTime
  88. {
  89. get { return createTime; }
  90. set { createTime = value; }
  91. }
  92. /// <summary>
  93. /// TITLE
  94. /// </summary>
  95. public string Title
  96. {
  97. get { return title; }
  98. set { title = value; }
  99. }
  100. #endregion
  101. #region ????
  102. /// <summary>
  103. /// ????
  104. /// </summary>
  105. public MoNotice CopyTo(MoNotice item)
  106. {
  107. item.noticeId = this.noticeId;
  108. item.uid = this.uid;
  109. item.publishType = this.publishType;
  110. item.noticeContent = this.noticeContent;
  111. item.createTime = this.createTime;
  112. item.title = this.title;
  113. return item;
  114. }
  115. /// <summary>
  116. /// ????
  117. /// </summary>
  118. public object Clone()
  119. {
  120. MoNotice mo = new MoNotice();
  121. mo.NoticeId = this.NoticeId;
  122. mo.Uid = this.Uid;
  123. mo.PublishType = this.PublishType;
  124. mo.NoticeContent = this.NoticeContent;
  125. mo.CreateTime = this.CreateTime;
  126. mo.Title = this.Title;
  127. return mo;
  128. }
  129. ///<summary>
  130. ///????????
  131. ///<summary>
  132. public override bool Equals(object obj)
  133. {
  134. if (object.ReferenceEquals(this, obj))
  135. {
  136. return true;
  137. }
  138. else
  139. {
  140. MoNotice NewNotice = obj as MoNotice;
  141. if (NewNotice == null)
  142. {
  143. return false;
  144. }
  145. else
  146. {
  147. if (NewNotice.NoticeId == this.NoticeId && NewNotice.Uid == this.Uid && NewNotice.PublishType == this.PublishType && NewNotice.NoticeContent == this.NoticeContent && NewNotice.CreateTime == this.CreateTime && NewNotice.Title == this.Title)
  148. {
  149. return true;
  150. }
  151. }
  152. }
  153. return false;
  154. }
  155. ///TODO:you should modify GetHashCode by yourself.
  156. public override int GetHashCode()
  157. {
  158. return base.GetHashCode();
  159. }
  160. public override string ToString()
  161. {
  162. return String.Format(System.Globalization.CultureInfo.InvariantCulture, "NoticeId={0}/Uid={1}/PublishType={2}/NoticeContent={3}/CreateTime={4}/Title={5}", noticeId, uid, publishType, noticeContent, createTime, title);
  163. }
  164. #endregion
  165. #region DataTable Help Function
  166. ///<summary>
  167. ///DataRow???Model
  168. ///</summary>
  169. public void Row2Model(DataRow row)
  170. {
  171. if (row["Notice_ID"] != null && row["Notice_ID"] != DBNull.Value)
  172. {
  173. this.NoticeId = (string)row["Notice_ID"];
  174. }
  175. else
  176. {
  177. this.NoticeId = string.Empty;
  178. }
  179. if (row["UID"] != null && row["UID"] != DBNull.Value)
  180. {
  181. this.Uid = (string)row["UID"];
  182. }
  183. else
  184. {
  185. this.Uid = string.Empty;
  186. }
  187. if (row["Publish_Type"] != null && row["Publish_Type"] != DBNull.Value)
  188. {
  189. this.PublishType = (int)row["Publish_Type"];
  190. }
  191. else
  192. {
  193. this.PublishType = 0;
  194. }
  195. if (row["Notice_Content"] != null && row["Notice_Content"] != DBNull.Value)
  196. {
  197. this.NoticeContent = (string)row["Notice_Content"];
  198. }
  199. else
  200. {
  201. this.NoticeContent = string.Empty;
  202. }
  203. if (row["Create_Time"] != null && row["Create_Time"] != DBNull.Value)
  204. {
  205. this.CreateTime = (DateTime)row["Create_Time"];
  206. }
  207. else
  208. {
  209. this.CreateTime = DateTime.MinValue;
  210. }
  211. if (row["Title"] != null && row["Title"] != DBNull.Value)
  212. {
  213. this.Title = (string)row["Title"];
  214. }
  215. else
  216. {
  217. this.Title = string.Empty;
  218. }
  219. }
  220. ///<summary>
  221. ///Model???DataRow
  222. ///</summary>
  223. public void Model2Row(DataRow row)
  224. {
  225. row["Notice_ID"] = this.NoticeId;
  226. row["UID"] = this.Uid;
  227. row["Publish_Type"] = this.PublishType;
  228. row["Notice_Content"] = this.NoticeContent;
  229. row["Create_Time"] = this.CreateTime;
  230. row["Title"] = this.Title;
  231. }
  232. #endregion
  233. }
  234. }
  235. #endregion