/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
- /*----------------------------------------------------------------//
- // ????MoEmployee.cs
- // ????????? MoEmployee.
- //
- // ?????Template ver 5.0.20090429 2009-11-20
- //
- // ?????
- // ?????
- //----------------------------------------------------------------*/
- #region MoEmployee
- using System;
- using System.Data;
- namespace EQT.Model
- {
- /// <summary>
- /// ????MoEmployee
- /// </summary>
- public partial class MoEmployee:ICloneable
- {
- #region ?Employee???
- private string empId;
- private string deptId;
- private string fullname;
- private string sexCode;
- private string idcard;
- private DateTime birthday;
- private string phone;
- private string homeAddr;
- private string rem;
- #endregion
-
- #region ????
- public MoEmployee()
- {
- birthday=new DateTime(1900,1,1);
-
- }
- #endregion
-
- #region ??????
-
- public MoEmployee(MoEmployee item)
- {
- item.CopyTo(this);
- }
- #endregion
-
- #region ???????
- public MoEmployee(string empId,string deptId,string fullname,string sexCode,string idcard,DateTime birthday,string phone,string homeAddr,string rem)
- {
- this.empId=empId;
- this.deptId=deptId;
- this.fullname=fullname;
- this.sexCode=sexCode;
- this.idcard=idcard;
- this.birthday=birthday;
- this.phone=phone;
- this.homeAddr=homeAddr;
- this.rem=rem;
- }
- #endregion
-
- #region ?Employee?????
- /// <summary>
- ///????? E0001,E0002
- /// </summary>
- public string EmpId
- {
- get {return empId;}
- set {empId=value;}
- }
- /// <summary>
- /// DEPT_ID
- /// </summary>
- public string DeptId
- {
- get {return deptId;}
- set {deptId=value;}
- }
- /// <summary>
- /// FULLNAME
- /// </summary>
- public string Fullname
- {
- get {return fullname;}
- set {fullname=value;}
- }
- /// <summary>
- /// SEX_CODE
- /// </summary>
- public string SexCode
- {
- get {return sexCode;}
- set {sexCode=value;}
- }
- /// <summary>
- /// IDCARD
- /// </summary>
- public string Idcard
- {
- get {return idcard;}
- set {idcard=value;}
- }
- /// <summary>
- /// BIRTHDAY
- /// </summary>
- public DateTime Birthday
- {
- get {return birthday;}
- set {birthday=value;}
- }
- /// <summary>
- /// PHONE
- /// </summary>
- public string Phone
- {
- get {return phone;}
- set {phone=value;}
- }
- /// <summary>
- /// HOME_ADDR
- /// </summary>
- public string HomeAddr
- {
- get {return homeAddr;}
- set {homeAddr=value;}
- }
- /// <summary>
- /// REM
- /// </summary>
- public string Rem
- {
- get {return rem;}
- set {rem=value;}
- }
- #endregion
-
- #region ????
- /// <summary>
- /// ????
- /// </summary>
- public MoEmployee CopyTo(MoEmployee item)
- {
- item.empId=this.empId;
- item.deptId=this.deptId;
- item.fullname=this.fullname;
- item.sexCode=this.sexCode;
- item.idcard=this.idcard;
- item.birthday=this.birthday;
- item.phone=this.phone;
- item.homeAddr=this.homeAddr;
- item.rem=this.rem;
- return item;
- }
- /// <summary>
- /// ????
- /// </summary>
- public object Clone()
- {
- MoEmployee mo=new MoEmployee();
- mo.EmpId=this.EmpId;
- mo.DeptId=this.DeptId;
- mo.Fullname=this.Fullname;
- mo.SexCode=this.SexCode;
- mo.Idcard=this.Idcard;
- mo.Birthday=this.Birthday;
- mo.Phone=this.Phone;
- mo.HomeAddr=this.HomeAddr;
- mo.Rem=this.Rem;
- return mo;
- }
- ///<summary>
- ///????????
- ///<summary>
- public override bool Equals(object obj)
- {
- if (object.ReferenceEquals(this,obj))
- {
- return true;
- }
- else
- {
- MoEmployee NewEmployee = obj as MoEmployee;
- if (NewEmployee == null)
- {
- return false;
- }
- else
- {
- 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)
- {
- return true;
- }
- }
-
- }
- return false;
-
- }
- ///TODO:you should modify GetHashCode by yourself.
- public override int GetHashCode()
- {
- return base.GetHashCode();
- }
-
- public override string ToString()
- {
- 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);
-
- }
- #endregion
-
-
- #region DataTable Help Function
- ///<summary>
- ///DataRow???Model
- ///</summary>
- public void Row2Model(DataRow row)
- {
- if(row["Emp_ID"]!=null && row["Emp_ID"]!=DBNull.Value)
- {
- this.EmpId = (string)row["Emp_ID"];
- }
- else
- {
- this.EmpId =string.Empty;
- }
- if(row["Dept_ID"]!=null && row["Dept_ID"]!=DBNull.Value)
- {
- this.DeptId = (string)row["Dept_ID"];
- }
- else
- {
- this.DeptId =string.Empty;
- }
- if(row["FullName"]!=null && row["FullName"]!=DBNull.Value)
- {
- this.Fullname = (string)row["FullName"];
- }
- else
- {
- this.Fullname =string.Empty;
- }
- if(row["Sex_Code"]!=null && row["Sex_Code"]!=DBNull.Value)
- {
- this.SexCode = (string)row["Sex_Code"];
- }
- else
- {
- this.SexCode =string.Empty;
- }
- if(row["IDCard"]!=null && row["IDCard"]!=DBNull.Value)
- {
- this.Idcard = (string)row["IDCard"];
- }
- else
- {
- this.Idcard =string.Empty;
- }
- if(row["BirthDay"]!=null && row["BirthDay"]!=DBNull.Value)
- {
- this.Birthday = (DateTime)row["BirthDay"];
- }
- else
- {
- this.Birthday =DateTime.MinValue;
- }
- if(row["Phone"]!=null && row["Phone"]!=DBNull.Value)
- {
- this.Phone = (string)row["Phone"];
- }
- else
- {
- this.Phone =string.Empty;
- }
- if(row["Home_Addr"]!=null && row["Home_Addr"]!=DBNull.Value)
- {
- this.HomeAddr = (string)row["Home_Addr"];
- }
- else
- {
- this.HomeAddr =string.Empty;
- }
- if(row["Rem"]!=null && row["Rem"]!=DBNull.Value)
- {
- this.Rem = (string)row["Rem"];
- }
- else
- {
- this.Rem =string.Empty;
- }
- }
-
- ///<summary>
- ///Model???DataRow
- ///</summary>
- ??public void Model2Row(DataRow row)
- {
- row["Emp_ID"] = this.EmpId;
- row["Dept_ID"] = this.DeptId;
- row["FullName"] = this.Fullname;
- row["Sex_Code"] = this.SexCode;
- row["IDCard"] = this.Idcard;
- row["BirthDay"] = this.Birthday;
- row["Phone"] = this.Phone;
- row["Home_Addr"] = this.HomeAddr;
- row["Rem"] = this.Rem;
- }
- #endregion
- }
- }
- #endregion