PageRenderTime 293ms CodeModel.GetById 244ms app.highlight 42ms RepoModel.GetById 1ms app.codeStats 0ms

/Las/Las.Dal/DaAssDgScore.auto.cs

http://sgsoft-las.googlecode.com/
C# | 441 lines | 360 code | 60 blank | 21 comment | 17 complexity | 4e92c6c68c34b1ab50e61f54f310f82c MD5 | raw file
Possible License(s): LGPL-2.1
  1#region DaAssDgScore
  2/*----------------------------------------------------------------
  3// ????DaAssDgScore.cs
  4// ??????AssDgScore??????
  5//
  6// 
  7// ?????2009-07-10 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	///?????????,IAssDgScore ,???????DaBase?
 29	///DaBase????DbException????????
 30    public	partial  class DaAssDgScore:DaBase<MoAssDgScore>
 31    {	 
 32		#region SQL const
 33		internal const string TABLE_COLUMNS=" AKS_ID ,ASIS_ID ,ASS_DG_ID ,DG_NAME ,DG_TYPE ,ADI_ATTR ,ADS_ITEM_ID ,ADS_ITEM_NAME ,CJ ,CJ_STYLE ,MCJ ,CJ_STATUS ,CR_TIME ,CR_UID ,LU_UID ,LU_TIME ,REM   ";
 34		
 35		internal const string SQL_INSERT="INSERT INTO LA_ASS_DG_SCORE ("+TABLE_COLUMNS+") VALUES (@AksId,@AsisId,@AssDgId,@DgName,@DgType,@AdiAttr,@AdsItemId,@AdsItemName,@Cj,@CjStyle,@Mcj,@CjStatus,@CrTime,@CrUid,@LuUid,@LuTime,@Rem)";
 36		internal const string SQL_SELECT="SELECT "+TABLE_COLUMNS+" FROM LA_ASS_DG_SCORE  ";
 37		internal const string SQL_SELECT_ONE=SQL_SELECT+" WHERE AKS_ID=@AksId";                              
 38		
 39		internal const string SQL_EXIST="SELECT COUNT(*) FROM LA_ASS_DG_SCORE  WHERE AKS_ID=@AksId  ";
 40		internal const string SQL_UPDATE="UPDATE LA_ASS_DG_SCORE SET ASIS_ID=@AsisId, ASS_DG_ID=@AssDgId, DG_NAME=@DgName, DG_TYPE=@DgType, ADI_ATTR=@AdiAttr, ADS_ITEM_ID=@AdsItemId, ADS_ITEM_NAME=@AdsItemName, CJ=@Cj, CJ_STYLE=@CjStyle, MCJ=@Mcj, CJ_STATUS=@CjStatus, CR_TIME=@CrTime, CR_UID=@CrUid, LU_UID=@LuUid, LU_TIME=@LuTime, REM=@Rem WHERE AKS_ID=@AksId";
 41		
 42		internal const string SQL_DELETE_DEFAULT = "DELETE FROM LA_ASS_DG_SCORE ";
 43		internal const string SQL_DELETE="DELETE FROM LA_ASS_DG_SCORE WHERE AKS_ID=@AksId";
 44		
 45		internal const string SQL_COUNT="SELECT COUNT(*) FROM LA_Ass_DG_Score";
 46		#endregion
 47		       
 48		#region Constructor
 49	 
 50		/// <summary>
 51        /// ???????????????????????
 52        /// </summary>
 53		public DaAssDgScore ()
 54		{ 
 55			this.db=DatabaseFactory.CreateDatabase();
 56		}
 57		/// <summary>
 58        /// ?????databaseName??????
 59        /// </summary>
 60        /// <param name="databaseName">??????????????</param>
 61		public DaAssDgScore (string databaseName)
 62		{ 
 63            this.db = DatabaseFactory.CreateDatabase(databaseName);
 64		} 
 65		
 66		public DaAssDgScore (Database db)
 67		{ 
 68            this.db = db;
 69		} 
 70		
 71		#endregion
 72		
 73		//???CRUD??????????????????
 74
 75		#region ?????
 76		
 77        protected override MoAssDgScore ConstructT()
 78        {
 79            return new MoAssDgScore();
 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,"AksId",DbType.AnsiString);
 93			db.AddInParameter(dbCommand,"AsisId",DbType.AnsiString);
 94			db.AddInParameter(dbCommand,"AssDgId",DbType.AnsiString);
 95			db.AddInParameter(dbCommand,"DgName",DbType.String);
 96			db.AddInParameter(dbCommand,"DgType",DbType.AnsiString);
 97			db.AddInParameter(dbCommand,"AdiAttr",DbType.Int32);
 98			db.AddInParameter(dbCommand,"AdsItemId",DbType.AnsiString);
 99			db.AddInParameter(dbCommand,"AdsItemName",DbType.String);
100			db.AddInParameter(dbCommand,"Cj",DbType.Int32);
101			db.AddInParameter(dbCommand,"CjStyle",DbType.Int32);
102			db.AddInParameter(dbCommand,"Mcj",DbType.Int32);
103			db.AddInParameter(dbCommand,"CjStatus",DbType.Int32);
104			db.AddInParameter(dbCommand,"CrTime",DbType.DateTime);
105			db.AddInParameter(dbCommand,"CrUid",DbType.AnsiString);
106			db.AddInParameter(dbCommand,"LuUid",DbType.AnsiString);
107			db.AddInParameter(dbCommand,"LuTime",DbType.DateTime);
108			db.AddInParameter(dbCommand,"Rem",DbType.String);
109			return dbCommand;
110		}		
111		protected override DbCommand ConstructAddCommand(Database db,MoAssDgScore entity)
112		{
113			DbCommand dbCommand=db.GetSqlStringCommand(SQL_INSERT);			 
114			db.AddInParameter(dbCommand,"AksId",DbType.AnsiString,entity.AksId);
115			db.AddInParameter(dbCommand,"AsisId",DbType.AnsiString,entity.AsisId);
116			db.AddInParameter(dbCommand,"AssDgId",DbType.AnsiString,entity.AssDgId);
117			db.AddInParameter(dbCommand,"DgName",DbType.String,entity.DgName);
118			db.AddInParameter(dbCommand,"DgType",DbType.AnsiString,entity.DgType);
119			db.AddInParameter(dbCommand,"AdiAttr",DbType.Int32,entity.AdiAttr);
120			db.AddInParameter(dbCommand,"AdsItemId",DbType.AnsiString,entity.AdsItemId);
121			db.AddInParameter(dbCommand,"AdsItemName",DbType.String,entity.AdsItemName);
122			db.AddInParameter(dbCommand,"Cj",DbType.Int32,entity.Cj);
123			db.AddInParameter(dbCommand,"CjStyle",DbType.Int32,entity.CjStyle);
124			db.AddInParameter(dbCommand,"Mcj",DbType.Int32,entity.Mcj);
125			db.AddInParameter(dbCommand,"CjStatus",DbType.Int32,entity.CjStatus);
126			db.AddInParameter(dbCommand,"CrTime",DbType.DateTime,entity.CrTime);
127			db.AddInParameter(dbCommand,"CrUid",DbType.AnsiString,entity.CrUid);
128			db.AddInParameter(dbCommand,"LuUid",DbType.AnsiString,entity.LuUid);
129			db.AddInParameter(dbCommand,"LuTime",DbType.DateTime,entity.LuTime);
130			db.AddInParameter(dbCommand,"Rem",DbType.String,entity.Rem);
131			return dbCommand;
132		}
133		
134		protected override DbCommand PopulateAddCommandParameters(Database db,DbCommand addCmd,MoAssDgScore entity)
135		{
136			db.SetParameterValue(addCmd,"AksId",entity.AksId);
137			db.SetParameterValue(addCmd,"AsisId",entity.AsisId);
138			db.SetParameterValue(addCmd,"AssDgId",entity.AssDgId);
139			db.SetParameterValue(addCmd,"DgName",entity.DgName);
140			db.SetParameterValue(addCmd,"DgType",entity.DgType);
141			db.SetParameterValue(addCmd,"AdiAttr",entity.AdiAttr);
142			db.SetParameterValue(addCmd,"AdsItemId",entity.AdsItemId);
143			db.SetParameterValue(addCmd,"AdsItemName",entity.AdsItemName);
144			db.SetParameterValue(addCmd,"Cj",entity.Cj);
145			db.SetParameterValue(addCmd,"CjStyle",entity.CjStyle);
146			db.SetParameterValue(addCmd,"Mcj",entity.Mcj);
147			db.SetParameterValue(addCmd,"CjStatus",entity.CjStatus);
148			db.SetParameterValue(addCmd,"CrTime",entity.CrTime);
149			db.SetParameterValue(addCmd,"CrUid",entity.CrUid);
150			db.SetParameterValue(addCmd,"LuUid",entity.LuUid);
151			db.SetParameterValue(addCmd,"LuTime",entity.LuTime);
152			db.SetParameterValue(addCmd,"Rem",entity.Rem);
153			return addCmd;
154		}
155		
156		protected override DbCommand PopulateAddCommandParameters(Database db,DbCommand addCmd,DataRow row)
157		{
158			db.SetParameterValue(addCmd,"AksId",row["AksId"]);
159			db.SetParameterValue(addCmd,"AsisId",row["AsisId"]);
160			db.SetParameterValue(addCmd,"AssDgId",row["AssDgId"]);
161			db.SetParameterValue(addCmd,"DgName",row["DgName"]);
162			db.SetParameterValue(addCmd,"DgType",row["DgType"]);
163			db.SetParameterValue(addCmd,"AdiAttr",row["AdiAttr"]);
164			db.SetParameterValue(addCmd,"AdsItemId",row["AdsItemId"]);
165			db.SetParameterValue(addCmd,"AdsItemName",row["AdsItemName"]);
166			db.SetParameterValue(addCmd,"Cj",row["Cj"]);
167			db.SetParameterValue(addCmd,"CjStyle",row["CjStyle"]);
168			db.SetParameterValue(addCmd,"Mcj",row["Mcj"]);
169			db.SetParameterValue(addCmd,"CjStatus",row["CjStatus"]);
170			db.SetParameterValue(addCmd,"CrTime",row["CrTime"]);
171			db.SetParameterValue(addCmd,"CrUid",row["CrUid"]);
172			db.SetParameterValue(addCmd,"LuUid",row["LuUid"]);
173			db.SetParameterValue(addCmd,"LuTime",row["LuTime"]);
174			db.SetParameterValue(addCmd,"Rem",row["Rem"]);
175			return addCmd;
176		}
177		
178		#endregion
179		    
180		#region Update?? Helper
181		
182		protected override DbCommand ConstructUpdateCommand(Database db)
183		{
184			DbCommand dbCommand=db.GetSqlStringCommand(SQL_UPDATE);		    
185			db.AddInParameter(dbCommand,"AsisId",DbType.AnsiString);
186			db.AddInParameter(dbCommand,"AssDgId",DbType.AnsiString);
187			db.AddInParameter(dbCommand,"DgName",DbType.String);
188			db.AddInParameter(dbCommand,"DgType",DbType.AnsiString);
189			db.AddInParameter(dbCommand,"AdiAttr",DbType.Int32);
190			db.AddInParameter(dbCommand,"AdsItemId",DbType.AnsiString);
191			db.AddInParameter(dbCommand,"AdsItemName",DbType.String);
192			db.AddInParameter(dbCommand,"Cj",DbType.Int32);
193			db.AddInParameter(dbCommand,"CjStyle",DbType.Int32);
194			db.AddInParameter(dbCommand,"Mcj",DbType.Int32);
195			db.AddInParameter(dbCommand,"CjStatus",DbType.Int32);
196			db.AddInParameter(dbCommand,"CrTime",DbType.DateTime);
197			db.AddInParameter(dbCommand,"CrUid",DbType.AnsiString);
198			db.AddInParameter(dbCommand,"LuUid",DbType.AnsiString);
199			db.AddInParameter(dbCommand,"LuTime",DbType.DateTime);
200			db.AddInParameter(dbCommand,"Rem",DbType.String);
201			db.AddInParameter(dbCommand,"AksId",DbType.AnsiString);
202			 
203			return dbCommand;
204		}
205		protected override DbCommand ConstructUpdateCommand(Database db,MoAssDgScore entity)
206		{
207			DbCommand dbCommand=db.GetSqlStringCommand(SQL_UPDATE);		    
208			db.AddInParameter(dbCommand,"AsisId",DbType.AnsiString,entity.AsisId);
209			db.AddInParameter(dbCommand,"AssDgId",DbType.AnsiString,entity.AssDgId);
210			db.AddInParameter(dbCommand,"DgName",DbType.String,entity.DgName);
211			db.AddInParameter(dbCommand,"DgType",DbType.AnsiString,entity.DgType);
212			db.AddInParameter(dbCommand,"AdiAttr",DbType.Int32,entity.AdiAttr);
213			db.AddInParameter(dbCommand,"AdsItemId",DbType.AnsiString,entity.AdsItemId);
214			db.AddInParameter(dbCommand,"AdsItemName",DbType.String,entity.AdsItemName);
215			db.AddInParameter(dbCommand,"Cj",DbType.Int32,entity.Cj);
216			db.AddInParameter(dbCommand,"CjStyle",DbType.Int32,entity.CjStyle);
217			db.AddInParameter(dbCommand,"Mcj",DbType.Int32,entity.Mcj);
218			db.AddInParameter(dbCommand,"CjStatus",DbType.Int32,entity.CjStatus);
219			db.AddInParameter(dbCommand,"CrTime",DbType.DateTime,entity.CrTime);
220			db.AddInParameter(dbCommand,"CrUid",DbType.AnsiString,entity.CrUid);
221			db.AddInParameter(dbCommand,"LuUid",DbType.AnsiString,entity.LuUid);
222			db.AddInParameter(dbCommand,"LuTime",DbType.DateTime,entity.LuTime);
223			db.AddInParameter(dbCommand,"Rem",DbType.String,entity.Rem);
224			db.AddInParameter(dbCommand,"AksId",DbType.AnsiString,entity.AksId);
225			 
226			return dbCommand;
227		}
228		
229		protected override DbCommand PopulateUpdateCommandParameters(Database db,DbCommand updateCmd,MoAssDgScore entity)
230		{
231			db.SetParameterValue(updateCmd,"AsisId",entity.AsisId);
232			db.SetParameterValue(updateCmd,"AssDgId",entity.AssDgId);
233			db.SetParameterValue(updateCmd,"DgName",entity.DgName);
234			db.SetParameterValue(updateCmd,"DgType",entity.DgType);
235			db.SetParameterValue(updateCmd,"AdiAttr",entity.AdiAttr);
236			db.SetParameterValue(updateCmd,"AdsItemId",entity.AdsItemId);
237			db.SetParameterValue(updateCmd,"AdsItemName",entity.AdsItemName);
238			db.SetParameterValue(updateCmd,"Cj",entity.Cj);
239			db.SetParameterValue(updateCmd,"CjStyle",entity.CjStyle);
240			db.SetParameterValue(updateCmd,"Mcj",entity.Mcj);
241			db.SetParameterValue(updateCmd,"CjStatus",entity.CjStatus);
242			db.SetParameterValue(updateCmd,"CrTime",entity.CrTime);
243			db.SetParameterValue(updateCmd,"CrUid",entity.CrUid);
244			db.SetParameterValue(updateCmd,"LuUid",entity.LuUid);
245			db.SetParameterValue(updateCmd,"LuTime",entity.LuTime);
246			db.SetParameterValue(updateCmd,"Rem",entity.Rem);
247			db.SetParameterValue(updateCmd,"AksId",entity.AksId);
248			return updateCmd;
249		}
250		protected override DbCommand PopulateUpdateCommandParameters(Database db,DbCommand updateCmd,DataRow row)
251		{
252			db.SetParameterValue(updateCmd,"AsisId",row["AsisId"]);
253			db.SetParameterValue(updateCmd,"AssDgId",row["AssDgId"]);
254			db.SetParameterValue(updateCmd,"DgName",row["DgName"]);
255			db.SetParameterValue(updateCmd,"DgType",row["DgType"]);
256			db.SetParameterValue(updateCmd,"AdiAttr",row["AdiAttr"]);
257			db.SetParameterValue(updateCmd,"AdsItemId",row["AdsItemId"]);
258			db.SetParameterValue(updateCmd,"AdsItemName",row["AdsItemName"]);
259			db.SetParameterValue(updateCmd,"Cj",row["Cj"]);
260			db.SetParameterValue(updateCmd,"CjStyle",row["CjStyle"]);
261			db.SetParameterValue(updateCmd,"Mcj",row["Mcj"]);
262			db.SetParameterValue(updateCmd,"CjStatus",row["CjStatus"]);
263			db.SetParameterValue(updateCmd,"CrTime",row["CrTime"]);
264			db.SetParameterValue(updateCmd,"CrUid",row["CrUid"]);
265			db.SetParameterValue(updateCmd,"LuUid",row["LuUid"]);
266			db.SetParameterValue(updateCmd,"LuTime",row["LuTime"]);
267			db.SetParameterValue(updateCmd,"Rem",row["Rem"]);
268			db.SetParameterValue(updateCmd,"AksId",row["AksId"]);
269			return updateCmd;
270		}
271		
272		protected override void PrepareDataAdapterCommand(Database db,out DbCommand dbInsertCommand,
273		                     out DbCommand dbUpdateCommand,out DbCommand dbDeleteCommand)
274		{
275			dbInsertCommand = db.GetSqlStringCommand(SQL_INSERT);
276			#region set insert cmd parameters
277			db.AddInParameter(dbInsertCommand, "AksId",DbType.AnsiString, "AKS_ID", DataRowVersion.Current);
278			db.AddInParameter(dbInsertCommand, "AsisId",DbType.AnsiString, "ASIS_ID", DataRowVersion.Current);
279			db.AddInParameter(dbInsertCommand, "AssDgId",DbType.AnsiString, "ASS_DG_ID", DataRowVersion.Current);
280			db.AddInParameter(dbInsertCommand, "DgName",DbType.String, "DG_NAME", DataRowVersion.Current);
281			db.AddInParameter(dbInsertCommand, "DgType",DbType.AnsiString, "DG_TYPE", DataRowVersion.Current);
282			db.AddInParameter(dbInsertCommand, "AdiAttr",DbType.Int32, "ADI_ATTR", DataRowVersion.Current);
283			db.AddInParameter(dbInsertCommand, "AdsItemId",DbType.AnsiString, "ADS_ITEM_ID", DataRowVersion.Current);
284			db.AddInParameter(dbInsertCommand, "AdsItemName",DbType.String, "ADS_ITEM_NAME", DataRowVersion.Current);
285			db.AddInParameter(dbInsertCommand, "Cj",DbType.Int32, "CJ", DataRowVersion.Current);
286			db.AddInParameter(dbInsertCommand, "CjStyle",DbType.Int32, "CJ_STYLE", DataRowVersion.Current);
287			db.AddInParameter(dbInsertCommand, "Mcj",DbType.Int32, "MCJ", DataRowVersion.Current);
288			db.AddInParameter(dbInsertCommand, "CjStatus",DbType.Int32, "CJ_STATUS", DataRowVersion.Current);
289			db.AddInParameter(dbInsertCommand, "CrTime",DbType.DateTime, "CR_TIME", DataRowVersion.Current);
290			db.AddInParameter(dbInsertCommand, "CrUid",DbType.AnsiString, "CR_UID", DataRowVersion.Current);
291			db.AddInParameter(dbInsertCommand, "LuUid",DbType.AnsiString, "LU_UID", DataRowVersion.Current);
292			db.AddInParameter(dbInsertCommand, "LuTime",DbType.DateTime, "LU_TIME", DataRowVersion.Current);
293			db.AddInParameter(dbInsertCommand, "Rem",DbType.String, "REM", DataRowVersion.Current);
294			#endregion
295			dbUpdateCommand = db.GetSqlStringCommand(SQL_UPDATE);
296			#region Set update cmd value parameters
297			db.AddInParameter(dbUpdateCommand, "AsisId", DbType.AnsiString, "ASIS_ID", DataRowVersion.Current);
298			db.AddInParameter(dbUpdateCommand, "AssDgId", DbType.AnsiString, "ASS_DG_ID", DataRowVersion.Current);
299			db.AddInParameter(dbUpdateCommand, "DgName", DbType.String, "DG_NAME", DataRowVersion.Current);
300			db.AddInParameter(dbUpdateCommand, "DgType", DbType.AnsiString, "DG_TYPE", DataRowVersion.Current);
301			db.AddInParameter(dbUpdateCommand, "AdiAttr", DbType.Int32, "ADI_ATTR", DataRowVersion.Current);
302			db.AddInParameter(dbUpdateCommand, "AdsItemId", DbType.AnsiString, "ADS_ITEM_ID", DataRowVersion.Current);
303			db.AddInParameter(dbUpdateCommand, "AdsItemName", DbType.String, "ADS_ITEM_NAME", DataRowVersion.Current);
304			db.AddInParameter(dbUpdateCommand, "Cj", DbType.Int32, "CJ", DataRowVersion.Current);
305			db.AddInParameter(dbUpdateCommand, "CjStyle", DbType.Int32, "CJ_STYLE", DataRowVersion.Current);
306			db.AddInParameter(dbUpdateCommand, "Mcj", DbType.Int32, "MCJ", DataRowVersion.Current);
307			db.AddInParameter(dbUpdateCommand, "CjStatus", DbType.Int32, "CJ_STATUS", DataRowVersion.Current);
308			db.AddInParameter(dbUpdateCommand, "CrTime", DbType.DateTime, "CR_TIME", DataRowVersion.Current);
309			db.AddInParameter(dbUpdateCommand, "CrUid", DbType.AnsiString, "CR_UID", DataRowVersion.Current);
310			db.AddInParameter(dbUpdateCommand, "LuUid", DbType.AnsiString, "LU_UID", DataRowVersion.Current);
311			db.AddInParameter(dbUpdateCommand, "LuTime", DbType.DateTime, "LU_TIME", DataRowVersion.Current);
312			db.AddInParameter(dbUpdateCommand, "Rem", DbType.String, "REM", DataRowVersion.Current);
313			#endregion
314			#region set update cmd pk where parameters
315			db.AddInParameter(dbUpdateCommand, "AksId", DbType.AnsiString, "AKS_ID", DataRowVersion.Current);
316			#endregion			
317			dbDeleteCommand = db.GetSqlStringCommand(SQL_DELETE);
318			#region set delete cmd pk where parameters
319			db.AddInParameter(dbDeleteCommand, "AksId", DbType.AnsiString, "AKS_ID", DataRowVersion.Current);
320			#endregion
321		}
322		#endregion	
323		
324		#region Delete?? Helper		
325		
326		protected override DbCommand ConstructDeleteCommand(Database db)
327		{
328			DbCommand dbCommand=db.GetSqlStringCommand(SQL_DELETE);
329			 
330			db.AddInParameter(dbCommand,"AksId",DbType.AnsiString);
331			 
332			return dbCommand;
333		}		
334		protected override DbCommand ConstructDeleteCommand(Database db,MoAssDgScore entity)
335		{
336			DbCommand dbCommand=db.GetSqlStringCommand(SQL_DELETE);
337			 
338			db.AddInParameter(dbCommand,"AksId",DbType.AnsiString,entity.AksId);
339		 
340			return dbCommand;
341		}
342		
343		protected override DbCommand ConstructDeleteCommandForWhere(Database db, string where)
344        {
345            return db.GetSqlStringCommand(SQL_DELETE_DEFAULT + where);            
346        }
347
348        protected override DbCommand PopulateDeleteCommandParameters(Database db, DbCommand deleteCmd, MoAssDgScore entity)
349        {
350			db.SetParameterValue(deleteCmd,"AksId",entity.AksId);
351			return deleteCmd;
352        }
353
354        protected override DbCommand PopulateDeleteCommandParameters(Database db, DbCommand deleteCmd, DataRow row)
355        {
356			db.SetParameterValue(deleteCmd,"AksId",row["AksId"]);
357			return deleteCmd;
358        }      
359		
360		#endregion helper
361		
362		#region Query?? Helper
363
364        protected override DbCommand ConstructQueryCommand(string condition)
365        {
366            return db.GetSqlStringCommand(SQL_SELECT + condition);
367        }
368
369        #endregion
370		
371		#region GetEntity(s)?? Helper
372        
373		protected override DbCommand ConstructSelectOneCommand(Database db,MoAssDgScore entity)
374		{
375			DbCommand dbCommand=db.GetSqlStringCommand(SQL_SELECT_ONE);
376			 
377			db.AddInParameter(dbCommand,"AksId",DbType.AnsiString,entity.AksId);
378			return dbCommand;
379		}
380		
381		protected override void PopulateEntityByDataReader(IDataReader reader,ref MoAssDgScore entity)
382		{
383			if (!reader.IsDBNull(0)) entity.AksId = reader.GetString(0);
384			if (!reader.IsDBNull(1)) entity.AsisId = reader.GetString(1);
385			if (!reader.IsDBNull(2)) entity.AssDgId = reader.GetString(2);
386			if (!reader.IsDBNull(3)) entity.DgName = reader.GetString(3);
387			if (!reader.IsDBNull(4)) entity.DgType = reader.GetString(4);
388			if (!reader.IsDBNull(5)) entity.AdiAttr = reader.GetInt32(5);
389			if (!reader.IsDBNull(6)) entity.AdsItemId = reader.GetString(6);
390			if (!reader.IsDBNull(7)) entity.AdsItemName = reader.GetString(7);
391			if (!reader.IsDBNull(8)) entity.Cj = reader.GetInt32(8);
392			if (!reader.IsDBNull(9)) entity.CjStyle = reader.GetInt32(9);
393			if (!reader.IsDBNull(10)) entity.Mcj = reader.GetInt32(10);
394			if (!reader.IsDBNull(11)) entity.CjStatus = reader.GetInt32(11);
395			if (!reader.IsDBNull(12)) entity.CrTime = reader.GetDateTime(12);
396			if (!reader.IsDBNull(13)) entity.CrUid = reader.GetString(13);
397			if (!reader.IsDBNull(14)) entity.LuUid = reader.GetString(14);
398			if (!reader.IsDBNull(15)) entity.LuTime = reader.GetDateTime(15);
399			if (!reader.IsDBNull(16)) entity.Rem = reader.GetString(16);
400		}
401		
402		
403
404        protected override DbCommand ConstructSelectConditionCommand(Database db, string condition)
405        {
406            return db.GetSqlStringCommand(SQL_SELECT + condition);
407        }
408		
409		#endregion	
410		
411		#region Count?? Helper
412
413        protected override DbCommand ConstructCountCommand(Database db)
414        {
415            return db.GetSqlStringCommand(SQL_COUNT);
416        }
417
418        protected override DbCommand ConstructCountConditionCommand(Database db, string condition)
419        {
420            return db.GetSqlStringCommand(SQL_COUNT + condition);
421        }
422
423		#endregion
424		
425		#region IsExist?? Helper
426
427        protected override DbCommand ConstructIsExistCommand(Database db, MoAssDgScore entity)
428        {
429            DbCommand dbCommand = db.GetSqlStringCommand(SQL_EXIST);
430			db.AddInParameter(dbCommand,"AksId",DbType.AnsiString,entity.AksId);
431			return dbCommand;
432        }
433
434		#endregion
435
436		
437		
438	}
439}	
440#endregion
441