public ActionResult AddComment(int id) { AddCommentViewModel vm = new AddCommentViewModel { EntryId = id, Comments = Rep.GetCommentsByEntryId(id) }; return PartialView("Add", vm); }
public PartialViewResult AddComment(AddCommentViewModel vm) { if (ModelState.IsValid) { Comment comment = new Comment { AccountId = Convert.ToInt32(GetSUD()), Active = 1, Created = DateTime.Now, Comment1 = vm.Comment, EntryId = vm.EntryId }; Rep.AddComment(comment); Rep.Save(); return PartialView("Success"); } return PartialView("Error"); }