/// <summary> /// 得到一个对象实体 /// </summary> public XCLCMS.Data.Model.View.v_Ads GetModel(long AdsID) { XCLCMS.Data.Model.View.v_Ads model = new XCLCMS.Data.Model.View.v_Ads(); Database db = base.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand("select * from v_Ads WITH(NOLOCK) where AdsID=@AdsID"); db.AddInParameter(dbCommand, "AdsID", DbType.Int64, AdsID); using (var dr = db.ExecuteReader(dbCommand)) { return(XCLNetTools.DataSource.DataReaderHelper.DataReaderToEntity <XCLCMS.Data.Model.View.v_Ads>(dr)); } }
/// <summary> /// 得到一个对象实体 /// </summary> public XCLCMS.Data.Model.View.v_Ads GetModel(long AdsID) { XCLCMS.Data.Model.View.v_Ads model = new XCLCMS.Data.Model.View.v_Ads(); Database db = base.CreateDatabase(); DbCommand dbCommand = db.GetSqlStringCommand("select * from v_Ads WITH(NOLOCK) where AdsID=@AdsID"); db.AddInParameter(dbCommand, "AdsID", DbType.Int64, AdsID); DataSet ds = db.ExecuteDataSet(dbCommand); var lst = XCLNetTools.Generic.ListHelper.DataTableToList <XCLCMS.Data.Model.View.v_Ads>(ds.Tables[0]); return(null != lst && lst.Count > 0 ? lst[0] : null); }