104 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			104 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			C#
		
	
	
	
| using System;
 | ||
| using System.Collections.Generic;
 | ||
| using System.Text;
 | ||
| using System.Data;
 | ||
| using System.Configuration;
 | ||
| using Tracen.Data.BaseObject;
 | ||
| 
 | ||
| 
 | ||
| namespace myLlog
 | ||
| {
 | ||
|     public abstract class BaseModel  
 | ||
|     {
 | ||
|         protected internal Object[] cmdParameters = new Object[10];
 | ||
|         protected internal int _id;
 | ||
| 
 | ||
|         public Object[] CmdParameters
 | ||
|         {
 | ||
|             get
 | ||
|             {
 | ||
|                 return cmdParameters;
 | ||
|             }
 | ||
| 
 | ||
|         }
 | ||
| 
 | ||
|         public int ID
 | ||
|         {
 | ||
|             get { return _id; }
 | ||
|             set { _id = value; }
 | ||
|         }
 | ||
|         internal int custOperFlag;     
 | ||
|         public BaseModel()
 | ||
|         {
 | ||
|             getImp();
 | ||
|         }
 | ||
|         BaseModel_Imp model_imp;
 | ||
|         public int Add()
 | ||
|         {
 | ||
|             return model_imp.Add(this);
 | ||
|         }
 | ||
| 
 | ||
|         public int Update()
 | ||
|         {
 | ||
|             return model_imp.Update(this);
 | ||
|         }
 | ||
| 
 | ||
|         public int Delete()
 | ||
|         {
 | ||
|             return model_imp.Delete(this);
 | ||
|         }
 | ||
| 
 | ||
|         public DataSet QueryActived()
 | ||
|         {
 | ||
|             return model_imp.QueryActived();
 | ||
|         }
 | ||
|         public DataSet Query(BaseModel exampleObj)
 | ||
|         {
 | ||
|             return model_imp.Query(exampleObj);
 | ||
|         }
 | ||
|         public DataSet Query()
 | ||
|         {
 | ||
|             return model_imp.Query();
 | ||
|         }
 | ||
|         protected DataSet CustQuery(int custOperFlag)
 | ||
|         {
 | ||
|             this.custOperFlag = custOperFlag;
 | ||
|             return model_imp.CustQuery((Tracen.Data.BaseObject.BaseModel) this);
 | ||
|         }
 | ||
|         
 | ||
|         protected int CustOper(int custOperFlag)
 | ||
|         {
 | ||
|             this.custOperFlag = custOperFlag;
 | ||
|             return model_imp.CustOper(this);
 | ||
|         }
 | ||
| 
 | ||
|        
 | ||
|         public void getModel()
 | ||
|         {
 | ||
|             custOperFlag = 0;  //2010.1.3
 | ||
|             model_imp.getModel(this);
 | ||
|         }
 | ||
|         public void getModel(int custOperFlag)
 | ||
|         {
 | ||
|             this.custOperFlag = custOperFlag;
 | ||
|             model_imp.getModel(this);
 | ||
|         }
 | ||
|         private void getImp()
 | ||
|         {
 | ||
|             Type tp = GetType();
 | ||
|             String impClassName = getImpClassName(tp.FullName);
 | ||
|             // impClassName = "ZhangPu.Gov.Data.Model.Department_Imp";
 | ||
|             Type tpImp = tp.Assembly.GetType(impClassName);
 | ||
|             model_imp = (BaseModel_Imp)System.Activator.CreateInstance(tpImp);
 | ||
|         }
 | ||
| 
 | ||
|         private String getImpClassName(String ClassName)
 | ||
|         {<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
 | ||
|             return<EFBFBD><EFBFBD> ClassName + "_Imp";
 | ||
|            <EFBFBD><EFBFBD>
 | ||
|         }
 | ||
| 
 | ||
| 
 | ||
| 
 | ||
|     }
 | ||
| } |