PageRenderTime 60ms CodeModel.GetById 20ms app.highlight 35ms RepoModel.GetById 0ms app.codeStats 0ms

/Las/Las.Dal/DaUsers.auto.cs

http://sgsoft-las.googlecode.com/
C# | 760 lines | 679 code | 60 blank | 21 comment | 46 complexity | 57106dac99b1a442a9644d2cd4e6f6c5 MD5 | raw file
Possible License(s): LGPL-2.1
  1#region DaUsers
  2/*----------------------------------------------------------------
  3// ????DaUsers.cs
  4// ??????Users??????
  5//
  6// 
  7// ?????2009-07-19 DtataAccess template . Ver 5.0.20090413
  8//
  9// ????? 
 10// ????? 
 11//----------------------------------------------------------------*/
 12using System;
 13using System.Collections;
 14using System.Collections.Generic;
 15using System.Collections.ObjectModel;
 16using System.Data;
 17using System.Globalization;
 18using System.Text;
 19using System.Data.Common;
 20using Microsoft.Practices.EnterpriseLibrary.Data;
 21using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
 22
 23using Las.Model; 
 24
 25
 26namespace Las.Dal
 27{
 28	///?????????,IUsers ,???????DaBase?
 29	///DaBase????DbException????????
 30    public	partial  class DaUsers:DaBase<MoUsers>
 31    {	 
 32		#region SQL const
 33		internal const string TABLE_COLUMNS=" USEQ ,LOGIN_NAME ,USER_CODE ,ARM_TYPE ,SPECIALTY_PHASE ,BRANCH_ID ,PERSON_ID ,PERSON_NAME ,SEX_ID ,FORK_ID ,BIRTHDAY ,ENROLL_DATE ,BIRTHPLACE ,FAM_ORI_ID ,PERSON_ING_ID ,POLITY_MEMBER_ID ,CURRENTPOST_ID ,CURRENTPOSTTIME ,FIRSTDEGREE_ID ,SCHOOLSPECIAL ,CURRENTDEGREE_ID ,STRONG_SUIT ,DEGREE_ID ,TYPICAL_LEVEL ,IDENTITY_TYPE_ID ,READINESS_ID ,GRADUATEFROM ,TRAIN_INFO ,TRAIN_SCORE ,TRAIN_EVA ,ABILITY_EVA ,GOODTEACHER ,PAPER ,PARTYATTENDED ,PERSONLIB ,AWARDORPUNISH ,RESUME ,PHOTO ,USER_ID ,USER_PWD ,FULL_NAME ,POSTTYPE ,ZCBM ,ZGSF ,ENABLED ,STATE   ";
 34		
 35		internal const string SQL_INSERT="INSERT INTO MT_USERS ("+TABLE_COLUMNS+") VALUES (@Useq,@LoginName,@UserCode,@ArmType,@SpecialtyPhase,@BranchId,@PersonId,@PersonName,@SexId,@ForkId,@Birthday,@EnrollDate,@Birthplace,@FamOriId,@PersonIngId,@PolityMemberId,@CurrentpostId,@Currentposttime,@FirstdegreeId,@Schoolspecial,@CurrentdegreeId,@StrongSuit,@DegreeId,@TypicalLevel,@IdentityTypeId,@ReadinessId,@Graduatefrom,@TrainInfo,@TrainScore,@TrainEva,@AbilityEva,@Goodteacher,@Paper,@Partyattended,@Personlib,@Awardorpunish,@Resume,@Photo,@UserId,@UserPwd,@FullName,@Posttype,@Zcbm,@Zgsf,@Enabled,@State)";
 36		internal const string SQL_SELECT="SELECT "+TABLE_COLUMNS+" FROM MT_USERS  ";
 37		internal const string SQL_SELECT_ONE=SQL_SELECT+" WHERE USER_ID=@UserId";                              
 38		
 39		internal const string SQL_EXIST="SELECT COUNT(*) FROM MT_USERS  WHERE USER_ID=@UserId  ";
 40		internal const string SQL_UPDATE="UPDATE MT_USERS SET USEQ=@Useq, LOGIN_NAME=@LoginName, USER_CODE=@UserCode, ARM_TYPE=@ArmType, SPECIALTY_PHASE=@SpecialtyPhase, BRANCH_ID=@BranchId, PERSON_ID=@PersonId, PERSON_NAME=@PersonName, SEX_ID=@SexId, FORK_ID=@ForkId, BIRTHDAY=@Birthday, ENROLL_DATE=@EnrollDate, BIRTHPLACE=@Birthplace, FAM_ORI_ID=@FamOriId, PERSON_ING_ID=@PersonIngId, POLITY_MEMBER_ID=@PolityMemberId, CURRENTPOST_ID=@CurrentpostId, CURRENTPOSTTIME=@Currentposttime, FIRSTDEGREE_ID=@FirstdegreeId, SCHOOLSPECIAL=@Schoolspecial, CURRENTDEGREE_ID=@CurrentdegreeId, STRONG_SUIT=@StrongSuit, DEGREE_ID=@DegreeId, TYPICAL_LEVEL=@TypicalLevel, IDENTITY_TYPE_ID=@IdentityTypeId, READINESS_ID=@ReadinessId, GRADUATEFROM=@Graduatefrom, TRAIN_INFO=@TrainInfo, TRAIN_SCORE=@TrainScore, TRAIN_EVA=@TrainEva, ABILITY_EVA=@AbilityEva, GOODTEACHER=@Goodteacher, PAPER=@Paper, PARTYATTENDED=@Partyattended, PERSONLIB=@Personlib, AWARDORPUNISH=@Awardorpunish, RESUME=@Resume, PHOTO=@Photo, USER_PWD=@UserPwd, FULL_NAME=@FullName, POSTTYPE=@Posttype, ZCBM=@Zcbm, ZGSF=@Zgsf, ENABLED=@Enabled, STATE=@State WHERE USER_ID=@UserId";
 41		
 42		internal const string SQL_DELETE_DEFAULT = "DELETE FROM MT_USERS ";
 43		internal const string SQL_DELETE="DELETE FROM MT_USERS WHERE USER_ID=@UserId";
 44		
 45		internal const string SQL_COUNT="SELECT COUNT(*) FROM mt_users ";
 46		#endregion
 47		       
 48		#region Constructor
 49	 
 50		/// <summary>
 51        /// ???????????????????????
 52        /// </summary>
 53		public DaUsers ()
 54		{ 
 55			this.db=DatabaseFactory.CreateDatabase();
 56		}
 57		/// <summary>
 58        /// ?????databaseName??????
 59        /// </summary>
 60        /// <param name="databaseName">??????????????</param>
 61		public DaUsers (string databaseName)
 62		{ 
 63            this.db = DatabaseFactory.CreateDatabase(databaseName);
 64		} 
 65		
 66		public DaUsers (Database db)
 67		{ 
 68            this.db = db;
 69		} 
 70		
 71		#endregion
 72		
 73		//???CRUD??????????????????
 74
 75		#region ?????
 76		
 77        protected override MoUsers ConstructT()
 78        {
 79            return new MoUsers();
 80        }
 81        #endregion
 82		
 83	    
 84		
 85		#region Add?? Helper
 86		
 87		///build the command object.It never throw exception.
 88		protected override  DbCommand ConstructAddCommand(Database db)
 89		{
 90			DbCommand dbCommand = db.GetSqlStringCommand(SQL_INSERT);
 91			 
 92			db.AddInParameter(dbCommand,"Useq",DbType.Int32);
 93			db.AddInParameter(dbCommand,"LoginName",DbType.AnsiString);
 94			db.AddInParameter(dbCommand,"UserCode",DbType.AnsiString);
 95			db.AddInParameter(dbCommand,"ArmType",DbType.AnsiString);
 96			db.AddInParameter(dbCommand,"SpecialtyPhase",DbType.AnsiString);
 97			db.AddInParameter(dbCommand,"BranchId",DbType.AnsiString);
 98			db.AddInParameter(dbCommand,"PersonId",DbType.AnsiString);
 99			db.AddInParameter(dbCommand,"PersonName",DbType.AnsiString);
100			db.AddInParameter(dbCommand,"SexId",DbType.AnsiString);
101			db.AddInParameter(dbCommand,"ForkId",DbType.AnsiString);
102			db.AddInParameter(dbCommand,"Birthday",DbType.DateTime);
103			db.AddInParameter(dbCommand,"EnrollDate",DbType.DateTime);
104			db.AddInParameter(dbCommand,"Birthplace",DbType.AnsiString);
105			db.AddInParameter(dbCommand,"FamOriId",DbType.AnsiString);
106			db.AddInParameter(dbCommand,"PersonIngId",DbType.AnsiString);
107			db.AddInParameter(dbCommand,"PolityMemberId",DbType.AnsiString);
108			db.AddInParameter(dbCommand,"CurrentpostId",DbType.AnsiString);
109			db.AddInParameter(dbCommand,"Currentposttime",DbType.AnsiString);
110			db.AddInParameter(dbCommand,"FirstdegreeId",DbType.AnsiString);
111			db.AddInParameter(dbCommand,"Schoolspecial",DbType.AnsiString);
112			db.AddInParameter(dbCommand,"CurrentdegreeId",DbType.AnsiString);
113			db.AddInParameter(dbCommand,"StrongSuit",DbType.AnsiString);
114			db.AddInParameter(dbCommand,"DegreeId",DbType.AnsiString);
115			db.AddInParameter(dbCommand,"TypicalLevel",DbType.AnsiString);
116			db.AddInParameter(dbCommand,"IdentityTypeId",DbType.AnsiString);
117			db.AddInParameter(dbCommand,"ReadinessId",DbType.AnsiString);
118			db.AddInParameter(dbCommand,"Graduatefrom",DbType.AnsiString);
119			db.AddInParameter(dbCommand,"TrainInfo",DbType.AnsiString);
120			db.AddInParameter(dbCommand,"TrainScore",DbType.AnsiString);
121			db.AddInParameter(dbCommand,"TrainEva",DbType.AnsiString);
122			db.AddInParameter(dbCommand,"AbilityEva",DbType.AnsiString);
123			db.AddInParameter(dbCommand,"Goodteacher",DbType.AnsiString);
124			db.AddInParameter(dbCommand,"Paper",DbType.AnsiString);
125			db.AddInParameter(dbCommand,"Partyattended",DbType.AnsiString);
126			db.AddInParameter(dbCommand,"Personlib",DbType.AnsiString);
127			db.AddInParameter(dbCommand,"Awardorpunish",DbType.AnsiString);
128			db.AddInParameter(dbCommand,"Resume",DbType.AnsiString);
129			db.AddInParameter(dbCommand,"Photo",DbType.AnsiString);
130			db.AddInParameter(dbCommand,"UserId",DbType.AnsiString);
131			db.AddInParameter(dbCommand,"UserPwd",DbType.AnsiString);
132			db.AddInParameter(dbCommand,"FullName",DbType.AnsiString);
133			db.AddInParameter(dbCommand,"Posttype",DbType.AnsiString);
134			db.AddInParameter(dbCommand,"Zcbm",DbType.AnsiString);
135			db.AddInParameter(dbCommand,"Zgsf",DbType.AnsiString);
136			db.AddInParameter(dbCommand,"Enabled",DbType.AnsiString);
137			db.AddInParameter(dbCommand,"State",DbType.Int32);
138			return dbCommand;
139		}		
140		protected override DbCommand ConstructAddCommand(Database db,MoUsers entity)
141		{
142			DbCommand dbCommand=db.GetSqlStringCommand(SQL_INSERT);			 
143			db.AddInParameter(dbCommand,"Useq",DbType.Int32,entity.Useq);
144			db.AddInParameter(dbCommand,"LoginName",DbType.AnsiString,entity.LoginName);
145			db.AddInParameter(dbCommand,"UserCode",DbType.AnsiString,entity.UserCode);
146			db.AddInParameter(dbCommand,"ArmType",DbType.AnsiString,entity.ArmType);
147			db.AddInParameter(dbCommand,"SpecialtyPhase",DbType.AnsiString,entity.SpecialtyPhase);
148			db.AddInParameter(dbCommand,"BranchId",DbType.AnsiString,entity.BranchId);
149			db.AddInParameter(dbCommand,"PersonId",DbType.AnsiString,entity.PersonId);
150			db.AddInParameter(dbCommand,"PersonName",DbType.AnsiString,entity.PersonName);
151			db.AddInParameter(dbCommand,"SexId",DbType.AnsiString,entity.SexId);
152			db.AddInParameter(dbCommand,"ForkId",DbType.AnsiString,entity.ForkId);
153			db.AddInParameter(dbCommand,"Birthday",DbType.DateTime,entity.Birthday);
154			db.AddInParameter(dbCommand,"EnrollDate",DbType.DateTime,entity.EnrollDate);
155			db.AddInParameter(dbCommand,"Birthplace",DbType.AnsiString,entity.Birthplace);
156			db.AddInParameter(dbCommand,"FamOriId",DbType.AnsiString,entity.FamOriId);
157			db.AddInParameter(dbCommand,"PersonIngId",DbType.AnsiString,entity.PersonIngId);
158			db.AddInParameter(dbCommand,"PolityMemberId",DbType.AnsiString,entity.PolityMemberId);
159			db.AddInParameter(dbCommand,"CurrentpostId",DbType.AnsiString,entity.CurrentpostId);
160			db.AddInParameter(dbCommand,"Currentposttime",DbType.AnsiString,entity.Currentposttime);
161			db.AddInParameter(dbCommand,"FirstdegreeId",DbType.AnsiString,entity.FirstdegreeId);
162			db.AddInParameter(dbCommand,"Schoolspecial",DbType.AnsiString,entity.Schoolspecial);
163			db.AddInParameter(dbCommand,"CurrentdegreeId",DbType.AnsiString,entity.CurrentdegreeId);
164			db.AddInParameter(dbCommand,"StrongSuit",DbType.AnsiString,entity.StrongSuit);
165			db.AddInParameter(dbCommand,"DegreeId",DbType.AnsiString,entity.DegreeId);
166			db.AddInParameter(dbCommand,"TypicalLevel",DbType.AnsiString,entity.TypicalLevel);
167			db.AddInParameter(dbCommand,"IdentityTypeId",DbType.AnsiString,entity.IdentityTypeId);
168			db.AddInParameter(dbCommand,"ReadinessId",DbType.AnsiString,entity.ReadinessId);
169			db.AddInParameter(dbCommand,"Graduatefrom",DbType.AnsiString,entity.Graduatefrom);
170			db.AddInParameter(dbCommand,"TrainInfo",DbType.AnsiString,entity.TrainInfo);
171			db.AddInParameter(dbCommand,"TrainScore",DbType.AnsiString,entity.TrainScore);
172			db.AddInParameter(dbCommand,"TrainEva",DbType.AnsiString,entity.TrainEva);
173			db.AddInParameter(dbCommand,"AbilityEva",DbType.AnsiString,entity.AbilityEva);
174			db.AddInParameter(dbCommand,"Goodteacher",DbType.AnsiString,entity.Goodteacher);
175			db.AddInParameter(dbCommand,"Paper",DbType.AnsiString,entity.Paper);
176			db.AddInParameter(dbCommand,"Partyattended",DbType.AnsiString,entity.Partyattended);
177			db.AddInParameter(dbCommand,"Personlib",DbType.AnsiString,entity.Personlib);
178			db.AddInParameter(dbCommand,"Awardorpunish",DbType.AnsiString,entity.Awardorpunish);
179			db.AddInParameter(dbCommand,"Resume",DbType.AnsiString,entity.Resume);
180			db.AddInParameter(dbCommand,"Photo",DbType.AnsiString,entity.Photo);
181			db.AddInParameter(dbCommand,"UserId",DbType.AnsiString,entity.UserId);
182			db.AddInParameter(dbCommand,"UserPwd",DbType.AnsiString,entity.UserPwd);
183			db.AddInParameter(dbCommand,"FullName",DbType.AnsiString,entity.FullName);
184			db.AddInParameter(dbCommand,"Posttype",DbType.AnsiString,entity.Posttype);
185			db.AddInParameter(dbCommand,"Zcbm",DbType.AnsiString,entity.Zcbm);
186			db.AddInParameter(dbCommand,"Zgsf",DbType.AnsiString,entity.Zgsf);
187			db.AddInParameter(dbCommand,"Enabled",DbType.AnsiString,entity.Enabled);
188			db.AddInParameter(dbCommand,"State",DbType.Int32,entity.State);
189			return dbCommand;
190		}
191		
192		protected override DbCommand PopulateAddCommandParameters(Database db,DbCommand addCmd,MoUsers entity)
193		{
194			db.SetParameterValue(addCmd,"Useq",entity.Useq);
195			db.SetParameterValue(addCmd,"LoginName",entity.LoginName);
196			db.SetParameterValue(addCmd,"UserCode",entity.UserCode);
197			db.SetParameterValue(addCmd,"ArmType",entity.ArmType);
198			db.SetParameterValue(addCmd,"SpecialtyPhase",entity.SpecialtyPhase);
199			db.SetParameterValue(addCmd,"BranchId",entity.BranchId);
200			db.SetParameterValue(addCmd,"PersonId",entity.PersonId);
201			db.SetParameterValue(addCmd,"PersonName",entity.PersonName);
202			db.SetParameterValue(addCmd,"SexId",entity.SexId);
203			db.SetParameterValue(addCmd,"ForkId",entity.ForkId);
204			db.SetParameterValue(addCmd,"Birthday",entity.Birthday);
205			db.SetParameterValue(addCmd,"EnrollDate",entity.EnrollDate);
206			db.SetParameterValue(addCmd,"Birthplace",entity.Birthplace);
207			db.SetParameterValue(addCmd,"FamOriId",entity.FamOriId);
208			db.SetParameterValue(addCmd,"PersonIngId",entity.PersonIngId);
209			db.SetParameterValue(addCmd,"PolityMemberId",entity.PolityMemberId);
210			db.SetParameterValue(addCmd,"CurrentpostId",entity.CurrentpostId);
211			db.SetParameterValue(addCmd,"Currentposttime",entity.Currentposttime);
212			db.SetParameterValue(addCmd,"FirstdegreeId",entity.FirstdegreeId);
213			db.SetParameterValue(addCmd,"Schoolspecial",entity.Schoolspecial);
214			db.SetParameterValue(addCmd,"CurrentdegreeId",entity.CurrentdegreeId);
215			db.SetParameterValue(addCmd,"StrongSuit",entity.StrongSuit);
216			db.SetParameterValue(addCmd,"DegreeId",entity.DegreeId);
217			db.SetParameterValue(addCmd,"TypicalLevel",entity.TypicalLevel);
218			db.SetParameterValue(addCmd,"IdentityTypeId",entity.IdentityTypeId);
219			db.SetParameterValue(addCmd,"ReadinessId",entity.ReadinessId);
220			db.SetParameterValue(addCmd,"Graduatefrom",entity.Graduatefrom);
221			db.SetParameterValue(addCmd,"TrainInfo",entity.TrainInfo);
222			db.SetParameterValue(addCmd,"TrainScore",entity.TrainScore);
223			db.SetParameterValue(addCmd,"TrainEva",entity.TrainEva);
224			db.SetParameterValue(addCmd,"AbilityEva",entity.AbilityEva);
225			db.SetParameterValue(addCmd,"Goodteacher",entity.Goodteacher);
226			db.SetParameterValue(addCmd,"Paper",entity.Paper);
227			db.SetParameterValue(addCmd,"Partyattended",entity.Partyattended);
228			db.SetParameterValue(addCmd,"Personlib",entity.Personlib);
229			db.SetParameterValue(addCmd,"Awardorpunish",entity.Awardorpunish);
230			db.SetParameterValue(addCmd,"Resume",entity.Resume);
231			db.SetParameterValue(addCmd,"Photo",entity.Photo);
232			db.SetParameterValue(addCmd,"UserId",entity.UserId);
233			db.SetParameterValue(addCmd,"UserPwd",entity.UserPwd);
234			db.SetParameterValue(addCmd,"FullName",entity.FullName);
235			db.SetParameterValue(addCmd,"Posttype",entity.Posttype);
236			db.SetParameterValue(addCmd,"Zcbm",entity.Zcbm);
237			db.SetParameterValue(addCmd,"Zgsf",entity.Zgsf);
238			db.SetParameterValue(addCmd,"Enabled",entity.Enabled);
239			db.SetParameterValue(addCmd,"State",entity.State);
240			return addCmd;
241		}
242		
243		protected override DbCommand PopulateAddCommandParameters(Database db,DbCommand addCmd,DataRow row)
244		{
245			db.SetParameterValue(addCmd,"Useq",row["Useq"]);
246			db.SetParameterValue(addCmd,"LoginName",row["LoginName"]);
247			db.SetParameterValue(addCmd,"UserCode",row["UserCode"]);
248			db.SetParameterValue(addCmd,"ArmType",row["ArmType"]);
249			db.SetParameterValue(addCmd,"SpecialtyPhase",row["SpecialtyPhase"]);
250			db.SetParameterValue(addCmd,"BranchId",row["BranchId"]);
251			db.SetParameterValue(addCmd,"PersonId",row["PersonId"]);
252			db.SetParameterValue(addCmd,"PersonName",row["PersonName"]);
253			db.SetParameterValue(addCmd,"SexId",row["SexId"]);
254			db.SetParameterValue(addCmd,"ForkId",row["ForkId"]);
255			db.SetParameterValue(addCmd,"Birthday",row["Birthday"]);
256			db.SetParameterValue(addCmd,"EnrollDate",row["EnrollDate"]);
257			db.SetParameterValue(addCmd,"Birthplace",row["Birthplace"]);
258			db.SetParameterValue(addCmd,"FamOriId",row["FamOriId"]);
259			db.SetParameterValue(addCmd,"PersonIngId",row["PersonIngId"]);
260			db.SetParameterValue(addCmd,"PolityMemberId",row["PolityMemberId"]);
261			db.SetParameterValue(addCmd,"CurrentpostId",row["CurrentpostId"]);
262			db.SetParameterValue(addCmd,"Currentposttime",row["Currentposttime"]);
263			db.SetParameterValue(addCmd,"FirstdegreeId",row["FirstdegreeId"]);
264			db.SetParameterValue(addCmd,"Schoolspecial",row["Schoolspecial"]);
265			db.SetParameterValue(addCmd,"CurrentdegreeId",row["CurrentdegreeId"]);
266			db.SetParameterValue(addCmd,"StrongSuit",row["StrongSuit"]);
267			db.SetParameterValue(addCmd,"DegreeId",row["DegreeId"]);
268			db.SetParameterValue(addCmd,"TypicalLevel",row["TypicalLevel"]);
269			db.SetParameterValue(addCmd,"IdentityTypeId",row["IdentityTypeId"]);
270			db.SetParameterValue(addCmd,"ReadinessId",row["ReadinessId"]);
271			db.SetParameterValue(addCmd,"Graduatefrom",row["Graduatefrom"]);
272			db.SetParameterValue(addCmd,"TrainInfo",row["TrainInfo"]);
273			db.SetParameterValue(addCmd,"TrainScore",row["TrainScore"]);
274			db.SetParameterValue(addCmd,"TrainEva",row["TrainEva"]);
275			db.SetParameterValue(addCmd,"AbilityEva",row["AbilityEva"]);
276			db.SetParameterValue(addCmd,"Goodteacher",row["Goodteacher"]);
277			db.SetParameterValue(addCmd,"Paper",row["Paper"]);
278			db.SetParameterValue(addCmd,"Partyattended",row["Partyattended"]);
279			db.SetParameterValue(addCmd,"Personlib",row["Personlib"]);
280			db.SetParameterValue(addCmd,"Awardorpunish",row["Awardorpunish"]);
281			db.SetParameterValue(addCmd,"Resume",row["Resume"]);
282			db.SetParameterValue(addCmd,"Photo",row["Photo"]);
283			db.SetParameterValue(addCmd,"UserId",row["UserId"]);
284			db.SetParameterValue(addCmd,"UserPwd",row["UserPwd"]);
285			db.SetParameterValue(addCmd,"FullName",row["FullName"]);
286			db.SetParameterValue(addCmd,"Posttype",row["Posttype"]);
287			db.SetParameterValue(addCmd,"Zcbm",row["Zcbm"]);
288			db.SetParameterValue(addCmd,"Zgsf",row["Zgsf"]);
289			db.SetParameterValue(addCmd,"Enabled",row["Enabled"]);
290			db.SetParameterValue(addCmd,"State",row["State"]);
291			return addCmd;
292		}
293		
294		#endregion
295		    
296		#region Update?? Helper
297		
298		protected override DbCommand ConstructUpdateCommand(Database db)
299		{
300			DbCommand dbCommand=db.GetSqlStringCommand(SQL_UPDATE);		    
301			db.AddInParameter(dbCommand,"Useq",DbType.Int32);
302			db.AddInParameter(dbCommand,"LoginName",DbType.AnsiString);
303			db.AddInParameter(dbCommand,"UserCode",DbType.AnsiString);
304			db.AddInParameter(dbCommand,"ArmType",DbType.AnsiString);
305			db.AddInParameter(dbCommand,"SpecialtyPhase",DbType.AnsiString);
306			db.AddInParameter(dbCommand,"BranchId",DbType.AnsiString);
307			db.AddInParameter(dbCommand,"PersonId",DbType.AnsiString);
308			db.AddInParameter(dbCommand,"PersonName",DbType.AnsiString);
309			db.AddInParameter(dbCommand,"SexId",DbType.AnsiString);
310			db.AddInParameter(dbCommand,"ForkId",DbType.AnsiString);
311			db.AddInParameter(dbCommand,"Birthday",DbType.DateTime);
312			db.AddInParameter(dbCommand,"EnrollDate",DbType.DateTime);
313			db.AddInParameter(dbCommand,"Birthplace",DbType.AnsiString);
314			db.AddInParameter(dbCommand,"FamOriId",DbType.AnsiString);
315			db.AddInParameter(dbCommand,"PersonIngId",DbType.AnsiString);
316			db.AddInParameter(dbCommand,"PolityMemberId",DbType.AnsiString);
317			db.AddInParameter(dbCommand,"CurrentpostId",DbType.AnsiString);
318			db.AddInParameter(dbCommand,"Currentposttime",DbType.AnsiString);
319			db.AddInParameter(dbCommand,"FirstdegreeId",DbType.AnsiString);
320			db.AddInParameter(dbCommand,"Schoolspecial",DbType.AnsiString);
321			db.AddInParameter(dbCommand,"CurrentdegreeId",DbType.AnsiString);
322			db.AddInParameter(dbCommand,"StrongSuit",DbType.AnsiString);
323			db.AddInParameter(dbCommand,"DegreeId",DbType.AnsiString);
324			db.AddInParameter(dbCommand,"TypicalLevel",DbType.AnsiString);
325			db.AddInParameter(dbCommand,"IdentityTypeId",DbType.AnsiString);
326			db.AddInParameter(dbCommand,"ReadinessId",DbType.AnsiString);
327			db.AddInParameter(dbCommand,"Graduatefrom",DbType.AnsiString);
328			db.AddInParameter(dbCommand,"TrainInfo",DbType.AnsiString);
329			db.AddInParameter(dbCommand,"TrainScore",DbType.AnsiString);
330			db.AddInParameter(dbCommand,"TrainEva",DbType.AnsiString);
331			db.AddInParameter(dbCommand,"AbilityEva",DbType.AnsiString);
332			db.AddInParameter(dbCommand,"Goodteacher",DbType.AnsiString);
333			db.AddInParameter(dbCommand,"Paper",DbType.AnsiString);
334			db.AddInParameter(dbCommand,"Partyattended",DbType.AnsiString);
335			db.AddInParameter(dbCommand,"Personlib",DbType.AnsiString);
336			db.AddInParameter(dbCommand,"Awardorpunish",DbType.AnsiString);
337			db.AddInParameter(dbCommand,"Resume",DbType.AnsiString);
338			db.AddInParameter(dbCommand,"Photo",DbType.AnsiString);
339			db.AddInParameter(dbCommand,"UserPwd",DbType.AnsiString);
340			db.AddInParameter(dbCommand,"FullName",DbType.AnsiString);
341			db.AddInParameter(dbCommand,"Posttype",DbType.AnsiString);
342			db.AddInParameter(dbCommand,"Zcbm",DbType.AnsiString);
343			db.AddInParameter(dbCommand,"Zgsf",DbType.AnsiString);
344			db.AddInParameter(dbCommand,"Enabled",DbType.AnsiString);
345			db.AddInParameter(dbCommand,"State",DbType.Int32);
346			db.AddInParameter(dbCommand,"UserId",DbType.AnsiString);
347			 
348			return dbCommand;
349		}
350		protected override DbCommand ConstructUpdateCommand(Database db,MoUsers entity)
351		{
352			DbCommand dbCommand=db.GetSqlStringCommand(SQL_UPDATE);		    
353			db.AddInParameter(dbCommand,"Useq",DbType.Int32,entity.Useq);
354			db.AddInParameter(dbCommand,"LoginName",DbType.AnsiString,entity.LoginName);
355			db.AddInParameter(dbCommand,"UserCode",DbType.AnsiString,entity.UserCode);
356			db.AddInParameter(dbCommand,"ArmType",DbType.AnsiString,entity.ArmType);
357			db.AddInParameter(dbCommand,"SpecialtyPhase",DbType.AnsiString,entity.SpecialtyPhase);
358			db.AddInParameter(dbCommand,"BranchId",DbType.AnsiString,entity.BranchId);
359			db.AddInParameter(dbCommand,"PersonId",DbType.AnsiString,entity.PersonId);
360			db.AddInParameter(dbCommand,"PersonName",DbType.AnsiString,entity.PersonName);
361			db.AddInParameter(dbCommand,"SexId",DbType.AnsiString,entity.SexId);
362			db.AddInParameter(dbCommand,"ForkId",DbType.AnsiString,entity.ForkId);
363			db.AddInParameter(dbCommand,"Birthday",DbType.DateTime,entity.Birthday);
364			db.AddInParameter(dbCommand,"EnrollDate",DbType.DateTime,entity.EnrollDate);
365			db.AddInParameter(dbCommand,"Birthplace",DbType.AnsiString,entity.Birthplace);
366			db.AddInParameter(dbCommand,"FamOriId",DbType.AnsiString,entity.FamOriId);
367			db.AddInParameter(dbCommand,"PersonIngId",DbType.AnsiString,entity.PersonIngId);
368			db.AddInParameter(dbCommand,"PolityMemberId",DbType.AnsiString,entity.PolityMemberId);
369			db.AddInParameter(dbCommand,"CurrentpostId",DbType.AnsiString,entity.CurrentpostId);
370			db.AddInParameter(dbCommand,"Currentposttime",DbType.AnsiString,entity.Currentposttime);
371			db.AddInParameter(dbCommand,"FirstdegreeId",DbType.AnsiString,entity.FirstdegreeId);
372			db.AddInParameter(dbCommand,"Schoolspecial",DbType.AnsiString,entity.Schoolspecial);
373			db.AddInParameter(dbCommand,"CurrentdegreeId",DbType.AnsiString,entity.CurrentdegreeId);
374			db.AddInParameter(dbCommand,"StrongSuit",DbType.AnsiString,entity.StrongSuit);
375			db.AddInParameter(dbCommand,"DegreeId",DbType.AnsiString,entity.DegreeId);
376			db.AddInParameter(dbCommand,"TypicalLevel",DbType.AnsiString,entity.TypicalLevel);
377			db.AddInParameter(dbCommand,"IdentityTypeId",DbType.AnsiString,entity.IdentityTypeId);
378			db.AddInParameter(dbCommand,"ReadinessId",DbType.AnsiString,entity.ReadinessId);
379			db.AddInParameter(dbCommand,"Graduatefrom",DbType.AnsiString,entity.Graduatefrom);
380			db.AddInParameter(dbCommand,"TrainInfo",DbType.AnsiString,entity.TrainInfo);
381			db.AddInParameter(dbCommand,"TrainScore",DbType.AnsiString,entity.TrainScore);
382			db.AddInParameter(dbCommand,"TrainEva",DbType.AnsiString,entity.TrainEva);
383			db.AddInParameter(dbCommand,"AbilityEva",DbType.AnsiString,entity.AbilityEva);
384			db.AddInParameter(dbCommand,"Goodteacher",DbType.AnsiString,entity.Goodteacher);
385			db.AddInParameter(dbCommand,"Paper",DbType.AnsiString,entity.Paper);
386			db.AddInParameter(dbCommand,"Partyattended",DbType.AnsiString,entity.Partyattended);
387			db.AddInParameter(dbCommand,"Personlib",DbType.AnsiString,entity.Personlib);
388			db.AddInParameter(dbCommand,"Awardorpunish",DbType.AnsiString,entity.Awardorpunish);
389			db.AddInParameter(dbCommand,"Resume",DbType.AnsiString,entity.Resume);
390			db.AddInParameter(dbCommand,"Photo",DbType.AnsiString,entity.Photo);
391			db.AddInParameter(dbCommand,"UserPwd",DbType.AnsiString,entity.UserPwd);
392			db.AddInParameter(dbCommand,"FullName",DbType.AnsiString,entity.FullName);
393			db.AddInParameter(dbCommand,"Posttype",DbType.AnsiString,entity.Posttype);
394			db.AddInParameter(dbCommand,"Zcbm",DbType.AnsiString,entity.Zcbm);
395			db.AddInParameter(dbCommand,"Zgsf",DbType.AnsiString,entity.Zgsf);
396			db.AddInParameter(dbCommand,"Enabled",DbType.AnsiString,entity.Enabled);
397			db.AddInParameter(dbCommand,"State",DbType.Int32,entity.State);
398			db.AddInParameter(dbCommand,"UserId",DbType.AnsiString,entity.UserId);
399			 
400			return dbCommand;
401		}
402		
403		protected override DbCommand PopulateUpdateCommandParameters(Database db,DbCommand updateCmd,MoUsers entity)
404		{
405			db.SetParameterValue(updateCmd,"Useq",entity.Useq);
406			db.SetParameterValue(updateCmd,"LoginName",entity.LoginName);
407			db.SetParameterValue(updateCmd,"UserCode",entity.UserCode);
408			db.SetParameterValue(updateCmd,"ArmType",entity.ArmType);
409			db.SetParameterValue(updateCmd,"SpecialtyPhase",entity.SpecialtyPhase);
410			db.SetParameterValue(updateCmd,"BranchId",entity.BranchId);
411			db.SetParameterValue(updateCmd,"PersonId",entity.PersonId);
412			db.SetParameterValue(updateCmd,"PersonName",entity.PersonName);
413			db.SetParameterValue(updateCmd,"SexId",entity.SexId);
414			db.SetParameterValue(updateCmd,"ForkId",entity.ForkId);
415			db.SetParameterValue(updateCmd,"Birthday",entity.Birthday);
416			db.SetParameterValue(updateCmd,"EnrollDate",entity.EnrollDate);
417			db.SetParameterValue(updateCmd,"Birthplace",entity.Birthplace);
418			db.SetParameterValue(updateCmd,"FamOriId",entity.FamOriId);
419			db.SetParameterValue(updateCmd,"PersonIngId",entity.PersonIngId);
420			db.SetParameterValue(updateCmd,"PolityMemberId",entity.PolityMemberId);
421			db.SetParameterValue(updateCmd,"CurrentpostId",entity.CurrentpostId);
422			db.SetParameterValue(updateCmd,"Currentposttime",entity.Currentposttime);
423			db.SetParameterValue(updateCmd,"FirstdegreeId",entity.FirstdegreeId);
424			db.SetParameterValue(updateCmd,"Schoolspecial",entity.Schoolspecial);
425			db.SetParameterValue(updateCmd,"CurrentdegreeId",entity.CurrentdegreeId);
426			db.SetParameterValue(updateCmd,"StrongSuit",entity.StrongSuit);
427			db.SetParameterValue(updateCmd,"DegreeId",entity.DegreeId);
428			db.SetParameterValue(updateCmd,"TypicalLevel",entity.TypicalLevel);
429			db.SetParameterValue(updateCmd,"IdentityTypeId",entity.IdentityTypeId);
430			db.SetParameterValue(updateCmd,"ReadinessId",entity.ReadinessId);
431			db.SetParameterValue(updateCmd,"Graduatefrom",entity.Graduatefrom);
432			db.SetParameterValue(updateCmd,"TrainInfo",entity.TrainInfo);
433			db.SetParameterValue(updateCmd,"TrainScore",entity.TrainScore);
434			db.SetParameterValue(updateCmd,"TrainEva",entity.TrainEva);
435			db.SetParameterValue(updateCmd,"AbilityEva",entity.AbilityEva);
436			db.SetParameterValue(updateCmd,"Goodteacher",entity.Goodteacher);
437			db.SetParameterValue(updateCmd,"Paper",entity.Paper);
438			db.SetParameterValue(updateCmd,"Partyattended",entity.Partyattended);
439			db.SetParameterValue(updateCmd,"Personlib",entity.Personlib);
440			db.SetParameterValue(updateCmd,"Awardorpunish",entity.Awardorpunish);
441			db.SetParameterValue(updateCmd,"Resume",entity.Resume);
442			db.SetParameterValue(updateCmd,"Photo",entity.Photo);
443			db.SetParameterValue(updateCmd,"UserPwd",entity.UserPwd);
444			db.SetParameterValue(updateCmd,"FullName",entity.FullName);
445			db.SetParameterValue(updateCmd,"Posttype",entity.Posttype);
446			db.SetParameterValue(updateCmd,"Zcbm",entity.Zcbm);
447			db.SetParameterValue(updateCmd,"Zgsf",entity.Zgsf);
448			db.SetParameterValue(updateCmd,"Enabled",entity.Enabled);
449			db.SetParameterValue(updateCmd,"State",entity.State);
450			db.SetParameterValue(updateCmd,"UserId",entity.UserId);
451			return updateCmd;
452		}
453		protected override DbCommand PopulateUpdateCommandParameters(Database db,DbCommand updateCmd,DataRow row)
454		{
455			db.SetParameterValue(updateCmd,"Useq",row["Useq"]);
456			db.SetParameterValue(updateCmd,"LoginName",row["LoginName"]);
457			db.SetParameterValue(updateCmd,"UserCode",row["UserCode"]);
458			db.SetParameterValue(updateCmd,"ArmType",row["ArmType"]);
459			db.SetParameterValue(updateCmd,"SpecialtyPhase",row["SpecialtyPhase"]);
460			db.SetParameterValue(updateCmd,"BranchId",row["BranchId"]);
461			db.SetParameterValue(updateCmd,"PersonId",row["PersonId"]);
462			db.SetParameterValue(updateCmd,"PersonName",row["PersonName"]);
463			db.SetParameterValue(updateCmd,"SexId",row["SexId"]);
464			db.SetParameterValue(updateCmd,"ForkId",row["ForkId"]);
465			db.SetParameterValue(updateCmd,"Birthday",row["Birthday"]);
466			db.SetParameterValue(updateCmd,"EnrollDate",row["EnrollDate"]);
467			db.SetParameterValue(updateCmd,"Birthplace",row["Birthplace"]);
468			db.SetParameterValue(updateCmd,"FamOriId",row["FamOriId"]);
469			db.SetParameterValue(updateCmd,"PersonIngId",row["PersonIngId"]);
470			db.SetParameterValue(updateCmd,"PolityMemberId",row["PolityMemberId"]);
471			db.SetParameterValue(updateCmd,"CurrentpostId",row["CurrentpostId"]);
472			db.SetParameterValue(updateCmd,"Currentposttime",row["Currentposttime"]);
473			db.SetParameterValue(updateCmd,"FirstdegreeId",row["FirstdegreeId"]);
474			db.SetParameterValue(updateCmd,"Schoolspecial",row["Schoolspecial"]);
475			db.SetParameterValue(updateCmd,"CurrentdegreeId",row["CurrentdegreeId"]);
476			db.SetParameterValue(updateCmd,"StrongSuit",row["StrongSuit"]);
477			db.SetParameterValue(updateCmd,"DegreeId",row["DegreeId"]);
478			db.SetParameterValue(updateCmd,"TypicalLevel",row["TypicalLevel"]);
479			db.SetParameterValue(updateCmd,"IdentityTypeId",row["IdentityTypeId"]);
480			db.SetParameterValue(updateCmd,"ReadinessId",row["ReadinessId"]);
481			db.SetParameterValue(updateCmd,"Graduatefrom",row["Graduatefrom"]);
482			db.SetParameterValue(updateCmd,"TrainInfo",row["TrainInfo"]);
483			db.SetParameterValue(updateCmd,"TrainScore",row["TrainScore"]);
484			db.SetParameterValue(updateCmd,"TrainEva",row["TrainEva"]);
485			db.SetParameterValue(updateCmd,"AbilityEva",row["AbilityEva"]);
486			db.SetParameterValue(updateCmd,"Goodteacher",row["Goodteacher"]);
487			db.SetParameterValue(updateCmd,"Paper",row["Paper"]);
488			db.SetParameterValue(updateCmd,"Partyattended",row["Partyattended"]);
489			db.SetParameterValue(updateCmd,"Personlib",row["Personlib"]);
490			db.SetParameterValue(updateCmd,"Awardorpunish",row["Awardorpunish"]);
491			db.SetParameterValue(updateCmd,"Resume",row["Resume"]);
492			db.SetParameterValue(updateCmd,"Photo",row["Photo"]);
493			db.SetParameterValue(updateCmd,"UserPwd",row["UserPwd"]);
494			db.SetParameterValue(updateCmd,"FullName",row["FullName"]);
495			db.SetParameterValue(updateCmd,"Posttype",row["Posttype"]);
496			db.SetParameterValue(updateCmd,"Zcbm",row["Zcbm"]);
497			db.SetParameterValue(updateCmd,"Zgsf",row["Zgsf"]);
498			db.SetParameterValue(updateCmd,"Enabled",row["Enabled"]);
499			db.SetParameterValue(updateCmd,"State",row["State"]);
500			db.SetParameterValue(updateCmd,"UserId",row["UserId"]);
501			return updateCmd;
502		}
503		
504		protected override void PrepareDataAdapterCommand(Database db,out DbCommand dbInsertCommand,
505		                     out DbCommand dbUpdateCommand,out DbCommand dbDeleteCommand)
506		{
507			dbInsertCommand = db.GetSqlStringCommand(SQL_INSERT);
508			#region set insert cmd parameters
509			db.AddInParameter(dbInsertCommand, "Useq",DbType.Int32, "USEQ", DataRowVersion.Current);
510			db.AddInParameter(dbInsertCommand, "LoginName",DbType.AnsiString, "LOGIN_NAME", DataRowVersion.Current);
511			db.AddInParameter(dbInsertCommand, "UserCode",DbType.AnsiString, "USER_CODE", DataRowVersion.Current);
512			db.AddInParameter(dbInsertCommand, "ArmType",DbType.AnsiString, "ARM_TYPE", DataRowVersion.Current);
513			db.AddInParameter(dbInsertCommand, "SpecialtyPhase",DbType.AnsiString, "SPECIALTY_PHASE", DataRowVersion.Current);
514			db.AddInParameter(dbInsertCommand, "BranchId",DbType.AnsiString, "BRANCH_ID", DataRowVersion.Current);
515			db.AddInParameter(dbInsertCommand, "PersonId",DbType.AnsiString, "PERSON_ID", DataRowVersion.Current);
516			db.AddInParameter(dbInsertCommand, "PersonName",DbType.AnsiString, "PERSON_NAME", DataRowVersion.Current);
517			db.AddInParameter(dbInsertCommand, "SexId",DbType.AnsiString, "SEX_ID", DataRowVersion.Current);
518			db.AddInParameter(dbInsertCommand, "ForkId",DbType.AnsiString, "FORK_ID", DataRowVersion.Current);
519			db.AddInParameter(dbInsertCommand, "Birthday",DbType.DateTime, "BIRTHDAY", DataRowVersion.Current);
520			db.AddInParameter(dbInsertCommand, "EnrollDate",DbType.DateTime, "ENROLL_DATE", DataRowVersion.Current);
521			db.AddInParameter(dbInsertCommand, "Birthplace",DbType.AnsiString, "BIRTHPLACE", DataRowVersion.Current);
522			db.AddInParameter(dbInsertCommand, "FamOriId",DbType.AnsiString, "FAM_ORI_ID", DataRowVersion.Current);
523			db.AddInParameter(dbInsertCommand, "PersonIngId",DbType.AnsiString, "PERSON_ING_ID", DataRowVersion.Current);
524			db.AddInParameter(dbInsertCommand, "PolityMemberId",DbType.AnsiString, "POLITY_MEMBER_ID", DataRowVersion.Current);
525			db.AddInParameter(dbInsertCommand, "CurrentpostId",DbType.AnsiString, "CURRENTPOST_ID", DataRowVersion.Current);
526			db.AddInParameter(dbInsertCommand, "Currentposttime",DbType.AnsiString, "CURRENTPOSTTIME", DataRowVersion.Current);
527			db.AddInParameter(dbInsertCommand, "FirstdegreeId",DbType.AnsiString, "FIRSTDEGREE_ID", DataRowVersion.Current);
528			db.AddInParameter(dbInsertCommand, "Schoolspecial",DbType.AnsiString, "SCHOOLSPECIAL", DataRowVersion.Current);
529			db.AddInParameter(dbInsertCommand, "CurrentdegreeId",DbType.AnsiString, "CURRENTDEGREE_ID", DataRowVersion.Current);
530			db.AddInParameter(dbInsertCommand, "StrongSuit",DbType.AnsiString, "STRONG_SUIT", DataRowVersion.Current);
531			db.AddInParameter(dbInsertCommand, "DegreeId",DbType.AnsiString, "DEGREE_ID", DataRowVersion.Current);
532			db.AddInParameter(dbInsertCommand, "TypicalLevel",DbType.AnsiString, "TYPICAL_LEVEL", DataRowVersion.Current);
533			db.AddInParameter(dbInsertCommand, "IdentityTypeId",DbType.AnsiString, "IDENTITY_TYPE_ID", DataRowVersion.Current);
534			db.AddInParameter(dbInsertCommand, "ReadinessId",DbType.AnsiString, "READINESS_ID", DataRowVersion.Current);
535			db.AddInParameter(dbInsertCommand, "Graduatefrom",DbType.AnsiString, "GRADUATEFROM", DataRowVersion.Current);
536			db.AddInParameter(dbInsertCommand, "TrainInfo",DbType.AnsiString, "TRAIN_INFO", DataRowVersion.Current);
537			db.AddInParameter(dbInsertCommand, "TrainScore",DbType.AnsiString, "TRAIN_SCORE", DataRowVersion.Current);
538			db.AddInParameter(dbInsertCommand, "TrainEva",DbType.AnsiString, "TRAIN_EVA", DataRowVersion.Current);
539			db.AddInParameter(dbInsertCommand, "AbilityEva",DbType.AnsiString, "ABILITY_EVA", DataRowVersion.Current);
540			db.AddInParameter(dbInsertCommand, "Goodteacher",DbType.AnsiString, "GOODTEACHER", DataRowVersion.Current);
541			db.AddInParameter(dbInsertCommand, "Paper",DbType.AnsiString, "PAPER", DataRowVersion.Current);
542			db.AddInParameter(dbInsertCommand, "Partyattended",DbType.AnsiString, "PARTYATTENDED", DataRowVersion.Current);
543			db.AddInParameter(dbInsertCommand, "Personlib",DbType.AnsiString, "PERSONLIB", DataRowVersion.Current);
544			db.AddInParameter(dbInsertCommand, "Awardorpunish",DbType.AnsiString, "AWARDORPUNISH", DataRowVersion.Current);
545			db.AddInParameter(dbInsertCommand, "Resume",DbType.AnsiString, "RESUME", DataRowVersion.Current);
546			db.AddInParameter(dbInsertCommand, "Photo",DbType.AnsiString, "PHOTO", DataRowVersion.Current);
547			db.AddInParameter(dbInsertCommand, "UserId",DbType.AnsiString, "USER_ID", DataRowVersion.Current);
548			db.AddInParameter(dbInsertCommand, "UserPwd",DbType.AnsiString, "USER_PWD", DataRowVersion.Current);
549			db.AddInParameter(dbInsertCommand, "FullName",DbType.AnsiString, "FULL_NAME", DataRowVersion.Current);
550			db.AddInParameter(dbInsertCommand, "Posttype",DbType.AnsiString, "POSTTYPE", DataRowVersion.Current);
551			db.AddInParameter(dbInsertCommand, "Zcbm",DbType.AnsiString, "ZCBM", DataRowVersion.Current);
552			db.AddInParameter(dbInsertCommand, "Zgsf",DbType.AnsiString, "ZGSF", DataRowVersion.Current);
553			db.AddInParameter(dbInsertCommand, "Enabled",DbType.AnsiString, "ENABLED", DataRowVersion.Current);
554			db.AddInParameter(dbInsertCommand, "State",DbType.Int32, "STATE", DataRowVersion.Current);
555			#endregion
556			dbUpdateCommand = db.GetSqlStringCommand(SQL_UPDATE);
557			#region Set update cmd value parameters
558			db.AddInParameter(dbUpdateCommand, "Useq", DbType.Int32, "USEQ", DataRowVersion.Current);
559			db.AddInParameter(dbUpdateCommand, "LoginName", DbType.AnsiString, "LOGIN_NAME", DataRowVersion.Current);
560			db.AddInParameter(dbUpdateCommand, "UserCode", DbType.AnsiString, "USER_CODE", DataRowVersion.Current);
561			db.AddInParameter(dbUpdateCommand, "ArmType", DbType.AnsiString, "ARM_TYPE", DataRowVersion.Current);
562			db.AddInParameter(dbUpdateCommand, "SpecialtyPhase", DbType.AnsiString, "SPECIALTY_PHASE", DataRowVersion.Current);
563			db.AddInParameter(dbUpdateCommand, "BranchId", DbType.AnsiString, "BRANCH_ID", DataRowVersion.Current);
564			db.AddInParameter(dbUpdateCommand, "PersonId", DbType.AnsiString, "PERSON_ID", DataRowVersion.Current);
565			db.AddInParameter(dbUpdateCommand, "PersonName", DbType.AnsiString, "PERSON_NAME", DataRowVersion.Current);
566			db.AddInParameter(dbUpdateCommand, "SexId", DbType.AnsiString, "SEX_ID", DataRowVersion.Current);
567			db.AddInParameter(dbUpdateCommand, "ForkId", DbType.AnsiString, "FORK_ID", DataRowVersion.Current);
568			db.AddInParameter(dbUpdateCommand, "Birthday", DbType.DateTime, "BIRTHDAY", DataRowVersion.Current);
569			db.AddInParameter(dbUpdateCommand, "EnrollDate", DbType.DateTime, "ENROLL_DATE", DataRowVersion.Current);
570			db.AddInParameter(dbUpdateCommand, "Birthplace", DbType.AnsiString, "BIRTHPLACE", DataRowVersion.Current);
571			db.AddInParameter(dbUpdateCommand, "FamOriId", DbType.AnsiString, "FAM_ORI_ID", DataRowVersion.Current);
572			db.AddInParameter(dbUpdateCommand, "PersonIngId", DbType.AnsiString, "PERSON_ING_ID", DataRowVersion.Current);
573			db.AddInParameter(dbUpdateCommand, "PolityMemberId", DbType.AnsiString, "POLITY_MEMBER_ID", DataRowVersion.Current);
574			db.AddInParameter(dbUpdateCommand, "CurrentpostId", DbType.AnsiString, "CURRENTPOST_ID", DataRowVersion.Current);
575			db.AddInParameter(dbUpdateCommand, "Currentposttime", DbType.AnsiString, "CURRENTPOSTTIME", DataRowVersion.Current);
576			db.AddInParameter(dbUpdateCommand, "FirstdegreeId", DbType.AnsiString, "FIRSTDEGREE_ID", DataRowVersion.Current);
577			db.AddInParameter(dbUpdateCommand, "Schoolspecial", DbType.AnsiString, "SCHOOLSPECIAL", DataRowVersion.Current);
578			db.AddInParameter(dbUpdateCommand, "CurrentdegreeId", DbType.AnsiString, "CURRENTDEGREE_ID", DataRowVersion.Current);
579			db.AddInParameter(dbUpdateCommand, "StrongSuit", DbType.AnsiString, "STRONG_SUIT", DataRowVersion.Current);
580			db.AddInParameter(dbUpdateCommand, "DegreeId", DbType.AnsiString, "DEGREE_ID", DataRowVersion.Current);
581			db.AddInParameter(dbUpdateCommand, "TypicalLevel", DbType.AnsiString, "TYPICAL_LEVEL", DataRowVersion.Current);
582			db.AddInParameter(dbUpdateCommand, "IdentityTypeId", DbType.AnsiString, "IDENTITY_TYPE_ID", DataRowVersion.Current);
583			db.AddInParameter(dbUpdateCommand, "ReadinessId", DbType.AnsiString, "READINESS_ID", DataRowVersion.Current);
584			db.AddInParameter(dbUpdateCommand, "Graduatefrom", DbType.AnsiString, "GRADUATEFROM", DataRowVersion.Current);
585			db.AddInParameter(dbUpdateCommand, "TrainInfo", DbType.AnsiString, "TRAIN_INFO", DataRowVersion.Current);
586			db.AddInParameter(dbUpdateCommand, "TrainScore", DbType.AnsiString, "TRAIN_SCORE", DataRowVersion.Current);
587			db.AddInParameter(dbUpdateCommand, "TrainEva", DbType.AnsiString, "TRAIN_EVA", DataRowVersion.Current);
588			db.AddInParameter(dbUpdateCommand, "AbilityEva", DbType.AnsiString, "ABILITY_EVA", DataRowVersion.Current);
589			db.AddInParameter(dbUpdateCommand, "Goodteacher", DbType.AnsiString, "GOODTEACHER", DataRowVersion.Current);
590			db.AddInParameter(dbUpdateCommand, "Paper", DbType.AnsiString, "PAPER", DataRowVersion.Current);
591			db.AddInParameter(dbUpdateCommand, "Partyattended", DbType.AnsiString, "PARTYATTENDED", DataRowVersion.Current);
592			db.AddInParameter(dbUpdateCommand, "Personlib", DbType.AnsiString, "PERSONLIB", DataRowVersion.Current);
593			db.AddInParameter(dbUpdateCommand, "Awardorpunish", DbType.AnsiString, "AWARDORPUNISH", DataRowVersion.Current);
594			db.AddInParameter(dbUpdateCommand, "Resume", DbType.AnsiString, "RESUME", DataRowVersion.Current);
595			db.AddInParameter(dbUpdateCommand, "Photo", DbType.AnsiString, "PHOTO", DataRowVersion.Current);
596			db.AddInParameter(dbUpdateCommand, "UserPwd", DbType.AnsiString, "USER_PWD", DataRowVersion.Current);
597			db.AddInParameter(dbUpdateCommand, "FullName", DbType.AnsiString, "FULL_NAME", DataRowVersion.Current);
598			db.AddInParameter(dbUpdateCommand, "Posttype", DbType.AnsiString, "POSTTYPE", DataRowVersion.Current);
599			db.AddInParameter(dbUpdateCommand, "Zcbm", DbType.AnsiString, "ZCBM", DataRowVersion.Current);
600			db.AddInParameter(dbUpdateCommand, "Zgsf", DbType.AnsiString, "ZGSF", DataRowVersion.Current);
601			db.AddInParameter(dbUpdateCommand, "Enabled", DbType.AnsiString, "ENABLED", DataRowVersion.Current);
602			db.AddInParameter(dbUpdateCommand, "State", DbType.Int32, "STATE", DataRowVersion.Current);
603			#endregion
604			#region set update cmd pk where parameters
605			db.AddInParameter(dbUpdateCommand, "UserId", DbType.AnsiString, "USER_ID", DataRowVersion.Current);
606			#endregion			
607			dbDeleteCommand = db.GetSqlStringCommand(SQL_DELETE);
608			#region set delete cmd pk where parameters
609			db.AddInParameter(dbDeleteCommand, "UserId", DbType.AnsiString, "USER_ID", DataRowVersion.Current);
610			#endregion
611		}
612		#endregion	
613		
614		#region Delete?? Helper		
615		
616		protected override DbCommand ConstructDeleteCommand(Database db)
617		{
618			DbCommand dbCommand=db.GetSqlStringCommand(SQL_DELETE);
619			 
620			db.AddInParameter(dbCommand,"UserId",DbType.AnsiString);
621			 
622			return dbCommand;
623		}		
624		protected override DbCommand ConstructDeleteCommand(Database db,MoUsers entity)
625		{
626			DbCommand dbCommand=db.GetSqlStringCommand(SQL_DELETE);
627			 
628			db.AddInParameter(dbCommand,"UserId",DbType.AnsiString,entity.UserId);
629		 
630			return dbCommand;
631		}
632		
633		protected override DbCommand ConstructDeleteCommandForWhere(Database db, string where)
634        {
635            return db.GetSqlStringCommand(SQL_DELETE_DEFAULT + where);            
636        }
637
638        protected override DbCommand PopulateDeleteCommandParameters(Database db, DbCommand deleteCmd, MoUsers entity)
639        {
640			db.SetParameterValue(deleteCmd,"UserId",entity.UserId);
641			return deleteCmd;
642        }
643
644        protected override DbCommand PopulateDeleteCommandParameters(Database db, DbCommand deleteCmd, DataRow row)
645        {
646			db.SetParameterValue(deleteCmd,"UserId",row["UserId"]);
647			return deleteCmd;
648        }      
649		
650		#endregion helper
651		
652		#region Query?? Helper
653
654        protected override DbCommand ConstructQueryCommand(string condition)
655        {
656            return db.GetSqlStringCommand(SQL_SELECT + condition);
657        }
658
659        #endregion
660		
661		#region GetEntity(s)?? Helper
662        
663		protected override DbCommand ConstructSelectOneCommand(Database db,MoUsers entity)
664		{
665			DbCommand dbCommand=db.GetSqlStringCommand(SQL_SELECT_ONE);
666			 
667			db.AddInParameter(dbCommand,"UserId",DbType.AnsiString,entity.UserId);
668			return dbCommand;
669		}
670		
671		protected override void PopulateEntityByDataReader(IDataReader reader,ref MoUsers entity)
672		{
673			if (!reader.IsDBNull(0)) entity.Useq = reader.GetInt32(0);
674			if (!reader.IsDBNull(1)) entity.LoginName = reader.GetString(1);
675			if (!reader.IsDBNull(2)) entity.UserCode = reader.GetString(2);
676			if (!reader.IsDBNull(3)) entity.ArmType = reader.GetString(3);
677			if (!reader.IsDBNull(4)) entity.SpecialtyPhase = reader.GetString(4);
678			if (!reader.IsDBNull(5)) entity.BranchId = reader.GetString(5);
679			if (!reader.IsDBNull(6)) entity.PersonId = reader.GetString(6);
680			if (!reader.IsDBNull(7)) entity.PersonName = reader.GetString(7);
681			if (!reader.IsDBNull(8)) entity.SexId = reader.GetString(8);
682			if (!reader.IsDBNull(9)) entity.ForkId = reader.GetString(9);
683			if (!reader.IsDBNull(10)) entity.Birthday = reader.GetDateTime(10);
684			if (!reader.IsDBNull(11)) entity.EnrollDate = reader.GetDateTime(11);
685			if (!reader.IsDBNull(12)) entity.Birthplace = reader.GetString(12);
686			if (!reader.IsDBNull(13)) entity.FamOriId = reader.GetString(13);
687			if (!reader.IsDBNull(14)) entity.PersonIngId = reader.GetString(14);
688			if (!reader.IsDBNull(15)) entity.PolityMemberId = reader.GetString(15);
689			if (!reader.IsDBNull(16)) entity.CurrentpostId = reader.GetString(16);
690			if (!reader.IsDBNull(17)) entity.Currentposttime = reader.GetString(17);
691			if (!reader.IsDBNull(18)) entity.FirstdegreeId = reader.GetString(18);
692			if (!reader.IsDBNull(19)) entity.Schoolspecial = reader.GetString(19);
693			if (!reader.IsDBNull(20)) entity.CurrentdegreeId = reader.GetString(20);
694			if (!reader.IsDBNull(21)) entity.StrongSuit = reader.GetString(21);
695			if (!reader.IsDBNull(22)) entity.DegreeId = reader.GetString(22);
696			if (!reader.IsDBNull(23)) entity.TypicalLevel = reader.GetString(23);
697			if (!reader.IsDBNull(24)) entity.IdentityTypeId = reader.GetString(24);
698			if (!reader.IsDBNull(25)) entity.ReadinessId = reader.GetString(25);
699			if (!reader.IsDBNull(26)) entity.Graduatefrom = reader.GetString(26);
700			if (!reader.IsDBNull(27)) entity.TrainInfo = reader.GetString(27);
701			if (!reader.IsDBNull(28)) entity.TrainScore = reader.GetString(28);
702			if (!reader.IsDBNull(29)) entity.TrainEva = reader.GetString(29);
703			if (!reader.IsDBNull(30)) entity.AbilityEva = reader.GetString(30);
704			if (!reader.IsDBNull(31)) entity.Goodteacher = reader.GetString(31);
705			if (!reader.IsDBNull(32)) entity.Paper = reader.GetString(32);
706			if (!reader.IsDBNull(33)) entity.Partyattended = reader.GetString(33);
707			if (!reader.IsDBNull(34)) entity.Personlib = reader.GetString(34);
708			if (!reader.IsDBNull(35)) entity.Awardorpunish = reader.GetString(35);
709			if (!reader.IsDBNull(36)) entity.Resume = reader.GetString(36);
710			if (!reader.IsDBNull(37)) entity.Photo = reader.GetString(37);
711			if (!reader.IsDBNull(38)) entity.UserId = reader.GetString(38);
712			if (!reader.IsDBNull(39)) entity.UserPwd = reader.GetString(39);
713			if (!reader.IsDBNull(40)) entity.FullName = reader.GetString(40);
714			if (!reader.IsDBNull(41)) entity.Posttype = reader.GetString(41);
715			if (!reader.IsDBNull(42)) entity.Zcbm = reader.GetString(42);
716			if (!reader.IsDBNull(43)) entity.Zgsf = reader.GetString(43);
717			if (!reader.IsDBNull(44)) entity.Enabled = reader.GetString(44);
718			if (!reader.IsDBNull(45)) entity.State = reader.GetInt32(45);
719		}
720		
721		
722
723        protected override DbCommand ConstructSelectConditionCommand(Database db, string condition)
724        {
725            return db.GetSqlStringCommand(SQL_SELECT + condition);
726        }
727		
728		#endregion	
729		
730		#region Count?? Helper
731
732        protected override DbCommand ConstructCountCommand(Database db)
733        {
734            return db.GetSqlStringCommand(SQL_COUNT);
735        }
736
737        protected override DbCommand ConstructCountConditionCommand(Database db, string condition)
738        {
739            return db.GetSqlStringCommand(SQL_COUNT + condition);
740        }
741
742		#endregion
743		
744		#region IsExist?? Helper
745
746        protected override DbCommand ConstructIsExistCommand(Database db, MoUsers entity)
747        {
748            DbCommand dbCommand = db.GetSqlStringCommand(SQL_EXIST);
749			db.AddInParameter(dbCommand,"UserId",DbType.AnsiString,entity.UserId);
750			return dbCommand;
751        }
752
753		#endregion
754
755		
756		
757	}
758}	
759#endregion
760