public IList<Core.Business.BlogExtend> GetAllBlogExtend() { IList<Core.Business.BlogExtend> blogExtendlist = new List<Core.Business.BlogExtend>(); SqlServerUtility sql = new SqlServerUtility(connectionString); SqlDataReader reader = sql.ExecuteSPReader("USP_BlogExtend_SelectAll"); if(reader != null) { while(reader.Read()) { Core.Business.BlogExtend blogExtend = new Core.Business.BlogExtend(); long Id = 0; if (!reader.IsDBNull(0)) Id = reader.GetInt64(0); blogExtend = CY.UME.Core.Business.BlogExtend.Load(Id); blogExtend.MarkOld(); blogExtendlist.Add(blogExtend); } reader.Close(); } return blogExtendlist; }
public Core.Business.BlogExtend Select(Int64 id) { SqlServerUtility sql = new SqlServerUtility(connectionString); sql.AddParameter("@Id", SqlDbType.BigInt, id); SqlDataReader reader = sql.ExecuteSPReader("USP_BlogExtend_Select_By_Id"); if (reader != null && !reader.IsClosed && reader.Read()) { Core.Business.BlogExtend blogExtend = new Core.Business.BlogExtend(); if (!reader.IsDBNull(0)) blogExtend.Id = reader.GetInt64(0); if (!reader.IsDBNull(1)) blogExtend.AccountId = reader.GetInt64(1); if (!reader.IsDBNull(2)) blogExtend.ActivityId = reader.GetString(2); reader.Close(); return blogExtend; } else { if (reader != null && !reader.IsClosed) reader.Close(); return null; } }