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

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

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

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

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