Пример #1
0
 public ActionResult AddComment(FormCollection form)
 {
     CommentItem item = new CommentItem();
     UpdateModel(item);
     item.UserName = User.Identity.Name;
     item.DateCreated = DateTime.Now;
     Comment.AddComment(item);
     Comment.Save();
     return RedirectToAction("ViewComment");
 }
Пример #2
0
 // Adds the comment to the database
 public void AddComment(CommentItem s)
 {
     m_db.Comments.Add(s);
     m_db.SaveChanges();
 }