/// <summary> /// Adds a new comment /// </summary> /// <param name="article"></param> /// <returns></returns> public Int32 AddNewComment(ArticleComment articleComment) { ArticleComment comment = new ArticleComment(); Int32 retVal; if (comment == null) throw new ArgumentNullException("articleComment"); operationParams.Clear(); operationParams.Add("name", articleComment.Name); operationParams.Add("email", articleComment.Email); operationParams.Add("comment", articleComment.Comment); operationParams.Add("createDate", DateTime.Parse(articleComment.CreateDate)); operationParams.Add("articleId", articleComment.ArticleID); retVal = Convert.ToInt32(dataController.ExecuteOperation(OperationType.AddNewComment, operationParams)); return retVal; }
/// <summary> /// Creates a new comment /// </summary> /// <param name="articleId"></param> /// <param name="articleComment"></param> public void PostComment(ArticleComment articleComment) { blogArticleCommentRepository.AddNewComment(articleComment); }
/// <summary> /// Updates the specified article /// </summary> /// <param name="article"></param> /// <returns></returns> public Int32 UpdateComment(ArticleComment articleComment) { Int32 retVal = 0; //fire an update sql statement on the DB table to update the comment //by the data provided. return retVal; }