PageRenderTime 102ms CodeModel.GetById 8ms app.highlight 81ms RepoModel.GetById 2ms app.codeStats 0ms

/Las/Las.Dal/DaLevelDeclare.auto.cs

http://sgsoft-las.googlecode.com/
C# | 738 lines | 657 code | 60 blank | 21 comment | 44 complexity | 1f66b8f0b954eb12eb90133c972052ca MD5 | raw file
Possible License(s): LGPL-2.1
  1#region DaLevelDeclare
  2/*----------------------------------------------------------------
  3// ????DaLevelDeclare.cs
  4// ??????LevelDeclare??????
  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	///?????????,ILevelDeclare ,???????DaBase?
 29	///DaBase????DbException????????
 30    public	partial  class DaLevelDeclare:DaBase<MoLevelDeclare>
 31    {	 
 32		#region SQL const
 33		internal const string TABLE_COLUMNS=" LEV_DCL_ID ,YEAR_NUM ,ITEM_TYPE ,ITEM_ID ,ITEM_NAME ,CLASS1 ,CLASS2 ,CLASS3 ,CLASS4 ,CLASS5 ,CLASS6 ,CLASS7 ,CLASS8 ,CLASS9 ,CLASS10 ,CLASS11 ,CLASS12 ,FROM_YEAR ,FROM_LEVEL ,TO_LEVEL ,APPROVE_LEV ,SBDW_ID ,SBDW_NAME ,SLDW_ID ,SBR_ID ,SBR_NAME ,SLDW_NAME ,SBSJ ,LEV_DCL_STATUS ,SCR_ID ,SCR_NAME ,SCSJ ,ASS_GRP_ID ,ASS_GRP_NAME ,ASS_GRP_SCORE ,KCR_ID ,KCR_NAME ,KCSJ ,PDR_ID ,PDR_NAME ,PDSJ ,ZGSCQK ,ZGSBQK ,DJKCQK   ";
 34		
 35		internal const string SQL_INSERT="INSERT INTO LA_LEVEL_DECLARE ("+TABLE_COLUMNS+") VALUES (@LevDclId,@YearNum,@ItemType,@ItemId,@ItemName,@Class1,@Class2,@Class3,@Class4,@Class5,@Class6,@Class7,@Class8,@Class9,@Class10,@Class11,@Class12,@FromYear,@FromLevel,@ToLevel,@ApproveLev,@SbdwId,@SbdwName,@SldwId,@SbrId,@SbrName,@SldwName,@Sbsj,@LevDclStatus,@ScrId,@ScrName,@Scsj,@AssGrpId,@AssGrpName,@AssGrpScore,@KcrId,@KcrName,@Kcsj,@PdrId,@PdrName,@Pdsj,@Zgscqk,@Zgsbqk,@Djkcqk)";
 36		internal const string SQL_SELECT="SELECT "+TABLE_COLUMNS+" FROM LA_LEVEL_DECLARE  ";
 37		internal const string SQL_SELECT_ONE=SQL_SELECT+" WHERE LEV_DCL_ID=@LevDclId";                              
 38		
 39		internal const string SQL_EXIST="SELECT COUNT(*) FROM LA_LEVEL_DECLARE  WHERE LEV_DCL_ID=@LevDclId  ";
 40		internal const string SQL_UPDATE="UPDATE LA_LEVEL_DECLARE SET YEAR_NUM=@YearNum, ITEM_TYPE=@ItemType, ITEM_ID=@ItemId, ITEM_NAME=@ItemName, CLASS1=@Class1, CLASS2=@Class2, CLASS3=@Class3, CLASS4=@Class4, CLASS5=@Class5, CLASS6=@Class6, CLASS7=@Class7, CLASS8=@Class8, CLASS9=@Class9, CLASS10=@Class10, CLASS11=@Class11, CLASS12=@Class12, FROM_YEAR=@FromYear, FROM_LEVEL=@FromLevel, TO_LEVEL=@ToLevel, APPROVE_LEV=@ApproveLev, SBDW_ID=@SbdwId, SBDW_NAME=@SbdwName, SLDW_ID=@SldwId, SBR_ID=@SbrId, SBR_NAME=@SbrName, SLDW_NAME=@SldwName, SBSJ=@Sbsj, LEV_DCL_STATUS=@LevDclStatus, SCR_ID=@ScrId, SCR_NAME=@ScrName, SCSJ=@Scsj, ASS_GRP_ID=@AssGrpId, ASS_GRP_NAME=@AssGrpName, ASS_GRP_SCORE=@AssGrpScore, KCR_ID=@KcrId, KCR_NAME=@KcrName, KCSJ=@Kcsj, PDR_ID=@PdrId, PDR_NAME=@PdrName, PDSJ=@Pdsj, ZGSCQK=@Zgscqk, ZGSBQK=@Zgsbqk, DJKCQK=@Djkcqk WHERE LEV_DCL_ID=@LevDclId";
 41		
 42		internal const string SQL_DELETE_DEFAULT = "DELETE FROM LA_LEVEL_DECLARE ";
 43		internal const string SQL_DELETE="DELETE FROM LA_LEVEL_DECLARE WHERE LEV_DCL_ID=@LevDclId";
 44		
 45		internal const string SQL_COUNT="SELECT COUNT(*) FROM LA_LEVEL_DECLARE";
 46		#endregion
 47		       
 48		#region Constructor
 49	 
 50		/// <summary>
 51        /// ???????????????????????
 52        /// </summary>
 53		public DaLevelDeclare ()
 54		{ 
 55			this.db=DatabaseFactory.CreateDatabase();
 56		}
 57		/// <summary>
 58        /// ?????databaseName??????
 59        /// </summary>
 60        /// <param name="databaseName">??????????????</param>
 61		public DaLevelDeclare (string databaseName)
 62		{ 
 63            this.db = DatabaseFactory.CreateDatabase(databaseName);
 64		} 
 65		
 66		public DaLevelDeclare (Database db)
 67		{ 
 68            this.db = db;
 69		} 
 70		
 71		#endregion
 72		
 73		//???CRUD??????????????????
 74
 75		#region ?????
 76		
 77        protected override MoLevelDeclare ConstructT()
 78        {
 79            return new MoLevelDeclare();
 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,"LevDclId",DbType.AnsiString);
 93			db.AddInParameter(dbCommand,"YearNum",DbType.Int32);
 94			db.AddInParameter(dbCommand,"ItemType",DbType.Int32);
 95			db.AddInParameter(dbCommand,"ItemId",DbType.AnsiString);
 96			db.AddInParameter(dbCommand,"ItemName",DbType.String);
 97			db.AddInParameter(dbCommand,"Class1",DbType.AnsiString);
 98			db.AddInParameter(dbCommand,"Class2",DbType.AnsiString);
 99			db.AddInParameter(dbCommand,"Class3",DbType.AnsiString);
100			db.AddInParameter(dbCommand,"Class4",DbType.AnsiString);
101			db.AddInParameter(dbCommand,"Class5",DbType.AnsiString);
102			db.AddInParameter(dbCommand,"Class6",DbType.AnsiString);
103			db.AddInParameter(dbCommand,"Class7",DbType.AnsiString);
104			db.AddInParameter(dbCommand,"Class8",DbType.AnsiString);
105			db.AddInParameter(dbCommand,"Class9",DbType.AnsiString);
106			db.AddInParameter(dbCommand,"Class10",DbType.AnsiString);
107			db.AddInParameter(dbCommand,"Class11",DbType.AnsiString);
108			db.AddInParameter(dbCommand,"Class12",DbType.AnsiString);
109			db.AddInParameter(dbCommand,"FromYear",DbType.Int32);
110			db.AddInParameter(dbCommand,"FromLevel",DbType.Int32);
111			db.AddInParameter(dbCommand,"ToLevel",DbType.Int32);
112			db.AddInParameter(dbCommand,"ApproveLev",DbType.Int32);
113			db.AddInParameter(dbCommand,"SbdwId",DbType.AnsiString);
114			db.AddInParameter(dbCommand,"SbdwName",DbType.String);
115			db.AddInParameter(dbCommand,"SldwId",DbType.AnsiString);
116			db.AddInParameter(dbCommand,"SbrId",DbType.AnsiString);
117			db.AddInParameter(dbCommand,"SbrName",DbType.String);
118			db.AddInParameter(dbCommand,"SldwName",DbType.String);
119			db.AddInParameter(dbCommand,"Sbsj",DbType.DateTime);
120			db.AddInParameter(dbCommand,"LevDclStatus",DbType.Int32);
121			db.AddInParameter(dbCommand,"ScrId",DbType.AnsiString);
122			db.AddInParameter(dbCommand,"ScrName",DbType.String);
123			db.AddInParameter(dbCommand,"Scsj",DbType.DateTime);
124			db.AddInParameter(dbCommand,"AssGrpId",DbType.AnsiString);
125			db.AddInParameter(dbCommand,"AssGrpName",DbType.String);
126			db.AddInParameter(dbCommand,"AssGrpScore",DbType.Int32);
127			db.AddInParameter(dbCommand,"KcrId",DbType.AnsiString);
128			db.AddInParameter(dbCommand,"KcrName",DbType.String);
129			db.AddInParameter(dbCommand,"Kcsj",DbType.DateTime);
130			db.AddInParameter(dbCommand,"PdrId",DbType.AnsiString);
131			db.AddInParameter(dbCommand,"PdrName",DbType.String);
132			db.AddInParameter(dbCommand,"Pdsj",DbType.DateTime);
133			db.AddInParameter(dbCommand,"Zgscqk",DbType.String);
134			db.AddInParameter(dbCommand,"Zgsbqk",DbType.String);
135			db.AddInParameter(dbCommand,"Djkcqk",DbType.String);
136			return dbCommand;
137		}		
138		protected override DbCommand ConstructAddCommand(Database db,MoLevelDeclare entity)
139		{
140			DbCommand dbCommand=db.GetSqlStringCommand(SQL_INSERT);			 
141			db.AddInParameter(dbCommand,"LevDclId",DbType.AnsiString,entity.LevDclId);
142			db.AddInParameter(dbCommand,"YearNum",DbType.Int32,entity.YearNum);
143			db.AddInParameter(dbCommand,"ItemType",DbType.Int32,entity.ItemType);
144			db.AddInParameter(dbCommand,"ItemId",DbType.AnsiString,entity.ItemId);
145			db.AddInParameter(dbCommand,"ItemName",DbType.String,entity.ItemName);
146			db.AddInParameter(dbCommand,"Class1",DbType.AnsiString,entity.Class1);
147			db.AddInParameter(dbCommand,"Class2",DbType.AnsiString,entity.Class2);
148			db.AddInParameter(dbCommand,"Class3",DbType.AnsiString,entity.Class3);
149			db.AddInParameter(dbCommand,"Class4",DbType.AnsiString,entity.Class4);
150			db.AddInParameter(dbCommand,"Class5",DbType.AnsiString,entity.Class5);
151			db.AddInParameter(dbCommand,"Class6",DbType.AnsiString,entity.Class6);
152			db.AddInParameter(dbCommand,"Class7",DbType.AnsiString,entity.Class7);
153			db.AddInParameter(dbCommand,"Class8",DbType.AnsiString,entity.Class8);
154			db.AddInParameter(dbCommand,"Class9",DbType.AnsiString,entity.Class9);
155			db.AddInParameter(dbCommand,"Class10",DbType.AnsiString,entity.Class10);
156			db.AddInParameter(dbCommand,"Class11",DbType.AnsiString,entity.Class11);
157			db.AddInParameter(dbCommand,"Class12",DbType.AnsiString,entity.Class12);
158			db.AddInParameter(dbCommand,"FromYear",DbType.Int32,entity.FromYear);
159			db.AddInParameter(dbCommand,"FromLevel",DbType.Int32,entity.FromLevel);
160			db.AddInParameter(dbCommand,"ToLevel",DbType.Int32,entity.ToLevel);
161			db.AddInParameter(dbCommand,"ApproveLev",DbType.Int32,entity.ApproveLev);
162			db.AddInParameter(dbCommand,"SbdwId",DbType.AnsiString,entity.SbdwId);
163			db.AddInParameter(dbCommand,"SbdwName",DbType.String,entity.SbdwName);
164			db.AddInParameter(dbCommand,"SldwId",DbType.AnsiString,entity.SldwId);
165			db.AddInParameter(dbCommand,"SbrId",DbType.AnsiString,entity.SbrId);
166			db.AddInParameter(dbCommand,"SbrName",DbType.String,entity.SbrName);
167			db.AddInParameter(dbCommand,"SldwName",DbType.String,entity.SldwName);
168			db.AddInParameter(dbCommand,"Sbsj",DbType.DateTime,entity.Sbsj);
169			db.AddInParameter(dbCommand,"LevDclStatus",DbType.Int32,entity.LevDclStatus);
170			db.AddInParameter(dbCommand,"ScrId",DbType.AnsiString,entity.ScrId);
171			db.AddInParameter(dbCommand,"ScrName",DbType.String,entity.ScrName);
172			db.AddInParameter(dbCommand,"Scsj",DbType.DateTime,entity.Scsj);
173			db.AddInParameter(dbCommand,"AssGrpId",DbType.AnsiString,entity.AssGrpId);
174			db.AddInParameter(dbCommand,"AssGrpName",DbType.String,entity.AssGrpName);
175			db.AddInParameter(dbCommand,"AssGrpScore",DbType.Int32,entity.AssGrpScore);
176			db.AddInParameter(dbCommand,"KcrId",DbType.AnsiString,entity.KcrId);
177			db.AddInParameter(dbCommand,"KcrName",DbType.String,entity.KcrName);
178			db.AddInParameter(dbCommand,"Kcsj",DbType.DateTime,entity.Kcsj);
179			db.AddInParameter(dbCommand,"PdrId",DbType.AnsiString,entity.PdrId);
180			db.AddInParameter(dbCommand,"PdrName",DbType.String,entity.PdrName);
181			db.AddInParameter(dbCommand,"Pdsj",DbType.DateTime,entity.Pdsj);
182			db.AddInParameter(dbCommand,"Zgscqk",DbType.String,entity.Zgscqk);
183			db.AddInParameter(dbCommand,"Zgsbqk",DbType.String,entity.Zgsbqk);
184			db.AddInParameter(dbCommand,"Djkcqk",DbType.String,entity.Djkcqk);
185			return dbCommand;
186		}
187		
188		protected override DbCommand PopulateAddCommandParameters(Database db,DbCommand addCmd,MoLevelDeclare entity)
189		{
190			db.SetParameterValue(addCmd,"LevDclId",entity.LevDclId);
191			db.SetParameterValue(addCmd,"YearNum",entity.YearNum);
192			db.SetParameterValue(addCmd,"ItemType",entity.ItemType);
193			db.SetParameterValue(addCmd,"ItemId",entity.ItemId);
194			db.SetParameterValue(addCmd,"ItemName",entity.ItemName);
195			db.SetParameterValue(addCmd,"Class1",entity.Class1);
196			db.SetParameterValue(addCmd,"Class2",entity.Class2);
197			db.SetParameterValue(addCmd,"Class3",entity.Class3);
198			db.SetParameterValue(addCmd,"Class4",entity.Class4);
199			db.SetParameterValue(addCmd,"Class5",entity.Class5);
200			db.SetParameterValue(addCmd,"Class6",entity.Class6);
201			db.SetParameterValue(addCmd,"Class7",entity.Class7);
202			db.SetParameterValue(addCmd,"Class8",entity.Class8);
203			db.SetParameterValue(addCmd,"Class9",entity.Class9);
204			db.SetParameterValue(addCmd,"Class10",entity.Class10);
205			db.SetParameterValue(addCmd,"Class11",entity.Class11);
206			db.SetParameterValue(addCmd,"Class12",entity.Class12);
207			db.SetParameterValue(addCmd,"FromYear",entity.FromYear);
208			db.SetParameterValue(addCmd,"FromLevel",entity.FromLevel);
209			db.SetParameterValue(addCmd,"ToLevel",entity.ToLevel);
210			db.SetParameterValue(addCmd,"ApproveLev",entity.ApproveLev);
211			db.SetParameterValue(addCmd,"SbdwId",entity.SbdwId);
212			db.SetParameterValue(addCmd,"SbdwName",entity.SbdwName);
213			db.SetParameterValue(addCmd,"SldwId",entity.SldwId);
214			db.SetParameterValue(addCmd,"SbrId",entity.SbrId);
215			db.SetParameterValue(addCmd,"SbrName",entity.SbrName);
216			db.SetParameterValue(addCmd,"SldwName",entity.SldwName);
217			db.SetParameterValue(addCmd,"Sbsj",entity.Sbsj);
218			db.SetParameterValue(addCmd,"LevDclStatus",entity.LevDclStatus);
219			db.SetParameterValue(addCmd,"ScrId",entity.ScrId);
220			db.SetParameterValue(addCmd,"ScrName",entity.ScrName);
221			db.SetParameterValue(addCmd,"Scsj",entity.Scsj);
222			db.SetParameterValue(addCmd,"AssGrpId",entity.AssGrpId);
223			db.SetParameterValue(addCmd,"AssGrpName",entity.AssGrpName);
224			db.SetParameterValue(addCmd,"AssGrpScore",entity.AssGrpScore);
225			db.SetParameterValue(addCmd,"KcrId",entity.KcrId);
226			db.SetParameterValue(addCmd,"KcrName",entity.KcrName);
227			db.SetParameterValue(addCmd,"Kcsj",entity.Kcsj);
228			db.SetParameterValue(addCmd,"PdrId",entity.PdrId);
229			db.SetParameterValue(addCmd,"PdrName",entity.PdrName);
230			db.SetParameterValue(addCmd,"Pdsj",entity.Pdsj);
231			db.SetParameterValue(addCmd,"Zgscqk",entity.Zgscqk);
232			db.SetParameterValue(addCmd,"Zgsbqk",entity.Zgsbqk);
233			db.SetParameterValue(addCmd,"Djkcqk",entity.Djkcqk);
234			return addCmd;
235		}
236		
237		protected override DbCommand PopulateAddCommandParameters(Database db,DbCommand addCmd,DataRow row)
238		{
239			db.SetParameterValue(addCmd,"LevDclId",row["LevDclId"]);
240			db.SetParameterValue(addCmd,"YearNum",row["YearNum"]);
241			db.SetParameterValue(addCmd,"ItemType",row["ItemType"]);
242			db.SetParameterValue(addCmd,"ItemId",row["ItemId"]);
243			db.SetParameterValue(addCmd,"ItemName",row["ItemName"]);
244			db.SetParameterValue(addCmd,"Class1",row["Class1"]);
245			db.SetParameterValue(addCmd,"Class2",row["Class2"]);
246			db.SetParameterValue(addCmd,"Class3",row["Class3"]);
247			db.SetParameterValue(addCmd,"Class4",row["Class4"]);
248			db.SetParameterValue(addCmd,"Class5",row["Class5"]);
249			db.SetParameterValue(addCmd,"Class6",row["Class6"]);
250			db.SetParameterValue(addCmd,"Class7",row["Class7"]);
251			db.SetParameterValue(addCmd,"Class8",row["Class8"]);
252			db.SetParameterValue(addCmd,"Class9",row["Class9"]);
253			db.SetParameterValue(addCmd,"Class10",row["Class10"]);
254			db.SetParameterValue(addCmd,"Class11",row["Class11"]);
255			db.SetParameterValue(addCmd,"Class12",row["Class12"]);
256			db.SetParameterValue(addCmd,"FromYear",row["FromYear"]);
257			db.SetParameterValue(addCmd,"FromLevel",row["FromLevel"]);
258			db.SetParameterValue(addCmd,"ToLevel",row["ToLevel"]);
259			db.SetParameterValue(addCmd,"ApproveLev",row["ApproveLev"]);
260			db.SetParameterValue(addCmd,"SbdwId",row["SbdwId"]);
261			db.SetParameterValue(addCmd,"SbdwName",row["SbdwName"]);
262			db.SetParameterValue(addCmd,"SldwId",row["SldwId"]);
263			db.SetParameterValue(addCmd,"SbrId",row["SbrId"]);
264			db.SetParameterValue(addCmd,"SbrName",row["SbrName"]);
265			db.SetParameterValue(addCmd,"SldwName",row["SldwName"]);
266			db.SetParameterValue(addCmd,"Sbsj",row["Sbsj"]);
267			db.SetParameterValue(addCmd,"LevDclStatus",row["LevDclStatus"]);
268			db.SetParameterValue(addCmd,"ScrId",row["ScrId"]);
269			db.SetParameterValue(addCmd,"ScrName",row["ScrName"]);
270			db.SetParameterValue(addCmd,"Scsj",row["Scsj"]);
271			db.SetParameterValue(addCmd,"AssGrpId",row["AssGrpId"]);
272			db.SetParameterValue(addCmd,"AssGrpName",row["AssGrpName"]);
273			db.SetParameterValue(addCmd,"AssGrpScore",row["AssGrpScore"]);
274			db.SetParameterValue(addCmd,"KcrId",row["KcrId"]);
275			db.SetParameterValue(addCmd,"KcrName",row["KcrName"]);
276			db.SetParameterValue(addCmd,"Kcsj",row["Kcsj"]);
277			db.SetParameterValue(addCmd,"PdrId",row["PdrId"]);
278			db.SetParameterValue(addCmd,"PdrName",row["PdrName"]);
279			db.SetParameterValue(addCmd,"Pdsj",row["Pdsj"]);
280			db.SetParameterValue(addCmd,"Zgscqk",row["Zgscqk"]);
281			db.SetParameterValue(addCmd,"Zgsbqk",row["Zgsbqk"]);
282			db.SetParameterValue(addCmd,"Djkcqk",row["Djkcqk"]);
283			return addCmd;
284		}
285		
286		#endregion
287		    
288		#region Update?? Helper
289		
290		protected override DbCommand ConstructUpdateCommand(Database db)
291		{
292			DbCommand dbCommand=db.GetSqlStringCommand(SQL_UPDATE);		    
293			db.AddInParameter(dbCommand,"YearNum",DbType.Int32);
294			db.AddInParameter(dbCommand,"ItemType",DbType.Int32);
295			db.AddInParameter(dbCommand,"ItemId",DbType.AnsiString);
296			db.AddInParameter(dbCommand,"ItemName",DbType.String);
297			db.AddInParameter(dbCommand,"Class1",DbType.AnsiString);
298			db.AddInParameter(dbCommand,"Class2",DbType.AnsiString);
299			db.AddInParameter(dbCommand,"Class3",DbType.AnsiString);
300			db.AddInParameter(dbCommand,"Class4",DbType.AnsiString);
301			db.AddInParameter(dbCommand,"Class5",DbType.AnsiString);
302			db.AddInParameter(dbCommand,"Class6",DbType.AnsiString);
303			db.AddInParameter(dbCommand,"Class7",DbType.AnsiString);
304			db.AddInParameter(dbCommand,"Class8",DbType.AnsiString);
305			db.AddInParameter(dbCommand,"Class9",DbType.AnsiString);
306			db.AddInParameter(dbCommand,"Class10",DbType.AnsiString);
307			db.AddInParameter(dbCommand,"Class11",DbType.AnsiString);
308			db.AddInParameter(dbCommand,"Class12",DbType.AnsiString);
309			db.AddInParameter(dbCommand,"FromYear",DbType.Int32);
310			db.AddInParameter(dbCommand,"FromLevel",DbType.Int32);
311			db.AddInParameter(dbCommand,"ToLevel",DbType.Int32);
312			db.AddInParameter(dbCommand,"ApproveLev",DbType.Int32);
313			db.AddInParameter(dbCommand,"SbdwId",DbType.AnsiString);
314			db.AddInParameter(dbCommand,"SbdwName",DbType.String);
315			db.AddInParameter(dbCommand,"SldwId",DbType.AnsiString);
316			db.AddInParameter(dbCommand,"SbrId",DbType.AnsiString);
317			db.AddInParameter(dbCommand,"SbrName",DbType.String);
318			db.AddInParameter(dbCommand,"SldwName",DbType.String);
319			db.AddInParameter(dbCommand,"Sbsj",DbType.DateTime);
320			db.AddInParameter(dbCommand,"LevDclStatus",DbType.Int32);
321			db.AddInParameter(dbCommand,"ScrId",DbType.AnsiString);
322			db.AddInParameter(dbCommand,"ScrName",DbType.String);
323			db.AddInParameter(dbCommand,"Scsj",DbType.DateTime);
324			db.AddInParameter(dbCommand,"AssGrpId",DbType.AnsiString);
325			db.AddInParameter(dbCommand,"AssGrpName",DbType.String);
326			db.AddInParameter(dbCommand,"AssGrpScore",DbType.Int32);
327			db.AddInParameter(dbCommand,"KcrId",DbType.AnsiString);
328			db.AddInParameter(dbCommand,"KcrName",DbType.String);
329			db.AddInParameter(dbCommand,"Kcsj",DbType.DateTime);
330			db.AddInParameter(dbCommand,"PdrId",DbType.AnsiString);
331			db.AddInParameter(dbCommand,"PdrName",DbType.String);
332			db.AddInParameter(dbCommand,"Pdsj",DbType.DateTime);
333			db.AddInParameter(dbCommand,"Zgscqk",DbType.String);
334			db.AddInParameter(dbCommand,"Zgsbqk",DbType.String);
335			db.AddInParameter(dbCommand,"Djkcqk",DbType.String);
336			db.AddInParameter(dbCommand,"LevDclId",DbType.AnsiString);
337			 
338			return dbCommand;
339		}
340		protected override DbCommand ConstructUpdateCommand(Database db,MoLevelDeclare entity)
341		{
342			DbCommand dbCommand=db.GetSqlStringCommand(SQL_UPDATE);		    
343			db.AddInParameter(dbCommand,"YearNum",DbType.Int32,entity.YearNum);
344			db.AddInParameter(dbCommand,"ItemType",DbType.Int32,entity.ItemType);
345			db.AddInParameter(dbCommand,"ItemId",DbType.AnsiString,entity.ItemId);
346			db.AddInParameter(dbCommand,"ItemName",DbType.String,entity.ItemName);
347			db.AddInParameter(dbCommand,"Class1",DbType.AnsiString,entity.Class1);
348			db.AddInParameter(dbCommand,"Class2",DbType.AnsiString,entity.Class2);
349			db.AddInParameter(dbCommand,"Class3",DbType.AnsiString,entity.Class3);
350			db.AddInParameter(dbCommand,"Class4",DbType.AnsiString,entity.Class4);
351			db.AddInParameter(dbCommand,"Class5",DbType.AnsiString,entity.Class5);
352			db.AddInParameter(dbCommand,"Class6",DbType.AnsiString,entity.Class6);
353			db.AddInParameter(dbCommand,"Class7",DbType.AnsiString,entity.Class7);
354			db.AddInParameter(dbCommand,"Class8",DbType.AnsiString,entity.Class8);
355			db.AddInParameter(dbCommand,"Class9",DbType.AnsiString,entity.Class9);
356			db.AddInParameter(dbCommand,"Class10",DbType.AnsiString,entity.Class10);
357			db.AddInParameter(dbCommand,"Class11",DbType.AnsiString,entity.Class11);
358			db.AddInParameter(dbCommand,"Class12",DbType.AnsiString,entity.Class12);
359			db.AddInParameter(dbCommand,"FromYear",DbType.Int32,entity.FromYear);
360			db.AddInParameter(dbCommand,"FromLevel",DbType.Int32,entity.FromLevel);
361			db.AddInParameter(dbCommand,"ToLevel",DbType.Int32,entity.ToLevel);
362			db.AddInParameter(dbCommand,"ApproveLev",DbType.Int32,entity.ApproveLev);
363			db.AddInParameter(dbCommand,"SbdwId",DbType.AnsiString,entity.SbdwId);
364			db.AddInParameter(dbCommand,"SbdwName",DbType.String,entity.SbdwName);
365			db.AddInParameter(dbCommand,"SldwId",DbType.AnsiString,entity.SldwId);
366			db.AddInParameter(dbCommand,"SbrId",DbType.AnsiString,entity.SbrId);
367			db.AddInParameter(dbCommand,"SbrName",DbType.String,entity.SbrName);
368			db.AddInParameter(dbCommand,"SldwName",DbType.String,entity.SldwName);
369			db.AddInParameter(dbCommand,"Sbsj",DbType.DateTime,entity.Sbsj);
370			db.AddInParameter(dbCommand,"LevDclStatus",DbType.Int32,entity.LevDclStatus);
371			db.AddInParameter(dbCommand,"ScrId",DbType.AnsiString,entity.ScrId);
372			db.AddInParameter(dbCommand,"ScrName",DbType.String,entity.ScrName);
373			db.AddInParameter(dbCommand,"Scsj",DbType.DateTime,entity.Scsj);
374			db.AddInParameter(dbCommand,"AssGrpId",DbType.AnsiString,entity.AssGrpId);
375			db.AddInParameter(dbCommand,"AssGrpName",DbType.String,entity.AssGrpName);
376			db.AddInParameter(dbCommand,"AssGrpScore",DbType.Int32,entity.AssGrpScore);
377			db.AddInParameter(dbCommand,"KcrId",DbType.AnsiString,entity.KcrId);
378			db.AddInParameter(dbCommand,"KcrName",DbType.String,entity.KcrName);
379			db.AddInParameter(dbCommand,"Kcsj",DbType.DateTime,entity.Kcsj);
380			db.AddInParameter(dbCommand,"PdrId",DbType.AnsiString,entity.PdrId);
381			db.AddInParameter(dbCommand,"PdrName",DbType.String,entity.PdrName);
382			db.AddInParameter(dbCommand,"Pdsj",DbType.DateTime,entity.Pdsj);
383			db.AddInParameter(dbCommand,"Zgscqk",DbType.String,entity.Zgscqk);
384			db.AddInParameter(dbCommand,"Zgsbqk",DbType.String,entity.Zgsbqk);
385			db.AddInParameter(dbCommand,"Djkcqk",DbType.String,entity.Djkcqk);
386			db.AddInParameter(dbCommand,"LevDclId",DbType.AnsiString,entity.LevDclId);
387			 
388			return dbCommand;
389		}
390		
391		protected override DbCommand PopulateUpdateCommandParameters(Database db,DbCommand updateCmd,MoLevelDeclare entity)
392		{
393			db.SetParameterValue(updateCmd,"YearNum",entity.YearNum);
394			db.SetParameterValue(updateCmd,"ItemType",entity.ItemType);
395			db.SetParameterValue(updateCmd,"ItemId",entity.ItemId);
396			db.SetParameterValue(updateCmd,"ItemName",entity.ItemName);
397			db.SetParameterValue(updateCmd,"Class1",entity.Class1);
398			db.SetParameterValue(updateCmd,"Class2",entity.Class2);
399			db.SetParameterValue(updateCmd,"Class3",entity.Class3);
400			db.SetParameterValue(updateCmd,"Class4",entity.Class4);
401			db.SetParameterValue(updateCmd,"Class5",entity.Class5);
402			db.SetParameterValue(updateCmd,"Class6",entity.Class6);
403			db.SetParameterValue(updateCmd,"Class7",entity.Class7);
404			db.SetParameterValue(updateCmd,"Class8",entity.Class8);
405			db.SetParameterValue(updateCmd,"Class9",entity.Class9);
406			db.SetParameterValue(updateCmd,"Class10",entity.Class10);
407			db.SetParameterValue(updateCmd,"Class11",entity.Class11);
408			db.SetParameterValue(updateCmd,"Class12",entity.Class12);
409			db.SetParameterValue(updateCmd,"FromYear",entity.FromYear);
410			db.SetParameterValue(updateCmd,"FromLevel",entity.FromLevel);
411			db.SetParameterValue(updateCmd,"ToLevel",entity.ToLevel);
412			db.SetParameterValue(updateCmd,"ApproveLev",entity.ApproveLev);
413			db.SetParameterValue(updateCmd,"SbdwId",entity.SbdwId);
414			db.SetParameterValue(updateCmd,"SbdwName",entity.SbdwName);
415			db.SetParameterValue(updateCmd,"SldwId",entity.SldwId);
416			db.SetParameterValue(updateCmd,"SbrId",entity.SbrId);
417			db.SetParameterValue(updateCmd,"SbrName",entity.SbrName);
418			db.SetParameterValue(updateCmd,"SldwName",entity.SldwName);
419			db.SetParameterValue(updateCmd,"Sbsj",entity.Sbsj);
420			db.SetParameterValue(updateCmd,"LevDclStatus",entity.LevDclStatus);
421			db.SetParameterValue(updateCmd,"ScrId",entity.ScrId);
422			db.SetParameterValue(updateCmd,"ScrName",entity.ScrName);
423			db.SetParameterValue(updateCmd,"Scsj",entity.Scsj);
424			db.SetParameterValue(updateCmd,"AssGrpId",entity.AssGrpId);
425			db.SetParameterValue(updateCmd,"AssGrpName",entity.AssGrpName);
426			db.SetParameterValue(updateCmd,"AssGrpScore",entity.AssGrpScore);
427			db.SetParameterValue(updateCmd,"KcrId",entity.KcrId);
428			db.SetParameterValue(updateCmd,"KcrName",entity.KcrName);
429			db.SetParameterValue(updateCmd,"Kcsj",entity.Kcsj);
430			db.SetParameterValue(updateCmd,"PdrId",entity.PdrId);
431			db.SetParameterValue(updateCmd,"PdrName",entity.PdrName);
432			db.SetParameterValue(updateCmd,"Pdsj",entity.Pdsj);
433			db.SetParameterValue(updateCmd,"Zgscqk",entity.Zgscqk);
434			db.SetParameterValue(updateCmd,"Zgsbqk",entity.Zgsbqk);
435			db.SetParameterValue(updateCmd,"Djkcqk",entity.Djkcqk);
436			db.SetParameterValue(updateCmd,"LevDclId",entity.LevDclId);
437			return updateCmd;
438		}
439		protected override DbCommand PopulateUpdateCommandParameters(Database db,DbCommand updateCmd,DataRow row)
440		{
441			db.SetParameterValue(updateCmd,"YearNum",row["YearNum"]);
442			db.SetParameterValue(updateCmd,"ItemType",row["ItemType"]);
443			db.SetParameterValue(updateCmd,"ItemId",row["ItemId"]);
444			db.SetParameterValue(updateCmd,"ItemName",row["ItemName"]);
445			db.SetParameterValue(updateCmd,"Class1",row["Class1"]);
446			db.SetParameterValue(updateCmd,"Class2",row["Class2"]);
447			db.SetParameterValue(updateCmd,"Class3",row["Class3"]);
448			db.SetParameterValue(updateCmd,"Class4",row["Class4"]);
449			db.SetParameterValue(updateCmd,"Class5",row["Class5"]);
450			db.SetParameterValue(updateCmd,"Class6",row["Class6"]);
451			db.SetParameterValue(updateCmd,"Class7",row["Class7"]);
452			db.SetParameterValue(updateCmd,"Class8",row["Class8"]);
453			db.SetParameterValue(updateCmd,"Class9",row["Class9"]);
454			db.SetParameterValue(updateCmd,"Class10",row["Class10"]);
455			db.SetParameterValue(updateCmd,"Class11",row["Class11"]);
456			db.SetParameterValue(updateCmd,"Class12",row["Class12"]);
457			db.SetParameterValue(updateCmd,"FromYear",row["FromYear"]);
458			db.SetParameterValue(updateCmd,"FromLevel",row["FromLevel"]);
459			db.SetParameterValue(updateCmd,"ToLevel",row["ToLevel"]);
460			db.SetParameterValue(updateCmd,"ApproveLev",row["ApproveLev"]);
461			db.SetParameterValue(updateCmd,"SbdwId",row["SbdwId"]);
462			db.SetParameterValue(updateCmd,"SbdwName",row["SbdwName"]);
463			db.SetParameterValue(updateCmd,"SldwId",row["SldwId"]);
464			db.SetParameterValue(updateCmd,"SbrId",row["SbrId"]);
465			db.SetParameterValue(updateCmd,"SbrName",row["SbrName"]);
466			db.SetParameterValue(updateCmd,"SldwName",row["SldwName"]);
467			db.SetParameterValue(updateCmd,"Sbsj",row["Sbsj"]);
468			db.SetParameterValue(updateCmd,"LevDclStatus",row["LevDclStatus"]);
469			db.SetParameterValue(updateCmd,"ScrId",row["ScrId"]);
470			db.SetParameterValue(updateCmd,"ScrName",row["ScrName"]);
471			db.SetParameterValue(updateCmd,"Scsj",row["Scsj"]);
472			db.SetParameterValue(updateCmd,"AssGrpId",row["AssGrpId"]);
473			db.SetParameterValue(updateCmd,"AssGrpName",row["AssGrpName"]);
474			db.SetParameterValue(updateCmd,"AssGrpScore",row["AssGrpScore"]);
475			db.SetParameterValue(updateCmd,"KcrId",row["KcrId"]);
476			db.SetParameterValue(updateCmd,"KcrName",row["KcrName"]);
477			db.SetParameterValue(updateCmd,"Kcsj",row["Kcsj"]);
478			db.SetParameterValue(updateCmd,"PdrId",row["PdrId"]);
479			db.SetParameterValue(updateCmd,"PdrName",row["PdrName"]);
480			db.SetParameterValue(updateCmd,"Pdsj",row["Pdsj"]);
481			db.SetParameterValue(updateCmd,"Zgscqk",row["Zgscqk"]);
482			db.SetParameterValue(updateCmd,"Zgsbqk",row["Zgsbqk"]);
483			db.SetParameterValue(updateCmd,"Djkcqk",row["Djkcqk"]);
484			db.SetParameterValue(updateCmd,"LevDclId",row["LevDclId"]);
485			return updateCmd;
486		}
487		
488		protected override void PrepareDataAdapterCommand(Database db,out DbCommand dbInsertCommand,
489		                     out DbCommand dbUpdateCommand,out DbCommand dbDeleteCommand)
490		{
491			dbInsertCommand = db.GetSqlStringCommand(SQL_INSERT);
492			#region set insert cmd parameters
493			db.AddInParameter(dbInsertCommand, "LevDclId",DbType.AnsiString, "LEV_DCL_ID", DataRowVersion.Current);
494			db.AddInParameter(dbInsertCommand, "YearNum",DbType.Int32, "YEAR_NUM", DataRowVersion.Current);
495			db.AddInParameter(dbInsertCommand, "ItemType",DbType.Int32, "ITEM_TYPE", DataRowVersion.Current);
496			db.AddInParameter(dbInsertCommand, "ItemId",DbType.AnsiString, "ITEM_ID", DataRowVersion.Current);
497			db.AddInParameter(dbInsertCommand, "ItemName",DbType.String, "ITEM_NAME", DataRowVersion.Current);
498			db.AddInParameter(dbInsertCommand, "Class1",DbType.AnsiString, "CLASS1", DataRowVersion.Current);
499			db.AddInParameter(dbInsertCommand, "Class2",DbType.AnsiString, "CLASS2", DataRowVersion.Current);
500			db.AddInParameter(dbInsertCommand, "Class3",DbType.AnsiString, "CLASS3", DataRowVersion.Current);
501			db.AddInParameter(dbInsertCommand, "Class4",DbType.AnsiString, "CLASS4", DataRowVersion.Current);
502			db.AddInParameter(dbInsertCommand, "Class5",DbType.AnsiString, "CLASS5", DataRowVersion.Current);
503			db.AddInParameter(dbInsertCommand, "Class6",DbType.AnsiString, "CLASS6", DataRowVersion.Current);
504			db.AddInParameter(dbInsertCommand, "Class7",DbType.AnsiString, "CLASS7", DataRowVersion.Current);
505			db.AddInParameter(dbInsertCommand, "Class8",DbType.AnsiString, "CLASS8", DataRowVersion.Current);
506			db.AddInParameter(dbInsertCommand, "Class9",DbType.AnsiString, "CLASS9", DataRowVersion.Current);
507			db.AddInParameter(dbInsertCommand, "Class10",DbType.AnsiString, "CLASS10", DataRowVersion.Current);
508			db.AddInParameter(dbInsertCommand, "Class11",DbType.AnsiString, "CLASS11", DataRowVersion.Current);
509			db.AddInParameter(dbInsertCommand, "Class12",DbType.AnsiString, "CLASS12", DataRowVersion.Current);
510			db.AddInParameter(dbInsertCommand, "FromYear",DbType.Int32, "FROM_YEAR", DataRowVersion.Current);
511			db.AddInParameter(dbInsertCommand, "FromLevel",DbType.Int32, "FROM_LEVEL", DataRowVersion.Current);
512			db.AddInParameter(dbInsertCommand, "ToLevel",DbType.Int32, "TO_LEVEL", DataRowVersion.Current);
513			db.AddInParameter(dbInsertCommand, "ApproveLev",DbType.Int32, "APPROVE_LEV", DataRowVersion.Current);
514			db.AddInParameter(dbInsertCommand, "SbdwId",DbType.AnsiString, "SBDW_ID", DataRowVersion.Current);
515			db.AddInParameter(dbInsertCommand, "SbdwName",DbType.String, "SBDW_NAME", DataRowVersion.Current);
516			db.AddInParameter(dbInsertCommand, "SldwId",DbType.AnsiString, "SLDW_ID", DataRowVersion.Current);
517			db.AddInParameter(dbInsertCommand, "SbrId",DbType.AnsiString, "SBR_ID", DataRowVersion.Current);
518			db.AddInParameter(dbInsertCommand, "SbrName",DbType.String, "SBR_NAME", DataRowVersion.Current);
519			db.AddInParameter(dbInsertCommand, "SldwName",DbType.String, "SLDW_NAME", DataRowVersion.Current);
520			db.AddInParameter(dbInsertCommand, "Sbsj",DbType.DateTime, "SBSJ", DataRowVersion.Current);
521			db.AddInParameter(dbInsertCommand, "LevDclStatus",DbType.Int32, "LEV_DCL_STATUS", DataRowVersion.Current);
522			db.AddInParameter(dbInsertCommand, "ScrId",DbType.AnsiString, "SCR_ID", DataRowVersion.Current);
523			db.AddInParameter(dbInsertCommand, "ScrName",DbType.String, "SCR_NAME", DataRowVersion.Current);
524			db.AddInParameter(dbInsertCommand, "Scsj",DbType.DateTime, "SCSJ", DataRowVersion.Current);
525			db.AddInParameter(dbInsertCommand, "AssGrpId",DbType.AnsiString, "ASS_GRP_ID", DataRowVersion.Current);
526			db.AddInParameter(dbInsertCommand, "AssGrpName",DbType.String, "ASS_GRP_NAME", DataRowVersion.Current);
527			db.AddInParameter(dbInsertCommand, "AssGrpScore",DbType.Int32, "ASS_GRP_SCORE", DataRowVersion.Current);
528			db.AddInParameter(dbInsertCommand, "KcrId",DbType.AnsiString, "KCR_ID", DataRowVersion.Current);
529			db.AddInParameter(dbInsertCommand, "KcrName",DbType.String, "KCR_NAME", DataRowVersion.Current);
530			db.AddInParameter(dbInsertCommand, "Kcsj",DbType.DateTime, "KCSJ", DataRowVersion.Current);
531			db.AddInParameter(dbInsertCommand, "PdrId",DbType.AnsiString, "PDR_ID", DataRowVersion.Current);
532			db.AddInParameter(dbInsertCommand, "PdrName",DbType.String, "PDR_NAME", DataRowVersion.Current);
533			db.AddInParameter(dbInsertCommand, "Pdsj",DbType.DateTime, "PDSJ", DataRowVersion.Current);
534			db.AddInParameter(dbInsertCommand, "Zgscqk",DbType.String, "ZGSCQK", DataRowVersion.Current);
535			db.AddInParameter(dbInsertCommand, "Zgsbqk",DbType.String, "ZGSBQK", DataRowVersion.Current);
536			db.AddInParameter(dbInsertCommand, "Djkcqk",DbType.String, "DJKCQK", DataRowVersion.Current);
537			#endregion
538			dbUpdateCommand = db.GetSqlStringCommand(SQL_UPDATE);
539			#region Set update cmd value parameters
540			db.AddInParameter(dbUpdateCommand, "YearNum", DbType.Int32, "YEAR_NUM", DataRowVersion.Current);
541			db.AddInParameter(dbUpdateCommand, "ItemType", DbType.Int32, "ITEM_TYPE", DataRowVersion.Current);
542			db.AddInParameter(dbUpdateCommand, "ItemId", DbType.AnsiString, "ITEM_ID", DataRowVersion.Current);
543			db.AddInParameter(dbUpdateCommand, "ItemName", DbType.String, "ITEM_NAME", DataRowVersion.Current);
544			db.AddInParameter(dbUpdateCommand, "Class1", DbType.AnsiString, "CLASS1", DataRowVersion.Current);
545			db.AddInParameter(dbUpdateCommand, "Class2", DbType.AnsiString, "CLASS2", DataRowVersion.Current);
546			db.AddInParameter(dbUpdateCommand, "Class3", DbType.AnsiString, "CLASS3", DataRowVersion.Current);
547			db.AddInParameter(dbUpdateCommand, "Class4", DbType.AnsiString, "CLASS4", DataRowVersion.Current);
548			db.AddInParameter(dbUpdateCommand, "Class5", DbType.AnsiString, "CLASS5", DataRowVersion.Current);
549			db.AddInParameter(dbUpdateCommand, "Class6", DbType.AnsiString, "CLASS6", DataRowVersion.Current);
550			db.AddInParameter(dbUpdateCommand, "Class7", DbType.AnsiString, "CLASS7", DataRowVersion.Current);
551			db.AddInParameter(dbUpdateCommand, "Class8", DbType.AnsiString, "CLASS8", DataRowVersion.Current);
552			db.AddInParameter(dbUpdateCommand, "Class9", DbType.AnsiString, "CLASS9", DataRowVersion.Current);
553			db.AddInParameter(dbUpdateCommand, "Class10", DbType.AnsiString, "CLASS10", DataRowVersion.Current);
554			db.AddInParameter(dbUpdateCommand, "Class11", DbType.AnsiString, "CLASS11", DataRowVersion.Current);
555			db.AddInParameter(dbUpdateCommand, "Class12", DbType.AnsiString, "CLASS12", DataRowVersion.Current);
556			db.AddInParameter(dbUpdateCommand, "FromYear", DbType.Int32, "FROM_YEAR", DataRowVersion.Current);
557			db.AddInParameter(dbUpdateCommand, "FromLevel", DbType.Int32, "FROM_LEVEL", DataRowVersion.Current);
558			db.AddInParameter(dbUpdateCommand, "ToLevel", DbType.Int32, "TO_LEVEL", DataRowVersion.Current);
559			db.AddInParameter(dbUpdateCommand, "ApproveLev", DbType.Int32, "APPROVE_LEV", DataRowVersion.Current);
560			db.AddInParameter(dbUpdateCommand, "SbdwId", DbType.AnsiString, "SBDW_ID", DataRowVersion.Current);
561			db.AddInParameter(dbUpdateCommand, "SbdwName", DbType.String, "SBDW_NAME", DataRowVersion.Current);
562			db.AddInParameter(dbUpdateCommand, "SldwId", DbType.AnsiString, "SLDW_ID", DataRowVersion.Current);
563			db.AddInParameter(dbUpdateCommand, "SbrId", DbType.AnsiString, "SBR_ID", DataRowVersion.Current);
564			db.AddInParameter(dbUpdateCommand, "SbrName", DbType.String, "SBR_NAME", DataRowVersion.Current);
565			db.AddInParameter(dbUpdateCommand, "SldwName", DbType.String, "SLDW_NAME", DataRowVersion.Current);
566			db.AddInParameter(dbUpdateCommand, "Sbsj", DbType.DateTime, "SBSJ", DataRowVersion.Current);
567			db.AddInParameter(dbUpdateCommand, "LevDclStatus", DbType.Int32, "LEV_DCL_STATUS", DataRowVersion.Current);
568			db.AddInParameter(dbUpdateCommand, "ScrId", DbType.AnsiString, "SCR_ID", DataRowVersion.Current);
569			db.AddInParameter(dbUpdateCommand, "ScrName", DbType.String, "SCR_NAME", DataRowVersion.Current);
570			db.AddInParameter(dbUpdateCommand, "Scsj", DbType.DateTime, "SCSJ", DataRowVersion.Current);
571			db.AddInParameter(dbUpdateCommand, "AssGrpId", DbType.AnsiString, "ASS_GRP_ID", DataRowVersion.Current);
572			db.AddInParameter(dbUpdateCommand, "AssGrpName", DbType.String, "ASS_GRP_NAME", DataRowVersion.Current);
573			db.AddInParameter(dbUpdateCommand, "AssGrpScore", DbType.Int32, "ASS_GRP_SCORE", DataRowVersion.Current);
574			db.AddInParameter(dbUpdateCommand, "KcrId", DbType.AnsiString, "KCR_ID", DataRowVersion.Current);
575			db.AddInParameter(dbUpdateCommand, "KcrName", DbType.String, "KCR_NAME", DataRowVersion.Current);
576			db.AddInParameter(dbUpdateCommand, "Kcsj", DbType.DateTime, "KCSJ", DataRowVersion.Current);
577			db.AddInParameter(dbUpdateCommand, "PdrId", DbType.AnsiString, "PDR_ID", DataRowVersion.Current);
578			db.AddInParameter(dbUpdateCommand, "PdrName", DbType.String, "PDR_NAME", DataRowVersion.Current);
579			db.AddInParameter(dbUpdateCommand, "Pdsj", DbType.DateTime, "PDSJ", DataRowVersion.Current);
580			db.AddInParameter(dbUpdateCommand, "Zgscqk", DbType.String, "ZGSCQK", DataRowVersion.Current);
581			db.AddInParameter(dbUpdateCommand, "Zgsbqk", DbType.String, "ZGSBQK", DataRowVersion.Current);
582			db.AddInParameter(dbUpdateCommand, "Djkcqk", DbType.String, "DJKCQK", DataRowVersion.Current);
583			#endregion
584			#region set update cmd pk where parameters
585			db.AddInParameter(dbUpdateCommand, "LevDclId", DbType.AnsiString, "LEV_DCL_ID", DataRowVersion.Current);
586			#endregion			
587			dbDeleteCommand = db.GetSqlStringCommand(SQL_DELETE);
588			#region set delete cmd pk where parameters
589			db.AddInParameter(dbDeleteCommand, "LevDclId", DbType.AnsiString, "LEV_DCL_ID", DataRowVersion.Current);
590			#endregion
591		}
592		#endregion	
593		
594		#region Delete?? Helper		
595		
596		protected override DbCommand ConstructDeleteCommand(Database db)
597		{
598			DbCommand dbCommand=db.GetSqlStringCommand(SQL_DELETE);
599			 
600			db.AddInParameter(dbCommand,"LevDclId",DbType.AnsiString);
601			 
602			return dbCommand;
603		}		
604		protected override DbCommand ConstructDeleteCommand(Database db,MoLevelDeclare entity)
605		{
606			DbCommand dbCommand=db.GetSqlStringCommand(SQL_DELETE);
607			 
608			db.AddInParameter(dbCommand,"LevDclId",DbType.AnsiString,entity.LevDclId);
609		 
610			return dbCommand;
611		}
612		
613		protected override DbCommand ConstructDeleteCommandForWhere(Database db, string where)
614        {
615            return db.GetSqlStringCommand(SQL_DELETE_DEFAULT + where);            
616        }
617
618        protected override DbCommand PopulateDeleteCommandParameters(Database db, DbCommand deleteCmd, MoLevelDeclare entity)
619        {
620			db.SetParameterValue(deleteCmd,"LevDclId",entity.LevDclId);
621			return deleteCmd;
622        }
623
624        protected override DbCommand PopulateDeleteCommandParameters(Database db, DbCommand deleteCmd, DataRow row)
625        {
626			db.SetParameterValue(deleteCmd,"LevDclId",row["LevDclId"]);
627			return deleteCmd;
628        }      
629		
630		#endregion helper
631		
632		#region Query?? Helper
633
634        protected override DbCommand ConstructQueryCommand(string condition)
635        {
636            return db.GetSqlStringCommand(SQL_SELECT + condition);
637        }
638
639        #endregion
640		
641		#region GetEntity(s)?? Helper
642        
643		protected override DbCommand ConstructSelectOneCommand(Database db,MoLevelDeclare entity)
644		{
645			DbCommand dbCommand=db.GetSqlStringCommand(SQL_SELECT_ONE);
646			 
647			db.AddInParameter(dbCommand,"LevDclId",DbType.AnsiString,entity.LevDclId);
648			return dbCommand;
649		}
650		
651		protected override void PopulateEntityByDataReader(IDataReader reader,ref MoLevelDeclare entity)
652		{
653			if (!reader.IsDBNull(0)) entity.LevDclId = reader.GetString(0);
654			if (!reader.IsDBNull(1)) entity.YearNum = reader.GetInt32(1);
655			if (!reader.IsDBNull(2)) entity.ItemType = reader.GetInt32(2);
656			if (!reader.IsDBNull(3)) entity.ItemId = reader.GetString(3);
657			if (!reader.IsDBNull(4)) entity.ItemName = reader.GetString(4);
658			if (!reader.IsDBNull(5)) entity.Class1 = reader.GetString(5);
659			if (!reader.IsDBNull(6)) entity.Class2 = reader.GetString(6);
660			if (!reader.IsDBNull(7)) entity.Class3 = reader.GetString(7);
661			if (!reader.IsDBNull(8)) entity.Class4 = reader.GetString(8);
662			if (!reader.IsDBNull(9)) entity.Class5 = reader.GetString(9);
663			if (!reader.IsDBNull(10)) entity.Class6 = reader.GetString(10);
664			if (!reader.IsDBNull(11)) entity.Class7 = reader.GetString(11);
665			if (!reader.IsDBNull(12)) entity.Class8 = reader.GetString(12);
666			if (!reader.IsDBNull(13)) entity.Class9 = reader.GetString(13);
667			if (!reader.IsDBNull(14)) entity.Class10 = reader.GetString(14);
668			if (!reader.IsDBNull(15)) entity.Class11 = reader.GetString(15);
669			if (!reader.IsDBNull(16)) entity.Class12 = reader.GetString(16);
670			if (!reader.IsDBNull(17)) entity.FromYear = reader.GetInt32(17);
671			if (!reader.IsDBNull(18)) entity.FromLevel = reader.GetInt32(18);
672			if (!reader.IsDBNull(19)) entity.ToLevel = reader.GetInt32(19);
673			if (!reader.IsDBNull(20)) entity.ApproveLev = reader.GetInt32(20);
674			if (!reader.IsDBNull(21)) entity.SbdwId = reader.GetString(21);
675			if (!reader.IsDBNull(22)) entity.SbdwName = reader.GetString(22);
676			if (!reader.IsDBNull(23)) entity.SldwId = reader.GetString(23);
677			if (!reader.IsDBNull(24)) entity.SbrId = reader.GetString(24);
678			if (!reader.IsDBNull(25)) entity.SbrName = reader.GetString(25);
679			if (!reader.IsDBNull(26)) entity.SldwName = reader.GetString(26);
680			if (!reader.IsDBNull(27)) entity.Sbsj = reader.GetDateTime(27);
681			if (!reader.IsDBNull(28)) entity.LevDclStatus = reader.GetInt32(28);
682			if (!reader.IsDBNull(29)) entity.ScrId = reader.GetString(29);
683			if (!reader.IsDBNull(30)) entity.ScrName = reader.GetString(30);
684			if (!reader.IsDBNull(31)) entity.Scsj = reader.GetDateTime(31);
685			if (!reader.IsDBNull(32)) entity.AssGrpId = reader.GetString(32);
686			if (!reader.IsDBNull(33)) entity.AssGrpName = reader.GetString(33);
687			if (!reader.IsDBNull(34)) entity.AssGrpScore = reader.GetInt32(34);
688			if (!reader.IsDBNull(35)) entity.KcrId = reader.GetString(35);
689			if (!reader.IsDBNull(36)) entity.KcrName = reader.GetString(36);
690			if (!reader.IsDBNull(37)) entity.Kcsj = reader.GetDateTime(37);
691			if (!reader.IsDBNull(38)) entity.PdrId = reader.GetString(38);
692			if (!reader.IsDBNull(39)) entity.PdrName = reader.GetString(39);
693			if (!reader.IsDBNull(40)) entity.Pdsj = reader.GetDateTime(40);
694			if (!reader.IsDBNull(41)) entity.Zgscqk = reader.GetString(41);
695			if (!reader.IsDBNull(42)) entity.Zgsbqk = reader.GetString(42);
696			if (!reader.IsDBNull(43)) entity.Djkcqk = reader.GetString(43);
697		}
698		
699		
700
701        protected override DbCommand ConstructSelectConditionCommand(Database db, string condition)
702        {
703            return db.GetSqlStringCommand(SQL_SELECT + condition);
704        }
705		
706		#endregion	
707		
708		#region Count?? Helper
709
710        protected override DbCommand ConstructCountCommand(Database db)
711        {
712            return db.GetSqlStringCommand(SQL_COUNT);
713        }
714
715        protected override DbCommand ConstructCountConditionCommand(Database db, string condition)
716        {
717            return db.GetSqlStringCommand(SQL_COUNT + condition);
718        }
719
720		#endregion
721		
722		#region IsExist?? Helper
723
724        protected override DbCommand ConstructIsExistCommand(Database db, MoLevelDeclare entity)
725        {
726            DbCommand dbCommand = db.GetSqlStringCommand(SQL_EXIST);
727			db.AddInParameter(dbCommand,"LevDclId",DbType.AnsiString,entity.LevDclId);
728			return dbCommand;
729        }
730
731		#endregion
732
733		
734		
735	}
736}	
737#endregion
738