Exemple #1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public XCLCMS.Data.Model.View.v_Tags GetModel(long TagsID)
        {
            XCLCMS.Data.Model.View.v_Tags model = new XCLCMS.Data.Model.View.v_Tags();
            Database  db        = base.CreateDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand("select * from v_Tags WITH(NOLOCK)   where TagsID=@TagsID");

            db.AddInParameter(dbCommand, "TagsID", DbType.Int64, TagsID);
            using (var dr = db.ExecuteReader(dbCommand))
            {
                return(XCLNetTools.DataSource.DataReaderHelper.DataReaderToEntity <XCLCMS.Data.Model.View.v_Tags>(dr));
            }
        }
Exemple #2
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public XCLCMS.Data.Model.View.v_Tags GetModel(long TagsID)
        {
            XCLCMS.Data.Model.View.v_Tags model = new XCLCMS.Data.Model.View.v_Tags();
            Database  db        = base.CreateDatabase();
            DbCommand dbCommand = db.GetSqlStringCommand("select * from v_Tags WITH(NOLOCK)   where TagsID=@TagsID");

            db.AddInParameter(dbCommand, "TagsID", DbType.Int64, TagsID);
            DataSet ds = db.ExecuteDataSet(dbCommand);

            var lst = XCLNetTools.Generic.ListHelper.DataTableToList <XCLCMS.Data.Model.View.v_Tags>(ds.Tables[0]);

            return(null != lst && lst.Count > 0 ? lst[0] : null);
        }