public string ViewComment(int topic_id) { ArticalComments c = new ArticalComments(); List <ArticalComments> lst = new List <ArticalComments>(); lst = c.GetByTopicId(topic_id, con); return(JsonConvert.SerializeObject(lst)); }
// GET: ViewComment public ActionResult Index() { int id = ViewBag.topic_id; ArticalComments c = new ArticalComments(); List <ArticalComments> lst = new List <ArticalComments>(); lst = c.GetByTopicId(id, con); return(View(lst.ToList())); }
public string AddComment(int topic_id, string Comment) { ArticalComments comments = new ArticalComments(); comments.Active = 1; comments.commentId = topic_id; comments.topic_id = topic_id; comments.Comments = Comment; comments.created_date = DateTime.Now; comments.userId = Convert.ToInt32(Session["uid"]); comments.Create(comments, con); return("OK"); }