/EQT_V1/EQT.Model/MoTester.auto.cs

http://sgsoft-las.googlecode.com/ · C# · 223 lines · 164 code · 19 blank · 40 comment · 15 complexity · fba95acaa99032276580954e2e3ae58a MD5 · raw file

  1. /*----------------------------------------------------------------//
  2. // ????MoTester.cs
  3. // ????????? MoTester.
  4. //
  5. // ?????2009-02-27
  6. //
  7. // ?????
  8. // ?????
  9. //----------------------------------------------------------------*/
  10. #region MoTester
  11. using System;
  12. using System.Data;
  13. using System.Globalization;
  14. using System.Text;
  15. using System.Xml;
  16. using System.Data.Common;
  17. namespace EQT.Model
  18. {
  19. /// <summary>
  20. /// ????MoTester
  21. /// </summary>
  22. public partial class MoTester:ICloneable
  23. {
  24. #region ?Tester???
  25. private string _co_item_id;
  26. private string _emp_id;
  27. private string _duty_code;
  28. private decimal _duty_weight;
  29. #endregion
  30. #region ????
  31. public MoTester()
  32. {
  33. }
  34. #endregion
  35. #region ??????
  36. public MoTester(MoTester item)
  37. {
  38. item.CopyTo(this);
  39. }
  40. #endregion
  41. #region ???????
  42. public MoTester(string co_item_id,string emp_id,string duty_code,decimal duty_weight)
  43. {
  44. this._co_item_id=co_item_id;
  45. this._emp_id=emp_id;
  46. this._duty_code=duty_code;
  47. this._duty_weight=duty_weight;
  48. }
  49. #endregion
  50. #region ?Tester?????
  51. /// <summary>
  52. /// CO_ITEM_ID
  53. /// </summary>
  54. public string Co_Item_Id
  55. {
  56. get {return _co_item_id;}
  57. set {_co_item_id=value;}
  58. }
  59. /// <summary>
  60. ///??????????????????????E0001,E0002
  61. /// </summary>
  62. public string Emp_Id
  63. {
  64. get {return _emp_id;}
  65. set {_emp_id=value;}
  66. }
  67. /// <summary>
  68. /// DUTY_CODE
  69. /// </summary>
  70. public string Duty_Code
  71. {
  72. get {return _duty_code;}
  73. set {_duty_code=value;}
  74. }
  75. /// <summary>
  76. ///
  77. /// </summary>
  78. public decimal Duty_Weight
  79. {
  80. get {return _duty_weight;}
  81. set {_duty_weight=value;}
  82. }
  83. #endregion
  84. #region ????
  85. /// <summary>
  86. /// ????
  87. /// </summary>
  88. public MoTester CopyTo(MoTester item)
  89. {
  90. item.Co_Item_Id=this.Co_Item_Id;
  91. item.Emp_Id=this.Emp_Id;
  92. item.Duty_Code=this.Duty_Code;
  93. item.Duty_Weight=this.Duty_Weight;
  94. return item;
  95. }
  96. /// <summary>
  97. /// ????
  98. /// </summary>
  99. public object Clone()
  100. {
  101. MoTester NewTester=new MoTester();
  102. NewTester._co_item_id=this._co_item_id;
  103. NewTester._emp_id=this._emp_id;
  104. NewTester._duty_code=this._duty_code;
  105. NewTester._duty_weight=this._duty_weight;
  106. return NewTester;
  107. }
  108. private static MoTester _empty = new MoTester(string.Empty,string.Empty,string.Empty,0);
  109. public static MoTester Empty
  110. {
  111. get
  112. {
  113. return _empty;
  114. }
  115. }
  116. ///<summary>
  117. ///????????
  118. ///<summary>
  119. public override bool Equals(object obj)
  120. {
  121. if (base.Equals(obj))
  122. {
  123. return true;
  124. }
  125. else
  126. {
  127. MoTester NewTester = obj as MoTester;
  128. if (NewTester == null)
  129. {
  130. return false;
  131. }
  132. else
  133. {
  134. if (NewTester.Co_Item_Id==this.Co_Item_Id && NewTester.Emp_Id==this.Emp_Id && NewTester.Duty_Code==this.Duty_Code && NewTester.Duty_Weight==this.Duty_Weight)
  135. {
  136. return true;
  137. }
  138. }
  139. }
  140. return false;
  141. }
  142. ///TODO:you should modify GetHashCode by yourself.
  143. public override int GetHashCode()
  144. {
  145. return base.GetHashCode();
  146. }
  147. public override string ToString()
  148. {
  149. return String.Format("Co_Item_Id={0}/Emp_Id={1}/Duty_Code={2}/Duty_Weight={3}",_co_item_id,_emp_id,_duty_code,_duty_weight);
  150. }
  151. #endregion
  152. #region DataTable Help Function
  153. ///<summary>
  154. ///DataRow???Model
  155. ///</summary>
  156. public void Row2Model(DataRow row)
  157. {
  158. if(row["Co_Item_ID"]!=null && row["Co_Item_ID"]!=DBNull.Value)
  159. {
  160. this.Co_Item_Id = (string)row["Co_Item_ID"];
  161. }
  162. else
  163. {
  164. this.Co_Item_Id =string.Empty;
  165. }
  166. if(row["Emp_ID"]!=null && row["Emp_ID"]!=DBNull.Value)
  167. {
  168. this.Emp_Id = (string)row["Emp_ID"];
  169. }
  170. else
  171. {
  172. this.Emp_Id =string.Empty;
  173. }
  174. if(row["Duty_Code"]!=null && row["Duty_Code"]!=DBNull.Value)
  175. {
  176. this.Duty_Code = (string)row["Duty_Code"];
  177. }
  178. else
  179. {
  180. this.Duty_Code =string.Empty;
  181. }
  182. if(row["Duty_Weight"]!=null && row["Duty_Weight"]!=DBNull.Value)
  183. {
  184. this.Duty_Weight = (decimal)row["Duty_Weight"];
  185. }
  186. else
  187. {
  188. this.Duty_Weight =0;
  189. }
  190. }
  191. ///<summary>
  192. ///Model???DataRow
  193. ///</summary>
  194. ??public void Model2Row(DataRow row)
  195. {
  196. row["Co_Item_ID"] = this.Co_Item_Id;
  197. row["Emp_ID"] = this.Emp_Id;
  198. row["Duty_Code"] = this.Duty_Code;
  199. row["Duty_Weight"] = this.Duty_Weight;
  200. }
  201. #endregion
  202. }
  203. }
  204. #endregion