Table of Contents

Class Comment

Namespace
Dynamicweb.Content.Commenting
Assembly
Dynamicweb.dll
Represents comments and ratings of items in Dynamicweb
public class Comment
Inheritance
Comment
Inherited Members

Constructors

Comment()

Initializes a new instance of Comment.
public Comment()

Properties

Active

Gets or sets a value indicating whether this Comment is active.
public bool Active { get; set; }

Property Value

bool

CreatedBy

Gets or sets the user id that created this comment, if logged in.
public int CreatedBy { get; set; }

Property Value

int

CreatedDate

Gets or sets the created date.
public DateTime CreatedDate { get; set; }

Property Value

DateTime

EditedBy

Gets or sets the user id that edited this comment, if logged in.
public int EditedBy { get; set; }

Property Value

int

EditedDate

Gets or sets the edited date.
public DateTime EditedDate { get; set; }

Property Value

DateTime

Email

Gets or sets the email of the user who comments.
public string Email { get; set; }

Property Value

string

ID

public int ID { get; set; }

Property Value

int

Ip

Gets or sets the ip address of the user who commented.
public string Ip { get; set; }

Property Value

string

IsNew

public bool IsNew { get; }

Property Value

bool

ItemID

Gets or sets the identifier of commented item, e.g. product id or page id.
public string ItemID { get; set; }

Property Value

string

ItemType

Gets or sets the type of the item. I.e. page, product, news
public string ItemType { get; set; }

Property Value

string

LanguageId

Gets or sets the language identifier, e.g. "LANG1" as product language id or "1" as page area id.
public string LanguageId { get; set; }

Property Value

string

Likes

Gets or sets the number of likes of this comment.
public int Likes { get; set; }

Property Value

int

Name

Gets or sets the name of the user who comments.
public string Name { get; set; }

Property Value

string

Nolikes

Gets or sets the number of nolikes of this comment.
public int Nolikes { get; set; }

Property Value

int

ParentID

Gets or sets the ID of the parent comment.
public int ParentID { get; set; }

Property Value

int

Rating

Gets or sets the rating made by the user who comments.
public int Rating { get; set; }

Property Value

int

Replies

Gets the replies.
public CommentCollection Replies { get; }

Property Value

CommentCollection
The replies.

Text

Gets or sets the text/comment of the user who comments.
public string Text { get; set; }

Property Value

string

Token

[Obsolete("Use GetToken instead.")]
public string Token { get; }

Property Value

string

Website

Gets or sets the website of the user who comments.
public string Website { get; set; }

Property Value

string

Methods

Delete()

[Obsolete("Use Services.Comments.Delete instead.")]
public void Delete()

Delete(int)

Deletes the comment with specified ID.
[Obsolete("Use Services.Comments.Delete instead.")]
public static void Delete(int id)

Parameters

id int
Comment ID to delete.

Fill(IDataReader)

Fills the object with data from the specified datareader.
[Obsolete("Do not use")]
public void Fill(IDataReader reader)

Parameters

reader IDataReader
The datareader.

FillRow(DataRow)

Fills the row with the values of the properties.
[Obsolete("Do not use")]
protected void FillRow(DataRow row)

Parameters

row DataRow
The row.

GetCommentById(int)

Gets a comment by Comment id.
[Obsolete("Use Services.Comments.GetCommentById instead.")]
public static Comment GetCommentById(int id)

Parameters

id int
The id of the comment to retrieve.

Returns

Comment

GetComments()

Gets all the comments.
[Obsolete("Use Services.Comments.GetComments instead.")]
public static CommentCollection GetComments()

Returns

CommentCollection

GetComments(string, string, string)

Gets the comments by type, language and id.
[Obsolete("Use Services.Comments.GetComments instead.")]
public static CommentCollection GetComments(string itemType, string itemID, string languageID)

Parameters

itemType string
Type of the item, i.e "ecomProduct".
itemID string
The item ID, i.e. "PROD1".
languageID string
The langugage ID, i.e. "LANG1".

Returns

CommentCollection

GetComments(string, string, string, bool)

Gets the comments by type, language and id.
[Obsolete("Use Services.Comments.GetComments instead.")]
public static CommentCollection GetComments(string itemType, string itemID, string languageID, bool onlyActive)

Parameters

itemType string
Type of the item, i.e "ecomProduct".
itemID string
The item ID, i.e. "PROD1".
languageID string
The langugage ID, i.e. "LANG1".
onlyActive bool
If set to true, only return comments marked as active (approved)

Returns

CommentCollection

GetCommentsBySql(string)

Gets the comments by SQL.
[Obsolete("Use Services.Comments.GetComments instead.")]
public static CommentCollection GetCommentsBySql(string sql)

Parameters

sql string
The SQL.

Returns

CommentCollection

GetCommentsByTypeAndId(string, string)

Gets the comments by type and id.
[Obsolete("Use Services.Comments.GetComments instead.")]
public static CommentCollection GetCommentsByTypeAndId(string itemType, string itemID)

Parameters

itemType string
Type of the item, i.e "ecomProduct".
itemID string

Returns

CommentCollection

GetCommentsByTypeLanguageAndId(string, string, string)

[Obsolete("Use Services.Comments.GetComments instead.")]
public static CommentCollection GetCommentsByTypeLanguageAndId(string itemType, string itemID, string languageID)

Parameters

itemType string
itemID string
languageID string

Returns

CommentCollection

GetCommentsByTypeLanguageAndId(string, string, string, bool)

[Obsolete("Use Services.Comments.GetComments instead.")]
public static CommentCollection GetCommentsByTypeLanguageAndId(string ItemType, string itemID, string languageID, bool onlyActive)

Parameters

ItemType string
itemID string
languageID string
onlyActive bool

Returns

CommentCollection

GetToken()

Gets a token that can be used to verify actions, e.g. delete, like etc.
public string GetToken()

Returns

string

IsValidToken(string)

public bool IsValidToken(string token)

Parameters

token string

Returns

bool

Save()

Saves current data to the data base.
[Obsolete("Use Services.Comments.Save instead.")]
public void Save()
To top