一个DataAccess类的实现。实现了Commed builder,异构数据库,和事务控制等功能。...

如果你在系统中使用了此架构,请标注出处,谢谢。

ExpandedBlockStart.gif ContractedBlock.gif /**/ /**/ /**/ ////
InBlock.gif
///
InBlock.gif
///    Copyright (C), 2002-2008, Murphy Corporation.
InBlock.gif
///    
InBlock.gif
///    FileName:        DBAccess.cs
InBlock.gif
///    Author:            胡晓伟
InBlock.gif
///    Version:          Beta 
InBlock.gif
///    Description:    DataAccess Foundation Class : Basic DB Function Class ..
InBlock.gif
///   
InBlock.gif
///                    
ExpandedBlockEnd.gif
////

None.gif using  System;
None.gif
using  System.Data;
None.gif
using  System.Data.SqlClient;
None.gif
using  System.Data.OleDb;
None.gif
using  System.Data.OracleClient;
None.gif
None.gif
using  COM.Makinfo.DataEntity;
None.gif
namespace  COM.Makinfo.DataAccess
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif    
public abstract class DBAccess:IDataAccess
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// SQL变量的前缀
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        private const string        SQL_PARA_PREFIX = "@";
InBlock.gif        
private const string        ACE_PARA_PREFIX = "@";
InBlock.gif        
private const string        ORA_PARA_PREFIX = ":";
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 初始化函数。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        public DBAccess()
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif        Properties
Properties#region Properties
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 得到数据库信息。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        private DBInfoData dbInfoData
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return DBInfoData.dbInfoData;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif    
InBlock.gif        
private string    _ConnectionString = "";    
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
///  得到连接数据库的字符串。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        public string ConnectionString
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
if(this._ConnectionString == "")
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
switch(DBType)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        
case DatabaseType.Access:
InBlock.gif                            
this._ConnectionString = 
InBlock.gif                                
"Provider=Microsoft.Jet.OLEDB.4.0;"+
InBlock.gif                                
"Data Source="+dbInfoData.Source+";"+
InBlock.gif                                
"User Id="+dbInfoData.UserID+";"+
InBlock.gif                                
"Password="+dbInfoData.Password +";" ; 
InBlock.gif                            
break;
InBlock.gif                        
case DatabaseType.SQLServer:
InBlock.gif                            
this._ConnectionString = 
InBlock.gif                                
" Data Source="+dbInfoData.Server + ""+
InBlock.gif                                
" Initial Catalog="+dbInfoData.Source+"" +
InBlock.gif                                
" user id="+dbInfoData.UserID + "" +
InBlock.gif                                
" Password="+dbInfoData.Password + ""+
InBlock.gif                                
" persist security info=False;"+ 
InBlock.gif                                
" Connect Timeout="+dbInfoData.ConnectTimeOut.ToString()+ ""
InBlock.gif                            
break;
InBlock.gif                        
case DatabaseType.Oracle:
InBlock.gif                            
this._ConnectionString = 
InBlock.gif                                
" Data source=" + dbInfoData.Source + ";" +
InBlock.gif                                
" User ID=" + dbInfoData.UserID + ";"+
InBlock.gif                                
" password=" + dbInfoData.Password;
InBlock.gif                            
break;
InBlock.gif                        
default:
InBlock.gif                            
this._ConnectionString = 
InBlock.gif                                
" Data Source="+dbInfoData.Server + ""+
InBlock.gif                                
" Initial Catalog="+dbInfoData.Source+"" +
InBlock.gif                                
" user id="+dbInfoData.UserID + "" +
InBlock.gif                                
" persist security info=False;"+ 
InBlock.gif                                
" Connect Timeout="+dbInfoData.ConnectTimeOut.ToString()+ ""
InBlock.gif                            
break;               
ExpandedSubBlockEnd.gif                    }

ExpandedSubBlockEnd.gif                }

InBlock.gif                
return this._ConnectionString;
ExpandedSubBlockEnd.gif            }

InBlock.gif
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 得到数据库类型
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        protected DatabaseType DBType
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{    
InBlock.gif                
return this.dbInfoData.DBType;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif        
private IDbConnection    _Conn;
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 得到一个数据库的实例,这个实例只在此类中使用。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        private IDbConnection Conn
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
switch(DBType)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
case DatabaseType.Access:
InBlock.gif                        
this._Conn = new OleDbConnection
InBlock.gif                            (ConnectionString); 
InBlock.gif                        
break;
InBlock.gif                    
case DatabaseType.SQLServer:
InBlock.gif                        
this._Conn = new SqlConnection
InBlock.gif                            (ConnectionString); 
InBlock.gif                        
break;
InBlock.gif                    
case DatabaseType.Oracle:
InBlock.gif                        
this._Conn = new OracleConnection
InBlock.gif                            (ConnectionString);
InBlock.gif                        
break;
InBlock.gif                    
default:
InBlock.gif                        
this._Conn = new SqlConnection
InBlock.gif                            (ConnectionString); 
InBlock.gif                        
break;               
ExpandedSubBlockEnd.gif                }

InBlock.gif                
return this._Conn;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 获得数据库变量的前缀。
InBlock.gif        
/// </summary>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        protected string GetParaPreFix
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
string strRet = "";
InBlock.gif                
switch(DBType)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
case DatabaseType.Access:
InBlock.gif                        strRet 
= ACE_PARA_PREFIX; 
InBlock.gif                        
break;
InBlock.gif
InBlock.gif                    
case DatabaseType.SQLServer:
InBlock.gif                        strRet 
= SQL_PARA_PREFIX; 
InBlock.gif                        
break;
InBlock.gif
InBlock.gif                    
case DatabaseType.Oracle:
InBlock.gif                        strRet 
= ORA_PARA_PREFIX; 
InBlock.gif                        
break;
InBlock.gif
InBlock.gif                    
default:
InBlock.gif                        strRet 
= SQL_PARA_PREFIX; 
InBlock.gif                        
break;
ExpandedSubBlockEnd.gif                }

InBlock.gif
InBlock.gif                strRet 
=  SQL_PARA_PREFIX  ;             
InBlock.gif                
return strRet;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif        
private IDbConnection    _TempConn;
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 得到或设置一个临时的数据库连接的实例,他在事务处理中使用。
InBlock.gif        
/// (用于交互式方法ExcuteCmdListCooperation)。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        protected IDbConnection TempConn
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return this._TempConn;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
this._TempConn = value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 得到一个DataAdapter实例,其数据库连接和SelectCommand已经设置。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        protected IDbDataAdapter InstanceAdap
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                IDbDataAdapter da;
InBlock.gif                
switch(DBType)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
case DatabaseType.Access:
InBlock.gif                        da 
= new OleDbDataAdapter((OleDbCommand)InstanceComm); 
InBlock.gif                        
break;
InBlock.gif
InBlock.gif                    
case DatabaseType.SQLServer:
InBlock.gif                        da 
= new SqlDataAdapter((SqlCommand)InstanceComm); 
InBlock.gif                        
break;
InBlock.gif
InBlock.gif                    
case DatabaseType.Oracle:
InBlock.gif                        da 
= new OracleDataAdapter((OracleCommand)InstanceComm); 
InBlock.gif                        
break;
InBlock.gif
InBlock.gif                    
default:
InBlock.gif                        da 
= new SqlDataAdapter((SqlCommand)InstanceComm); 
InBlock.gif                        
break;
ExpandedSubBlockEnd.gif                }

InBlock.gif
InBlock.gif                
return da;
InBlock.gif
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 得到参数实例.
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        protected IDbDataParameter InstanceParam
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                IDbDataParameter dp;
InBlock.gif                
switch(DBType)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
case DatabaseType.Access:
InBlock.gif                        dp 
= new OleDbParameter() ; 
InBlock.gif                        
break;
InBlock.gif
InBlock.gif                    
case DatabaseType.SQLServer:
InBlock.gif                        dp 
= new  SqlParameter(); 
InBlock.gif                        
break;
InBlock.gif
InBlock.gif                    
case DatabaseType.Oracle:
InBlock.gif                        dp 
= new  OracleParameter(); 
InBlock.gif                        
break;
InBlock.gif
InBlock.gif                    
default:
InBlock.gif                        dp 
= new SqlParameter(); 
InBlock.gif                        
break;
ExpandedSubBlockEnd.gif                }

InBlock.gif
InBlock.gif                
return dp;
InBlock.gif
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 得到一个Command实例,其数据库连接已经设置。
InBlock.gif        
/// 如果有事务,则事务也会自动设置完成(用于交互式方法ExcuteCmdListCooperation)。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        protected IDbCommand InstanceComm
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{    
InBlock.gif                IDbCommand cmd;
InBlock.gif                
if(!this.IsCooperation)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
switch(DBType)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        
case DatabaseType.Access:
InBlock.gif                            cmd 
= new OleDbCommand
InBlock.gif                                (
"",(OleDbConnection)Conn);
InBlock.gif                            
break;
InBlock.gif
InBlock.gif                        
case DatabaseType.SQLServer:
InBlock.gif                            cmd 
= new SqlCommand
InBlock.gif                                (
"",(SqlConnection)Conn); 
InBlock.gif                            
break;
InBlock.gif
InBlock.gif                        
case DatabaseType.Oracle:
InBlock.gif                            cmd 
= new OracleCommand
InBlock.gif                                (
"",(OracleConnection)Conn);
InBlock.gif                            
break;
InBlock.gif                        
default:
InBlock.gif                            cmd 
= new SqlCommand
InBlock.gif                                (
"",(SqlConnection)Conn); 
InBlock.gif                            
break;
ExpandedSubBlockEnd.gif                    }

ExpandedSubBlockEnd.gif                }

InBlock.gif                
else
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
switch(DBType)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        
case DatabaseType.Access:
InBlock.gif                            cmd 
= new OleDbCommand
InBlock.gif                                (
"",(OleDbConnection)Conn,(OleDbTransaction)this.TempTransaction);
InBlock.gif                            
break;
InBlock.gif
InBlock.gif                        
case DatabaseType.SQLServer:
InBlock.gif                            cmd 
= new SqlCommand
InBlock.gif                                (
"",(SqlConnection)Conn,(SqlTransaction)this.TempTransaction); 
InBlock.gif                            
break;
InBlock.gif
InBlock.gif                        
case DatabaseType.Oracle:
InBlock.gif                            cmd 
= new OracleCommand
InBlock.gif                                (
"",(OracleConnection)Conn,(OracleTransaction)this.TempTransaction);
InBlock.gif                            
break;
InBlock.gif                        
default:
InBlock.gif                            cmd 
= new SqlCommand
InBlock.gif                                (
"",(SqlConnection)Conn,(SqlTransaction)this.TempTransaction); 
InBlock.gif                            
break;
ExpandedSubBlockEnd.gif                    }

ExpandedSubBlockEnd.gif                }

InBlock.gif                
return cmd;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
private IDbTransaction _Transaction;
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 得到或设置一个事务。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        protected IDbTransaction Transaction
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return this._Transaction;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
this._Transaction = value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
private IDbTransaction _TempTransaction;
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 得到或设置一个临时事务。
InBlock.gif        
/// (用于交互式方法ExcuteCmdListCooperation)。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        protected IDbTransaction TempTransaction
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return this._TempTransaction;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
this._TempTransaction = value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
private bool _IsCooperation;
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 得到或设置是否交互式方法。
InBlock.gif        
/// (用于交互式方法ExcuteCmdListCooperation)。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        private bool IsCooperation
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return this._IsCooperation;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
this._IsCooperation = value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockEnd.gif        
#endregion
 Properties
InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif        Functions
Functions#region Functions
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 从数据库中向数据表对象填充数据。
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="dsRet">要填充数据的数据表类。</param>
ExpandedSubBlockEnd.gif        
/// <param name="sql">Sql语句</param>

InBlock.gif        protected void    InitDataSetTableBySQL(ref DataTable dsRet, string sql)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{        
InBlock.gif            IDbCommand cmd    
= this.InstanceComm;
InBlock.gif            cmd.CommandText 
= sql;
InBlock.gif            
this.InitDataSetTableByCmd(ref dsRet,cmd);
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 从数据库中向数据表对象填充数据。
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="dsRet">要填充数据的数据表类。</param>
ExpandedSubBlockEnd.gif        
/// <param name="sql">Sql语句</param>

InBlock.gif        protected void    InitDataSetTableByCmd(ref DataTable dsRet, IDbCommand cmd)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{        
InBlock.gif            IDbDataAdapter myAdapter        
= this.InstanceAdap;
InBlock.gif            
string tableName                = dsRet.TableName;
InBlock.gif            myAdapter.MissingSchemaAction    
= System.Data.MissingSchemaAction.Add;
InBlock.gif            myAdapter.TableMappings.Add(
"Table" ,tableName);
InBlock.gif            myAdapter.SelectCommand            
= cmd;
InBlock.gif            
if(dsRet.DataSet == null)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                DataSet dtsTemp                    
= new DataSet();
InBlock.gif                dtsTemp.Tables.Add(dsRet);
ExpandedSubBlockEnd.gif            }

InBlock.gif            
if(this.IsCooperation)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                myAdapter.SelectCommand.Connection        
= this.TempConn;
InBlock.gif                myAdapter.SelectCommand.Transaction        
= this.TempTransaction;
ExpandedSubBlockEnd.gif            }

InBlock.gif
InBlock.gif            myAdapter.Fill(dsRet.DataSet);
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 执行Command List。
InBlock.gif        
/// 如果之前调用过BeginCooperation方法,则所有Command都在一个事务中。
InBlock.gif        
/// </summary>
ExpandedSubBlockEnd.gif        
/// <param name="aryIDbCommand"></param>

InBlock.gif        protected void ExcuteCmdList(IDbCommand[] aryIDbCommand)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{    
InBlock.gif            
if(this.IsCooperation)
InBlock.gif                
this.ExcuteCmdListCooperation(aryIDbCommand);
InBlock.gif            
else
InBlock.gif                
this.ExcuteCmdListNoCooperation(aryIDbCommand);
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 执行Command List。所有Command都在一个事务中。
InBlock.gif        
/// </summary>
ExpandedSubBlockEnd.gif        
/// <param name="aryIDbCommand"></param>

InBlock.gif        protected void ExcuteCmdListCooperation(IDbCommand[] aryIDbCommand)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{    
InBlock.gif            
if(aryIDbCommand == null || aryIDbCommand.Length ==0)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
//open connection.
InBlock.gif
            IDbConnection conn    = this.TempConn;
InBlock.gif            
//begin transaction.
InBlock.gif
            
InBlock.gif            IDbTransaction tran    
= this.TempTransaction;
InBlock.gif            
try
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
//excute commands.
InBlock.gif
                foreach(IDbCommand anyIDbCommand in aryIDbCommand)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    anyIDbCommand.Connection    
= conn;
InBlock.gif                    anyIDbCommand.Transaction    
= tran;
InBlock.gif                    anyIDbCommand.ExecuteNonQuery();
ExpandedSubBlockEnd.gif                }

ExpandedSubBlockEnd.gif            }

InBlock.gif            
catch(Exception ex)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
throw ex;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 执行Command List。没有事务。
InBlock.gif        
/// </summary>
ExpandedSubBlockEnd.gif        
/// <param name="aryIDbCommand"></param>

InBlock.gif        protected void ExcuteCmdListNoCooperation (IDbCommand[] aryIDbCommand)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{    
InBlock.gif            
if(aryIDbCommand == null || aryIDbCommand.Length ==0)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
//excute commands.
InBlock.gif
            foreach(IDbCommand anyIDbCommand in aryIDbCommand)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                anyIDbCommand.Connection.Open();
InBlock.gif                
try
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
//执行
InBlock.gif
                    anyIDbCommand.ExecuteNonQuery();
ExpandedSubBlockEnd.gif                }

InBlock.gif                
catch(Exception ex)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
throw ex;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
finally
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
if(anyIDbCommand.Connection.State == ConnectionState.Open)
ExpandedSubBlockStart.gifContractedSubBlock.gif                    
dot.gif{
InBlock.gif                        anyIDbCommand.Connection.Close();
ExpandedSubBlockEnd.gif                    }

InBlock.gif
ExpandedSubBlockEnd.gif                }

InBlock.gif
ExpandedSubBlockEnd.gif            }

InBlock.gif            
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 开始事务。
InBlock.gif        
/// </summary>
ExpandedSubBlockEnd.gif        
/// <param name="aryDBAccess"></param>

InBlock.gif        public static void BeginCooperation(DBAccess[] aryDBAccess)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            IDbConnection conn        
= aryDBAccess[0].Conn;
InBlock.gif            conn.Open();
InBlock.gif            
//begin transaction.
InBlock.gif
            IDbTransaction tran        = conn.BeginTransaction();
InBlock.gif            
//set the same connection and transaction for every DBAccess instance.
InBlock.gif
            foreach(DBAccess anyDBAccess in aryDBAccess)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                anyDBAccess.TempConn        
= conn;
InBlock.gif                anyDBAccess.TempTransaction 
= tran;
InBlock.gif                anyDBAccess.IsCooperation    
= true;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 提交事务。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        public static void CommitCooperation(DBAccess[] aryDBAccess)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
foreach(DBAccess anyDBAccess in aryDBAccess)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                anyDBAccess.IsCooperation 
= false;
ExpandedSubBlockEnd.gif            }

InBlock.gif            aryDBAccess[
0].TempTransaction.Commit();
InBlock.gif            aryDBAccess[
0].TempConn.Close();
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 回滚事务。
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        public static void RollbackCooperation(DBAccess[] aryDBAccess)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
foreach(DBAccess anyDBAccess in aryDBAccess)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                anyDBAccess.IsCooperation 
= false;
ExpandedSubBlockEnd.gif            }

InBlock.gif            aryDBAccess[
0].TempTransaction.Rollback();
InBlock.gif            aryDBAccess[
0].TempConn.Close();
ExpandedSubBlockEnd.gif        }

InBlock.gif        
ExpandedSubBlockEnd.gif        
#endregion
 Functions
InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif        Generate Command Funcions
Generate Command Funcions#region Generate Command Funcions
InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif        Get Insert Command
Get Insert Command#region Get Insert Command
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 生成InsertCommand。
InBlock.gif        
/// </summary>
ExpandedSubBlockEnd.gif        
/// <param name="aTable">插入数据库的数据。</param>

InBlock.gif        protected  IDbCommand[] GetInsertCommand (DataTable aTable)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            DataColumn[] InsertColumn 
= new DataColumn[aTable.Columns.Count];
InBlock.gif            aTable.Columns.CopyTo(InsertColumn,
0);
InBlock.gif            
return GetInsertCommand(aTable,InsertColumn);
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 生成InsertCommand。
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="InsertRow">插入数据库的数据。</param>
InBlock.gif        
/// <param name="InsertColumn">插入数据库的字段。</param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        protected IDbCommand[] GetInsertCommand (DataTable aTable,DataColumn[] InsertColumn)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{    
InBlock.gif            DataRow[] InsertRow 
= this.GetRow(aTable);
InBlock.gif
InBlock.gif            
return  this.GetInsertCommand(aTable.TableName,InsertRow,InsertColumn);
ExpandedSubBlockEnd.gif        }

InBlock.gif    
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 生成InsertCommand。
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="aTable">插入数据库的数据。</param>
InBlock.gif        
/// <param name="colName">插入数据库的字段。</param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        protected  IDbCommand[] GetInsertCommand (DataTable aTable,string[] colName)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            DataColumn[] dcCol 
= this.GetColumnByStr(aTable,colName);            
InBlock.gif            
return GetInsertCommand(aTable,dcCol);
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 生成InsertCommand。
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="InsertRow">插入数据库的数据。</param>
InBlock.gif        
/// <param name="colName">插入数据库的字段。</param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        protected IDbCommand GetInsertCommand (DataRow InsertRow,string[] colName)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
if ( InsertRow == null  )
InBlock.gif                
return null;
InBlock.gif            DataColumn[] dcCol 
= this.GetColumnByStr(InsertRow.Table,colName);
InBlock.gif            IDbCommand[] cmdList 
= this.GetInsertCommand(InsertRow.Table.TableName,
ExpandedSubBlockStart.gifContractedSubBlock.gif                
new DataRow[]dot.gif{InsertRow},
InBlock.gif                dcCol);
InBlock.gif            
if ( cmdList.Length > 0)
InBlock.gif                
return cmdList[0];
InBlock.gif            
else
InBlock.gif                
return null;
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif    
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 生成InsertCommand。        
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="InsertRow">插入数据库的数据。</param>
InBlock.gif        
/// <param name="colName">插入数据库的字段。</param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        protected IDbCommand[] GetInsertCommand (string TableName,DataRow[] InsertRow,string[] colName)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
if ( InsertRow == null || InsertRow.Length <= 0 )
InBlock.gif                
return null;
InBlock.gif            DataColumn[] dcCol 
= this.GetColumnByStr(InsertRow[0].Table,colName);
InBlock.gif            
return this.GetInsertCommand(TableName,InsertRow,dcCol);
ExpandedSubBlockEnd.gif        }

InBlock.gif            
InBlock.gif    
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 生成InsertCommand。
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="InsertRow">插入数据库的数据。</param>
InBlock.gif        
/// <param name="InsertColumn">插入数据库的字段。</param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        protected IDbCommand[] GetInsertCommand (string TableName,DataRow[] InsertRow,DataColumn[] InsertColumn)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            IDbCommand[] cmdList  
= new IDbCommand[InsertRow.Length];
InBlock.gif            IDbDataParameter [] ParaArray 
= new IDbDataParameter[InsertColumn.Length ];
InBlock.gif            
if ( InsertColumn.Length <=0  || InsertRow.Length <= 0)
InBlock.gif                
return cmdList;
InBlock.gif            
string strCol = "";
InBlock.gif            
string strValue = "";
InBlock.gif            
for(int i=0;i< InsertColumn.Length  ;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                DataColumn dc 
= InsertColumn[i];
InBlock.gif                
//Generate Sql ParaMeter
InBlock.gif
                ParaArray[i] = this.GetParameter(dc);
InBlock.gif                
InBlock.gif                
//Generate column
InBlock.gif
                strCol += "," + dc.ColumnName ;
InBlock.gif                strValue 
+= "," + ParaArray[i].ParameterName ;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
if ( strCol.Trim() != "" )
InBlock.gif                strCol 
= " ( " + strCol.Remove(0,1+ " )";
InBlock.gif            
if ( strValue.Trim() != "")
InBlock.gif                strValue 
= " values ( " + strValue.Remove(0,1+ " )";
InBlock.gif            
//Generate sql command
InBlock.gif
            string strSql =  " INSERT INTO " + TableName + strCol + strValue;
InBlock.gif            
//Add para to sql Command
InBlock.gif
            for(int i = 0 ;i< InsertRow.Length ; i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                cmdList[i]                    
= this.InstanceComm;    
InBlock.gif                cmdList[i].CommandText        
= strSql;
InBlock.gif                
foreach( IDbDataParameter para in ParaArray)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    para.Value 
= InsertRow[i][para.SourceColumn];
InBlock.gif                    IDbDataParameter tempPara 
= cmdList[i].CreateParameter();
InBlock.gif                    
this.ClonePara(para,tempPara);
InBlock.gif                    cmdList[i].Parameters.Add(tempPara);
ExpandedSubBlockEnd.gif                }

InBlock.gif                
if(this.dbInfoData.IsSqlText)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    cmdList[i].CommandText    
= this.GetSQLByCommand(cmdList[i]);
ExpandedSubBlockEnd.gif                }

ExpandedSubBlockEnd.gif            }

InBlock.gif            
return     cmdList;
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif        
#endregion
 
InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif        Get Update Command
Get Update Command#region Get Update Command
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>    
InBlock.gif        
/// 生成更新Command。
InBlock.gif        
/// 根据数据表的PrimaryKey,和UpdateColName生成Command。
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="updateTable">需要更新的数据。</param>
InBlock.gif        
/// <param name="updateColName">需要更新的字段。</param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        protected  IDbCommand[] GetUpdateCommand (DataTable updateTable,string[] UpdateColName)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{    
InBlock.gif            DataColumn[] PKCol        
= updateTable.PrimaryKey;        
InBlock.gif            
string[] PKColName        = new string[PKCol.Length];
InBlock.gif            
for(int iIndex = 0;iIndex < PKColName.Length;iIndex ++)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                PKColName[iIndex]    
= PKCol[iIndex].ColumnName;
ExpandedSubBlockEnd.gif            }

InBlock.gif
InBlock.gif            
return  this.GetUpdateCommand(updateTable,UpdateColName,PKColName);
ExpandedSubBlockEnd.gif        }
    
InBlock.gif    
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 生成更新Command。
InBlock.gif        
/// 根据指定的PKColName字段,和UpdateCol生成Command。
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="updateTable">需要更新的数据。</param>
InBlock.gif        
/// <param name="UpdateColName">需要更新的字段.</param>
InBlock.gif        
/// <param name="PKColName">更新条件字段。</param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        protected IDbCommand[] GetUpdateCommand (DataTable updateTable,string[] UpdateColName,string[]PKColName)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            DataColumn[] PkCol                
= this.GetColumnByStr(updateTable,PKColName);
InBlock.gif            
InBlock.gif            
//Generate Sql where.
InBlock.gif
            IDbDataParameter [] ParaArray    = new IDbDataParameter[PkCol.Length];
InBlock.gif            
string strWhere = "";            
InBlock.gif            
for(int i = 0; i< PkCol.Length ;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                DataColumn dc 
= PkCol[i];
InBlock.gif
InBlock.gif                
//Generate Sql ParaMeter
InBlock.gif
                ParaArray[i] = this.GetParameter(dc);
InBlock.gif
InBlock.gif                strWhere 
+= " AND " + dc.ColumnName + " = " + ParaArray[i].ParameterName;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
if ( strWhere.Trim() != "" )
InBlock.gif                strWhere 
= " Where " + strWhere.Remove(0,4);
InBlock.gif            
//Generate
InBlock.gif
            DataRow[] UpdateRow     = this.GetRow(updateTable);
InBlock.gif            
return this.GetUpdateCommand(updateTable.TableName,UpdateRow,UpdateColName,strWhere);
ExpandedSubBlockEnd.gif        }

InBlock.gif    
InBlock.gif        
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 生成更新Command。
InBlock.gif        
/// 根据要更新的数据,字段和更新条件生成Command。
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="updateTable">需要更新的数据。</param>
InBlock.gif        
/// <param name="UpdateColName">需要更新的字段。</param>
InBlock.gif        
/// <param name="strWhere">更新条件。</param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        protected IDbCommand[] GetUpdateCommand (DataTable updateTable,string[] UpdateColName,string strWhere)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            DataRow[] UpdateRow     
= this.GetRow(updateTable);
InBlock.gif            
return  this.GetUpdateCommand(updateTable.TableName,UpdateRow,UpdateColName,strWhere);
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif    
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 生成更新Command。
InBlock.gif        
/// 根据要更新的数据,字段和更新条件生成Command。
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="tableName">要更新的数据表名。</param>
InBlock.gif        
/// <param name="UpdateRow">要更新的数据。</param>
InBlock.gif        
/// <param name="UpDataColumn">要更新的数据表字段名。</param>
InBlock.gif        
/// <param name="strWhere">Where语句。(例如 where leng(@Nam}>4 or Desc is not null ),字段用{GetParaPreFix+字段名}组成。)</param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        protected IDbCommand[] GetUpdateCommand (string tableName,DataRow[] UpdateRow,string[] UpdateColName,string strWhere)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{    
InBlock.gif            DataColumn[] UpDataColumn            
= this.GetColumnByStr(UpdateRow[0].Table,UpdateColName);
InBlock.gif
InBlock.gif            IDbCommand[] cmdList  
= new IDbCommand[UpdateRow.Length];
InBlock.gif            
if ( UpdateRow.Length <= 0)
InBlock.gif                
return cmdList;
InBlock.gif            
InBlock.gif            IDbDataParameter [] ParaArray    
= new IDbDataParameter[UpDataColumn.Length];
InBlock.gif
InBlock.gif            
string strUpdateSet = "";            
InBlock.gif            
for(int i = 0; i< UpDataColumn.Length ;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                DataColumn dc 
= UpDataColumn[i];
InBlock.gif                
//Generate Sql ParaMeter
InBlock.gif
                ParaArray[i] = this.GetParameter(dc);                
InBlock.gif                strUpdateSet 
+= " , " + dc.ColumnName + " = " + ParaArray[i].ParameterName;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
if ( strUpdateSet.Trim() != "" )
InBlock.gif                strUpdateSet 
= " Set " + strUpdateSet.Remove(0,3);
InBlock.gif            
//Generate sql command
InBlock.gif
            string strSql =  " Update " + tableName + strUpdateSet + strWhere;
InBlock.gif            
//Add para to sql Command
InBlock.gif
            for(int i = 0 ;i< UpdateRow.Length ;i ++)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                cmdList[i]                    
= this.InstanceComm;    
InBlock.gif                cmdList[i].CommandText        
= strSql;    
InBlock.gif                
foreach( IDbDataParameter para in ParaArray)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    para.Value 
= UpdateRow[i][para.SourceColumn];
InBlock.gif                    IDbDataParameter tempPara 
= cmdList[i].CreateParameter();
InBlock.gif                    
this.ClonePara(para,tempPara);
InBlock.gif                    cmdList[i].Parameters.Add(tempPara);
ExpandedSubBlockEnd.gif                }

InBlock.gif                
if(this.dbInfoData.IsSqlText)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    cmdList[i].CommandText    
= this.GetSQLByCommand(cmdList[i]);
ExpandedSubBlockEnd.gif                }

ExpandedSubBlockEnd.gif            }

InBlock.gif            
return     cmdList;
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockEnd.gif        
#endregion
 Get Update Command
InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif        Get Select Command
Get Select Command#region Get Select Command
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 生成SelectCommand。
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="data">读取数据条件数据。</param>
InBlock.gif        
/// <param name="CheckCol">要读取数据表的字段名</param>
InBlock.gif        
/// <param name="PkCol">读取数据条件字段</param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        protected IDbCommand GetSelectCommand(DataTable data,string[] CheckCol,string[] PkCol)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
return this.GetSelectCommand(data.TableName,data.Select(),CheckCol,PkCol);
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 生成SelectCommand。
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="tableName">读取数据的数据表名。</param>
InBlock.gif        
/// <param name="rowList">读取数据条件数据。</param>
InBlock.gif        
/// <param name="CheckCol">要读取数据表的字段名。</param>
InBlock.gif        
/// <param name="PkCol">读取数据条件字段。</param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        protected IDbCommand GetSelectCommand(string tableName,DataRow[] rowList,string[] CheckCol,string[] PkCol)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            IDbCommand cmdRet        
= this.InstanceComm;    
InBlock.gif            cmdRet.CommandText        
= "";    
InBlock.gif            
if ( rowList.Length <= 0 )
InBlock.gif                
return cmdRet;
InBlock.gif
InBlock.gif            
string strCol = "";
InBlock.gif            
for ( int i = 0 ; i < PkCol.Length ; i++)
InBlock.gif                strCol 
+= "," + PkCol[i] ;
InBlock.gif            
for ( int i = 0 ; i < CheckCol.Length ; i++)
InBlock.gif                strCol 
+= "," + CheckCol[i] ;
InBlock.gif            
if ( strCol.Length > 0)
InBlock.gif                strCol 
= strCol.Remove(0,1);
InBlock.gif            
InBlock.gif            
//Generate Sql ParaMeter
InBlock.gif
            IDbDataParameter [] ParaArray = new IDbDataParameter[PkCol.Length];        
InBlock.gif            
for(int i = 0; i< ParaArray.Length ;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                DataColumn dc 
= rowList[0].Table.Columns[PkCol[i]];
InBlock.gif                ParaArray[i] 
= this.GetParameter(dc);    
ExpandedSubBlockEnd.gif            }

InBlock.gif
InBlock.gif            
string strSQL = "";                
InBlock.gif            
for(int i=0 ;i< rowList.Length ;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                strSQL 
= "union all select " + strCol + " from " + tableName  ;
InBlock.gif                
string strWhere = "";
InBlock.gif                DataRow aRow 
=    rowList[i];    
InBlock.gif                
foreach( IDbDataParameter para in ParaArray)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    para.Value 
= aRow[para.SourceColumn];
InBlock.gif                    IDbDataParameter tempPara 
= cmdRet.CreateParameter();
InBlock.gif                    
this.ClonePara(para,tempPara);    
InBlock.gif                    tempPara.ParameterName 
= tempPara.ParameterName + i.ToString();
InBlock.gif                    cmdRet.Parameters.Add(tempPara);
InBlock.gif                    strWhere 
+= " AND " + tempPara.SourceColumn  + " =" + tempPara.ParameterName;
ExpandedSubBlockEnd.gif                }
                
InBlock.gif                
if ( strWhere.Trim().Length > 0)
InBlock.gif                    strWhere 
= " Where " + strWhere.Remove(0,4);
InBlock.gif                strSQL 
+= strWhere;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
if ( strSQL.Trim().Length > 0)
InBlock.gif                strSQL 
= strSQL.Remove(0,9);
InBlock.gif            cmdRet.CommandText 
= strSQL;
InBlock.gif            
if(this.dbInfoData.IsSqlText)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                cmdRet.CommandText    
= this.GetSQLByCommand(cmdRet);
ExpandedSubBlockEnd.gif            }

InBlock.gif            
return cmdRet;
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockEnd.gif        
#endregion

InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif        Get Delete Command
Get Delete Command#region Get Delete Command
InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 生成DeleteCommand。
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="deleteTable">条件数据.</param>
InBlock.gif        
/// <param name="strWhere">Where语句。(例如 len(@Name}>4 or @Desc is not null ),字段用{GetParaPreFix+字段名}组成。)</param>
InBlock.gif        
/// <param name="PKColumn">条件字段。</param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        protected IDbCommand[] GetDeleteCommand (DataTable deleteTable ,string strWhere,string[] PKColumn)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{    
InBlock.gif            DataColumn[] dcCol 
= this.GetColumnByStr(deleteTable,PKColumn);    
InBlock.gif
InBlock.gif            
return  this.GetDeleteCommand(deleteTable.Select(),strWhere,dcCol);
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 生成DeleteCommand。
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="DeleteRow">条件数据。</param>
InBlock.gif        
/// <param name="PKColumn">条件字段。</param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        protected IDbCommand[] GetDeleteCommand (DataTable data,string[] PKColumn)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{    
InBlock.gif            DataColumn[] dcCol 
= this.GetColumnByStr(data,PKColumn);    
InBlock.gif
InBlock.gif            
return GetDeleteCommand(data.Select(),dcCol);
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 生成DeleteCommand。
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="DeleteRow">条件数据。</param>
InBlock.gif        
/// <param name="PKColumn">条件字段。</param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        protected IDbCommand[] GetDeleteCommand (DataRow[] DeleteRow,DataColumn[] PKColumn)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{    
InBlock.gif            
return GetDeleteCommand(DeleteRow,null,PKColumn);
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 生成DeleteCommand。
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="DeleteRow">条件数据。</param>
InBlock.gif        
/// <param name="strWhere">Where语句。(例如 where leng(@Nam}>4 or Desc is not null ),字段用{GetParaPreFix+字段名}组成。)</param>
InBlock.gif        
/// <param name="intCount">参数个数。</param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        protected IDbCommand[] GetDeleteCommand (DataRow[] DeleteRow,string Where,DataColumn[] PKColumn)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{    
InBlock.gif            
//实例化Command和Parameter
InBlock.gif
            IDbCommand[] cmdList  = new IDbCommand[DeleteRow.Length];
InBlock.gif            
if ( DeleteRow.Length <= 0 )
InBlock.gif                
return cmdList;
InBlock.gif            IDbDataParameter [] ParaArray 
= new IDbDataParameter[PKColumn.Length];
InBlock.gif            
for(int i = 0; i< ParaArray.Length ;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                DataColumn dc 
= PKColumn[i];
InBlock.gif
InBlock.gif                
//Generate Sql ParaMeter
InBlock.gif
                ParaArray[i] = this.GetParameter(dc);                
ExpandedSubBlockEnd.gif            }

InBlock.gif
InBlock.gif            
//生成Where语句。
InBlock.gif
            string strWhere = "";
InBlock.gif            
if(null != Where && Where != "")
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
for(int i = 0; i< ParaArray.Length ;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{        
InBlock.gif                    strWhere 
+= " AND " + ParaArray[i].SourceColumn + " =" + ParaArray[i].ParameterName ;
ExpandedSubBlockEnd.gif                }

InBlock.gif                
if ( strWhere.Trim() != "" )
InBlock.gif                    strWhere 
= " Where " + strWhere.Remove(0,4);
ExpandedSubBlockEnd.gif            }

InBlock.gif            
else
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                strWhere 
= " Where " + Where;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
InBlock.gif            
//Generate sql command
InBlock.gif
            string strSql =  " Delete From " + DeleteRow[0].Table.TableName + strWhere;
InBlock.gif            
//Add para to sql Command
InBlock.gif
            for(int i=0 ;i<DeleteRow.Length ;i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                DataRow aRow                
= DeleteRow[i];
InBlock.gif                cmdList[i]                    
= this.InstanceComm;    
InBlock.gif                cmdList[i].CommandText        
= strSql;
InBlock.gif                
foreach( IDbDataParameter para in ParaArray)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
object oValue = null;
InBlock.gif                    
if (aRow.RowState == DataRowState.Deleted)
InBlock.gif                        oValue 
= aRow[para.SourceColumn,DataRowVersion.Original];
InBlock.gif                    
else
InBlock.gif                        oValue 
= aRow[para.SourceColumn];
InBlock.gif                    para.Value 
= oValue;
InBlock.gif                    IDbDataParameter tempPara 
= cmdList[i].CreateParameter();
InBlock.gif                    
this.ClonePara(para,tempPara);                    
InBlock.gif                    cmdList[i].Parameters.Add(tempPara);
ExpandedSubBlockEnd.gif                }

InBlock.gif                
if(this.dbInfoData.IsSqlText)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    cmdList[i].CommandText    
= this.GetSQLByCommand(cmdList[i]);
ExpandedSubBlockEnd.gif                }

ExpandedSubBlockEnd.gif            }

InBlock.gif            
return     cmdList;
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif
InBlock.gif    
InBlock.gif
ExpandedSubBlockEnd.gif        
#endregion
 Get Delete Command
InBlock.gif
ContractedSubBlock.gifExpandedSubBlockStart.gif        Public Function
Public Function#region Public Function
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 得到DbDataParameter
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="pramObj">生成Parameters的参数</param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        protected IDbDataParameter[] GetParameter(ParaObject[] pramObj)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            IDbDataParameter[] paras 
= new IDbDataParameter[pramObj.Length];
InBlock.gif
InBlock.gif            
for(int iIndex =0;iIndex < paras.Length ; iIndex++)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                paras[iIndex]                
= this.InstanceParam;
InBlock.gif                paras[iIndex].DbType        
= this.GetDataType(pramObj[iIndex].PaType,0);
InBlock.gif                paras[iIndex].Direction        
= pramObj[iIndex].Direct;
InBlock.gif                paras[iIndex].Value            
= pramObj[iIndex].Value;
InBlock.gif                paras[iIndex].ParameterName    
= this.GetParaPreFix+pramObj[iIndex].Name;
ExpandedSubBlockEnd.gif            }

InBlock.gif
InBlock.gif            
return paras;
ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 根据数据库类型获取参数接口
InBlock.gif        
/// </summary>
ExpandedSubBlockEnd.gif        
/// <returns>数据适配器接口</returns>

InBlock.gif        private IDbDataParameter  GetParameter(DataColumn aColumn)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
const int MAX_SIZE    = 4000
InBlock.gif            
InBlock.gif            IDbDataParameter para 
= this.InstanceParam;
InBlock.gif            
InBlock.gif        
InBlock.gif            para.ParameterName 
= this.GetParaPreFix  + aColumn.ColumnName;    
InBlock.gif            para.SourceColumn 
= aColumn.ColumnName ;
InBlock.gif            para.DbType  
= this.GetDataType(aColumn.DataType,aColumn.MaxLength);    
InBlock.gif             
InBlock.gif            
if ( para.DbType == DbType.String )
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
int size  = aColumn.MaxLength ;
InBlock.gif                
if ( size <= 0)
InBlock.gif                    size 
= MAX_SIZE;
InBlock.gif                para.Size 
= size;                
ExpandedSubBlockEnd.gif            }

InBlock.gif            
return para;
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 根据Command拼SQL Text.
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="comm"></param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        public string GetSQLByCommand(IDbCommand comm)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
string strSQL = comm.CommandText;
InBlock.gif            
foreach(IDbDataParameter para in comm.Parameters)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
switch(para.DbType)
ExpandedSubBlockStart.gifContractedSubBlock.gif                
dot.gif{
InBlock.gif                    
case DbType.Decimal:
InBlock.gif                        strSQL 
= strSQL.Replace( para.ParameterName,    para.Value.ToString() );
InBlock.gif                        
break;
InBlock.gif                    
case DbType.DateTime:
InBlock.gif                        strSQL 
= strSQL.Replace( para.ParameterName,    "'" + para.Value.ToString() + "'" );    
InBlock.gif                        
break;
InBlock.gif                    
case DbType.Int16:
InBlock.gif                        strSQL 
= strSQL.Replace( para.ParameterName,    para.Value.ToString());        
InBlock.gif                        
break;
InBlock.gif                    
case DbType.Int32:
InBlock.gif                        strSQL 
= strSQL.Replace( para.ParameterName,    para.Value.ToString());        
InBlock.gif                        
break;
InBlock.gif                    
case DbType.Int64:
InBlock.gif                        strSQL 
= strSQL.Replace( para.ParameterName,    para.Value.ToString());        
InBlock.gif                        
break;
InBlock.gif                    
case DbType.Byte:
InBlock.gif                        strSQL 
= strSQL.Replace( para.ParameterName,    para.Value.ToString());    
InBlock.gif                        
break;
InBlock.gif                    
case DbType.AnsiStringFixedLength:
InBlock.gif                        strSQL 
= strSQL.Replace( para.ParameterName,    "'"+para.Value.ToString()+"'");    
InBlock.gif                        
break;
InBlock.gif                    
case DbType.String:
InBlock.gif                        strSQL 
= strSQL.Replace( para.ParameterName,    "'"+para.Value.ToString()+"'");    
InBlock.gif                        
break;
InBlock.gif                    
case DbType.Binary:
InBlock.gif                        strSQL 
= strSQL.Replace( para.ParameterName,    para.Value.ToString());
InBlock.gif                        
break;
InBlock.gif                    
case DbType.Boolean:
InBlock.gif                        strSQL 
= strSQL.Replace( para.ParameterName,    Convert.ToInt32(para.Value).ToString());
InBlock.gif                        
break;
InBlock.gif                    
default:
InBlock.gif                        strSQL 
= strSQL.Replace( para.ParameterName,    "'"+para.Value.ToString()+"'");    
InBlock.gif                        
break;
ExpandedSubBlockEnd.gif                }

ExpandedSubBlockEnd.gif            }

InBlock.gif            
return strSQL;
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 根据C# 数据类型返回数据库类型。
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="dataType">C#数据类型。</param>
InBlock.gif        
/// <param name="maxLength">最大长度。</param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        private DbType GetDataType(System.Type dataType,int maxLength)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            DbType typeRet 
= DbType.String ;
InBlock.gif
InBlock.gif            
if (dataType == typeof(decimal) )
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                typeRet 
=    DbType.Decimal;                                    
ExpandedSubBlockEnd.gif            }

InBlock.gif            
else if (dataType == typeof(DateTime) )
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                typeRet 
= DbType.DateTime ;    
InBlock.gif                    
ExpandedSubBlockEnd.gif            }

InBlock.gif            
else if (dataType == typeof(string) )
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
if ( maxLength > 0)
InBlock.gif                    typeRet 
= DbType.AnsiStringFixedLength ;    
InBlock.gif                
else
InBlock.gif                    typeRet 
= DbType.String ;                
ExpandedSubBlockEnd.gif            }

InBlock.gif            
else if (dataType == typeof(int))
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                typeRet 
= DbType.Int64;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
else if( dataType == typeof(bool))
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                typeRet 
= DbType.Boolean ;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
if( dataType == typeof(byte[]))
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                typeRet 
= DbType.Binary ;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
return typeRet;
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 根据数据表和字段名称,得到DataColumn。
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="aTable">数据表。</param>
InBlock.gif        
/// <param name="colName">字段名称。</param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        private  DataColumn[] GetColumnByStr(DataTable aTable,string[] colName)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            DataColumn[] dcCol 
= new DataColumn[colName.Length];
InBlock.gif            
forint i = 0 ; i < dcCol.Length  ; i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
string columnName = colName[i].Trim();
InBlock.gif                
int index = aTable.Columns.IndexOf(columnName);
InBlock.gif                
if ( index >= 0 )
InBlock.gif                    dcCol[i] 
= aTable.Columns[index];
ExpandedSubBlockEnd.gif            }

InBlock.gif            
return dcCol;
ExpandedSubBlockEnd.gif        }

InBlock.gif    
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 根据记录的状态(新增,修改,删除等)来得到相应的数据记录。
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="aTable">数据表。</param>
InBlock.gif        
/// <param name="rowState">数据状态。</param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        private DataRow[] GetRow(DataTable aTable,DataRowState rowState)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            DataTable dtChanged 
= aTable.GetChanges(rowState);
InBlock.gif            DataRow[] rowArray 
= new DataRow[dtChanged.Rows.Count];
InBlock.gif            
forint i = 0 ; i < rowArray.Length ; i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                rowArray[i] 
= dtChanged.Rows[i];
ExpandedSubBlockEnd.gif            }

InBlock.gif            
return rowArray;
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 得到数据表中所有记录。
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="aTable">数据表。</param>
ExpandedSubBlockEnd.gif        
/// <returns></returns>

InBlock.gif        private DataRow[] GetRow(DataTable aTable)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            DataRow[] rowArray 
= new DataRow[aTable.Rows.Count];
InBlock.gif            
forint i = 0 ; i < rowArray.Length ; i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                rowArray[i] 
= aTable.Rows[i];
ExpandedSubBlockEnd.gif            }

InBlock.gif            
return rowArray;
ExpandedSubBlockEnd.gif        }

ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 获得源参数的克隆参数
InBlock.gif        
/// </summary>
InBlock.gif        
/// <param name="paraSource">原始参数</param>
InBlock.gif        
/// <param name="paraSource">克隆参数<</param>
ExpandedSubBlockEnd.gif        
/// 

InBlock.gif        private void ClonePara(IDbDataParameter paraSource,IDbDataParameter paraDest)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{            
InBlock.gif            paraDest.ParameterName 
= paraSource.ParameterName ;
InBlock.gif            paraDest.SourceColumn 
= paraSource.SourceColumn ;
InBlock.gif            paraDest.DbType  
= paraSource.DbType ;
InBlock.gif            paraDest.Value 
= paraSource.Value;
InBlock.gif            paraDest.Size 
= paraSource.Size;
ExpandedSubBlockEnd.gif        }

InBlock.gif    
ExpandedSubBlockEnd.gif        
#endregion

InBlock.gif
ExpandedSubBlockEnd.gif        
#endregion

ExpandedSubBlockEnd.gif    }

ExpandedSubBlockStart.gifContractedSubBlock.gif    
/**//**//**//// <summary>
InBlock.gif    
/// 生成Parameters的参数类.
ExpandedSubBlockEnd.gif    
/// </summary>

InBlock.gif    public class ParaObject
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif        
InBlock.gif        
public  ParaObject(object Value,ParameterDirection direct,string Name,System.Type PaType)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
this.Value = Value;
InBlock.gif            
this.Direct = direct;
InBlock.gif            
this.Name = Name;
InBlock.gif            
this.PaType = PaType;
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
private object _Value;
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 参数值
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        public object Value
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return this._Value;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
this._Value = value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        
private ParameterDirection _Direct;
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 方向
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        public ParameterDirection Direct
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return this._Direct;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
this._Direct = value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif        
private string _Name;
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 参数名.
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        public string Name
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return this._Name;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
this._Name = value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif        
InBlock.gif        
private System.Type _PaType;
ExpandedSubBlockStart.gifContractedSubBlock.gif        
/**//**//**//// <summary>
InBlock.gif        
/// 参数类型.
ExpandedSubBlockEnd.gif        
/// </summary>

InBlock.gif        public System.Type PaType
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
get
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
return this._PaType;
ExpandedSubBlockEnd.gif            }

InBlock.gif            
set
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                
this._PaType = value;
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockEnd.gif    }

InBlock.gif
ExpandedBlockEnd.gif}

None.gif

转载于:https://www.cnblogs.com/richardhu/archive/2006/07/25/459598.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值