public IList<Core.Business.WishingComment> GetAllWishingComment() { IList<Core.Business.WishingComment> wishingCommentlist = new List<Core.Business.WishingComment>(); SqlServerUtility sql = new SqlServerUtility(SqlConnection); SqlDataReader reader = sql.ExecuteSqlReader(""); if (reader != null) { while (reader.Read()) { Core.Business.WishingComment wishingComment = new Core.Business.WishingComment(); if (!reader.IsDBNull(0)) wishingComment.Id = reader.GetInt64(0); if (!reader.IsDBNull(1)) wishingComment.DateCreated = reader.GetDateTime(1); if (!reader.IsDBNull(2)) wishingComment.InstanceId = reader.GetInt64(2); if (!reader.IsDBNull(3)) wishingComment.AuthorId = reader.GetInt64(3); if (!reader.IsDBNull(4)) wishingComment.Content = reader.GetString(4); wishingComment.MarkOld(); wishingCommentlist.Add(wishingComment); } reader.Close(); } return wishingCommentlist; }
public IList<CY.UME.Core.Business.WishingComment> GetWishCommentByWishId(long wishId, int count) { IList<Core.Business.WishingComment> wishingCommentlist = new List<Core.Business.WishingComment>(); SqlServerUtility sql = new SqlServerUtility(SqlConnection); sql.AddParameter("@WishId", SqlDbType.BigInt, wishId); sql.AddParameter("@Count", SqlDbType.Int, count); SqlDataReader reader = sql.ExecuteSPReader("USP_WishingComment_Select_By_WishId"); if (reader != null) { while (reader.Read()) { Core.Business.WishingComment wishingComment = new Core.Business.WishingComment(); long id = 0; if (!reader.IsDBNull(0)) id = reader.GetInt64(0); wishingComment = CY.UME.Core.Business.WishingComment.Load(id); wishingComment.MarkOld(); wishingCommentlist.Add(wishingComment); } reader.Close(); } return wishingCommentlist; }
public Core.Business.WishingComment Select(Int64 id) { SqlServerUtility sql = new SqlServerUtility(SqlConnection); sql.AddParameter("@Id", SqlDbType.BigInt, id); SqlDataReader reader = sql.ExecuteSPReader("USP_WishingComment_Select_By_Id"); if (reader != null && !reader.IsClosed && reader.Read()) { Core.Business.WishingComment wishingComment = new Core.Business.WishingComment(); if (!reader.IsDBNull(0)) wishingComment.Id = reader.GetInt64(0); if (!reader.IsDBNull(1)) wishingComment.DateCreated = reader.GetDateTime(1); if (!reader.IsDBNull(2)) wishingComment.InstanceId = reader.GetInt64(2); if (!reader.IsDBNull(3)) wishingComment.AuthorId = reader.GetInt64(3); if (!reader.IsDBNull(4)) wishingComment.Content = reader.GetString(4); reader.Close(); return wishingComment; } else { if (reader != null && !reader.IsClosed) reader.Close(); return null; } }