PageRenderTime 44ms CodeModel.GetById 31ms app.highlight 9ms RepoModel.GetById 1ms app.codeStats 0ms

/EQT_V2/EQT/EQT.Model/MoEmployee.auto.cs

http://sgsoft-las.googlecode.com/
C# | 313 lines | 243 code | 15 blank | 55 comment | 30 complexity | 07fef986e6351d81f99e1fd048b2edb7 MD5 | raw file
Possible License(s): LGPL-2.1
  1
  2/*----------------------------------------------------------------//
  3// ????MoEmployee.cs
  4// ????????? MoEmployee.
  5// 
  6// ?????Template  ver 5.0.20090429 2009-11-20
  7//
  8// ?????
  9// ?????
 10//----------------------------------------------------------------*/
 11#region MoEmployee
 12using System;
 13using System.Data;
 14namespace EQT.Model
 15{
 16	/// <summary>
 17	/// ????MoEmployee
 18	/// </summary>
 19	public partial class MoEmployee:ICloneable
 20	{
 21		#region ?Employee???
 22		private string empId;
 23		private string deptId;
 24		private string fullname;
 25		private string sexCode;
 26		private string idcard;
 27		private DateTime birthday;
 28		private string phone;
 29		private string homeAddr;
 30		private string rem;
 31		#endregion
 32		
 33		#region ????
 34		public MoEmployee()
 35		{
 36			     birthday=new DateTime(1900,1,1);     	    
 37		   
 38		}
 39		#endregion
 40		
 41		#region ??????
 42
 43		public MoEmployee(MoEmployee item)
 44		{
 45			item.CopyTo(this);
 46		}
 47		#endregion
 48		
 49		#region ???????
 50	    public MoEmployee(string empId,string deptId,string fullname,string sexCode,string idcard,DateTime birthday,string phone,string homeAddr,string rem)
 51		{
 52		this.empId=empId;
 53		this.deptId=deptId;
 54		this.fullname=fullname;
 55		this.sexCode=sexCode;
 56		this.idcard=idcard;
 57		this.birthday=birthday;
 58		this.phone=phone;
 59		this.homeAddr=homeAddr;
 60		this.rem=rem;
 61		}
 62		#endregion
 63		
 64		#region ?Employee?????
 65		/// <summary>
 66		///?????   E0001,E0002
 67		/// </summary>
 68		public string EmpId
 69		{
 70			get {return empId;}
 71			set {empId=value;}
 72		}
 73		/// <summary>
 74		/// DEPT_ID
 75		/// </summary>
 76		public string DeptId
 77		{
 78			get {return deptId;}
 79			set {deptId=value;}
 80		}
 81		/// <summary>
 82		/// FULLNAME
 83		/// </summary>
 84		public string Fullname
 85		{
 86			get {return fullname;}
 87			set {fullname=value;}
 88		}
 89		/// <summary>
 90		/// SEX_CODE
 91		/// </summary>
 92		public string SexCode
 93		{
 94			get {return sexCode;}
 95			set {sexCode=value;}
 96		}
 97		/// <summary>
 98		/// IDCARD
 99		/// </summary>
100		public string Idcard
101		{
102			get {return idcard;}
103			set {idcard=value;}
104		}
105		/// <summary>
106		/// BIRTHDAY
107		/// </summary>
108		public DateTime Birthday
109		{
110			get {return birthday;}
111			set {birthday=value;}
112		}
113		/// <summary>
114		/// PHONE
115		/// </summary>
116		public string Phone
117		{
118			get {return phone;}
119			set {phone=value;}
120		}
121		/// <summary>
122		/// HOME_ADDR
123		/// </summary>
124		public string HomeAddr
125		{
126			get {return homeAddr;}
127			set {homeAddr=value;}
128		}
129		/// <summary>
130		/// REM
131		/// </summary>
132		public string Rem
133		{
134			get {return rem;}
135			set {rem=value;}
136		}
137		#endregion
138		
139		#region ????
140		/// <summary>
141		/// ????
142		/// </summary>
143		public MoEmployee CopyTo(MoEmployee item)
144        {
145		    item.empId=this.empId;
146		    item.deptId=this.deptId;
147		    item.fullname=this.fullname;
148		    item.sexCode=this.sexCode;
149		    item.idcard=this.idcard;
150		    item.birthday=this.birthday;
151		    item.phone=this.phone;
152		    item.homeAddr=this.homeAddr;
153		    item.rem=this.rem;
154			return item;
155        }
156		/// <summary>
157		/// ????
158		/// </summary>		
159		public object Clone()
160        {
161            MoEmployee mo=new MoEmployee();
162		    mo.EmpId=this.EmpId;
163		    mo.DeptId=this.DeptId;
164		    mo.Fullname=this.Fullname;
165		    mo.SexCode=this.SexCode;
166		    mo.Idcard=this.Idcard;
167		    mo.Birthday=this.Birthday;
168		    mo.Phone=this.Phone;
169		    mo.HomeAddr=this.HomeAddr;
170		    mo.Rem=this.Rem;
171			return mo;
172		}
173				///<summary>
174		///????????
175		///<summary>
176		public override bool Equals(object obj)
177        {		 
178            if (object.ReferenceEquals(this,obj))
179            {
180                return true;
181            }
182            else
183            {
184                MoEmployee NewEmployee = obj as MoEmployee;
185                if (NewEmployee == null)
186                {
187                    return false;
188                }
189                else
190                {
191				if (NewEmployee.EmpId==this.EmpId && NewEmployee.DeptId==this.DeptId && NewEmployee.Fullname==this.Fullname && NewEmployee.SexCode==this.SexCode && NewEmployee.Idcard==this.Idcard && NewEmployee.Birthday==this.Birthday && NewEmployee.Phone==this.Phone && NewEmployee.HomeAddr==this.HomeAddr && NewEmployee.Rem==this.Rem)		
192					{
193                        return true; 
194                    }
195                }
196
197            }
198            return false;
199            
200        }
201		///TODO:you should modify GetHashCode by yourself.
202		public override int GetHashCode()
203		{
204			return base.GetHashCode();
205		} 
206
207		public override string ToString()
208        {
209		   return String.Format(System.Globalization.CultureInfo.InvariantCulture,"EmpId={0}/DeptId={1}/Fullname={2}/SexCode={3}/Idcard={4}/Birthday={5}/Phone={6}/HomeAddr={7}/Rem={8}",empId,deptId,fullname,sexCode,idcard,birthday,phone,homeAddr,rem);
210		 
211		}
212		#endregion
213		
214		
215		#region DataTable Help Function
216		///<summary>
217		///DataRow???Model
218		///</summary>
219		public void Row2Model(DataRow row)
220		{
221		    if(row["Emp_ID"]!=null && row["Emp_ID"]!=DBNull.Value)
222			{
223			    this.EmpId = (string)row["Emp_ID"];
224			}
225			else
226			{
227				this.EmpId =string.Empty;
228			}
229		    if(row["Dept_ID"]!=null && row["Dept_ID"]!=DBNull.Value)
230			{
231			    this.DeptId = (string)row["Dept_ID"];
232			}
233			else
234			{
235				this.DeptId =string.Empty;
236			}
237		    if(row["FullName"]!=null && row["FullName"]!=DBNull.Value)
238			{
239			    this.Fullname = (string)row["FullName"];
240			}
241			else
242			{
243				this.Fullname =string.Empty;
244			}
245		    if(row["Sex_Code"]!=null && row["Sex_Code"]!=DBNull.Value)
246			{
247			    this.SexCode = (string)row["Sex_Code"];
248			}
249			else
250			{
251				this.SexCode =string.Empty;
252			}
253		    if(row["IDCard"]!=null && row["IDCard"]!=DBNull.Value)
254			{
255			    this.Idcard = (string)row["IDCard"];
256			}
257			else
258			{
259				this.Idcard =string.Empty;
260			}
261		    if(row["BirthDay"]!=null && row["BirthDay"]!=DBNull.Value)
262			{
263			    this.Birthday = (DateTime)row["BirthDay"];
264			}
265			else
266			{
267				this.Birthday =DateTime.MinValue;
268			}
269		    if(row["Phone"]!=null && row["Phone"]!=DBNull.Value)
270			{
271			    this.Phone = (string)row["Phone"];
272			}
273			else
274			{
275				this.Phone =string.Empty;
276			}
277		    if(row["Home_Addr"]!=null && row["Home_Addr"]!=DBNull.Value)
278			{
279			    this.HomeAddr = (string)row["Home_Addr"];
280			}
281			else
282			{
283				this.HomeAddr =string.Empty;
284			}
285		    if(row["Rem"]!=null && row["Rem"]!=DBNull.Value)
286			{
287			    this.Rem = (string)row["Rem"];
288			}
289			else
290			{
291				this.Rem =string.Empty;
292			}
293		}
294		
295		///<summary>
296		///Model???DataRow
297		///</summary>
298	??public void Model2Row(DataRow row)
299		{
300			row["Emp_ID"] = this.EmpId;
301			row["Dept_ID"] = this.DeptId;
302			row["FullName"] = this.Fullname;
303			row["Sex_Code"] = this.SexCode;
304			row["IDCard"] = this.Idcard;
305			row["BirthDay"] = this.Birthday;
306			row["Phone"] = this.Phone;
307			row["Home_Addr"] = this.HomeAddr;
308			row["Rem"] = this.Rem;
309		}
310		#endregion
311	}
312}
313#endregion