/// <summary>
        /// 对象实体绑定数据
        /// </summary>
        public BD_CurrencyTypeInfo ReaderBind(IDataReader dataReader)
        {
            BD_CurrencyTypeInfo model = new BD_CurrencyTypeInfo();
            object ojb;

            ojb = dataReader["CurrencyTypeId"];
            if (ojb != null && ojb != DBNull.Value)
            {
                model.CurrencyTypeId = (int)ojb;
            }
            model.CurrencyName = dataReader["CurrencyName"].ToString();
            return(model);
        }
        /*
         * /// <summary>
         * /// 增加一条数据
         * /// </summary>
         * public void Add(BD_CurrencyTypeInfo model)
         * {
         *  StringBuilder strSql=new StringBuilder();
         *  strSql.Append("insert into BD_CurrencyType(");
         *  strSql.Append("CurrencyTypeId,CurrencyName)");
         *
         *  strSql.Append(" values (");
         *  strSql.Append("@CurrencyTypeId,@CurrencyName)");
         *  Database db = DatabaseFactory.CreateDatabase();
         *  DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
         *  db.AddInParameter(dbCommand, "CurrencyTypeId", DbType.Int32, model.CurrencyTypeId);
         *  db.AddInParameter(dbCommand, "CurrencyName", DbType.AnsiString, model.CurrencyName);
         *  db.ExecuteNonQuery(dbCommand);
         * }
         * /// <summary>
         * /// 更新一条数据
         * /// </summary>
         * public void Update(BD_CurrencyTypeInfo model)
         * {
         *  StringBuilder strSql=new StringBuilder();
         *  strSql.Append("update BD_CurrencyType set ");
         *  strSql.Append("CurrencyName=@CurrencyName");
         *  strSql.Append(" where CurrencyTypeId=@CurrencyTypeId ");
         *  Database db = DatabaseFactory.CreateDatabase();
         *  DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
         *  db.AddInParameter(dbCommand, "CurrencyTypeId", DbType.Int32, model.CurrencyTypeId);
         *  db.AddInParameter(dbCommand, "CurrencyName", DbType.AnsiString, model.CurrencyName);
         *  db.ExecuteNonQuery(dbCommand);
         *
         * }
         *
         * /// <summary>
         * /// 删除一条数据
         * /// </summary>
         * public void Delete(int CurrencyTypeId)
         * {
         *
         *  StringBuilder strSql=new StringBuilder();
         *  strSql.Append("delete from BD_CurrencyType ");
         *  strSql.Append(" where CurrencyTypeId=@CurrencyTypeId ");
         *  Database db = DatabaseFactory.CreateDatabase();
         *  DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());
         *  db.AddInParameter(dbCommand, "CurrencyTypeId", DbType.Int32,CurrencyTypeId);
         *  db.ExecuteNonQuery(dbCommand);
         *
         * }*/

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public BD_CurrencyTypeInfo GetModel(int CurrencyTypeId)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select CurrencyTypeId,CurrencyName from BD_CurrencyType ");
            strSql.Append(" where CurrencyTypeId=@CurrencyTypeId ");
            Database  db        = DatabaseFactory.CreateDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand(strSql.ToString());

            db.AddInParameter(dbCommand, "CurrencyTypeId", DbType.Int32, CurrencyTypeId);
            BD_CurrencyTypeInfo model = null;

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                if (dataReader.Read())
                {
                    model = ReaderBind(dataReader);
                }
            }
            return(model);
        }