PageRenderTime 27ms CodeModel.GetById 21ms app.highlight 5ms RepoModel.GetById 0ms app.codeStats 0ms

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