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

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

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

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

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