private DBBlogComment GetBlogCommentFromReader(IDataReader dataReader) { DBBlogComment blogComment = new DBBlogComment(); blogComment.BlogCommentID = NopSqlDataHelper.GetInt(dataReader, "BlogCommentID"); blogComment.BlogPostID = NopSqlDataHelper.GetInt(dataReader, "BlogPostID"); blogComment.CustomerID = NopSqlDataHelper.GetInt(dataReader, "CustomerID"); blogComment.CommentText = NopSqlDataHelper.GetString(dataReader, "CommentText"); blogComment.CreatedOn = NopSqlDataHelper.GetUtcDateTime(dataReader, "CreatedOn"); return blogComment; }
/// <summary> /// Updates the blog comment /// </summary> /// <param name="BlogCommentID">The blog comment identifier</param> /// <param name="BlogPostID">The blog post identifier</param> /// <param name="CustomerID">The customer identifier who commented the blog post</param> /// <param name="CommentText">The comment text</param> /// <param name="CreatedOn">The date and time of instance creation</param> /// <returns>Blog comment</returns> public static BlogComment UpdateBlogComment(int BlogCommentID, int BlogPostID, int CustomerID, string CommentText, DateTime CreatedOn) { CreatedOn = DateTimeHelper.ConvertToUtcTime(CreatedOn); DBBlogComment dbItem = DBProviderManager <DBBlogProvider> .Provider.UpdateBlogComment(BlogCommentID, BlogPostID, CustomerID, CommentText, CreatedOn); BlogComment blogComment = DBMapping(dbItem); return(blogComment); }
/// <summary> /// Gets an blog comment /// </summary> /// <param name="BlogCommentID">Blog comment identifier</param> /// <returns>An blog comment</returns> public static BlogComment GetBlogCommentByID(int BlogCommentID) { if (BlogCommentID == 0) { return(null); } DBBlogComment dbItem = DBProviderManager <DBBlogProvider> .Provider.GetBlogCommentByID(BlogCommentID); BlogComment blogComment = DBMapping(dbItem); return(blogComment); }
private static BlogComment DBMapping(DBBlogComment dbItem) { if (dbItem == null) return null; BlogComment item = new BlogComment(); item.BlogCommentID = dbItem.BlogCommentID; item.BlogPostID = dbItem.BlogPostID; item.CustomerID = dbItem.CustomerID; item.CommentText = dbItem.CommentText; item.CreatedOn = dbItem.CreatedOn; return item; }
private static BlogComment DBMapping(DBBlogComment dbItem) { if (dbItem == null) { return(null); } BlogComment item = new BlogComment(); item.BlogCommentID = dbItem.BlogCommentID; item.BlogPostID = dbItem.BlogPostID; item.CustomerID = dbItem.CustomerID; item.CommentText = dbItem.CommentText; item.CreatedOn = dbItem.CreatedOn; return(item); }
/// <summary> /// Inserts an blog comment /// </summary> /// <param name="BlogPostID">The blog post identifier</param> /// <param name="CustomerID">The customer identifier who commented the blog post</param> /// <param name="CommentText">The comment text</param> /// <param name="CreatedOn">The date and time of instance creation</param> /// <param name="notify">A value indicating whether to notify the store owner</param> /// <returns>Blog comment</returns> public static BlogComment InsertBlogComment(int BlogPostID, int CustomerID, string CommentText, DateTime CreatedOn, bool notify) { CreatedOn = DateTimeHelper.ConvertToUtcTime(CreatedOn); DBBlogComment dbItem = DBProviderManager <DBBlogProvider> .Provider.InsertBlogComment(BlogPostID, CustomerID, CommentText, CreatedOn); BlogComment blogComment = DBMapping(dbItem); if (notify) { MessageManager.SendBlogCommentNotificationMessage(blogComment, LocalizationManager.DefaultAdminLanguage.LanguageID); } return(blogComment); }
private static BlogComment DBMapping(DBBlogComment dbItem) { if (dbItem == null) { return(null); } var item = new BlogComment(); item.BlogCommentId = dbItem.BlogCommentId; item.BlogPostId = dbItem.BlogPostId; item.CustomerId = dbItem.CustomerId; item.IPAddress = dbItem.IPAddress; item.CommentText = dbItem.CommentText; item.CreatedOn = dbItem.CreatedOn; return(item); }