public int AddComment(Comment c, string ajaxSessionKey) { CheckRequest(ajaxSessionKey); CommentManager cm = new CommentManager(); c.CreationDate = DateTime.Now; c.Status = Comment.CommentStatus.Approved; int ret = cm.AddComment(c); return ret; }
public string GetComments(JsonObject pars) { CheckRequest(pars["ajaxSessionKey"].ToString()); string ret = string.Empty; CommentManager cm = new CommentManager(); int totalRecords = 0; List<Comment> comments = cm.GetComments(Convert.ToInt32(pars["signalID"]), Convert.ToInt32(pars["offset"]), out totalRecords); CommentsList s = (CommentsList)new UserControl().LoadControl("/Includes/CommentsList.ascx"); s.Populate(comments, totalRecords); ret = WebUtils.RenderControlToString(s); return ret; }