/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

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