PageRenderTime 29ms CodeModel.GetById 20ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

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