Esempio n. 1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.user_amount_log GetModel(int id)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select top 1 id,user_id,user_name,[value],[remark],add_time from " + databaseprefix + "user_amount_log ");
            strSql.Append(" where id=@id");
            OleDbParameter[] parameters =
            {
                new OleDbParameter("@id", OleDbType.Integer, 4)
            };
            parameters[0].Value = id;

            DTcms.Model.user_amount_log model = new DTcms.Model.user_amount_log();
            DataSet ds = DbHelperOleDb.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.user_amount_log GetModel(int id)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select top 1 id,user_id,user_name,[value],[remark],add_time from " + databaseprefix + "user_amount_log ");
            strSql.Append(" where id=@id");
            OleDbParameter[] parameters = {
                    new OleDbParameter("@id", OleDbType.Integer,4)};
            parameters[0].Value = id;

            DTcms.Model.user_amount_log model = new DTcms.Model.user_amount_log();
            DataSet ds = DbHelperOleDb.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }