public ActionResult ChitchatForm(int id) { var item = rpsItemsRepo.GetItemById(id); var users = rpsUserRepo.GetAll(); var currentUser = users.Single(u => u.Id == CURRENT_USER_ID); var model = new PtItemCommentsVm(item, currentUser); return(PartialView("_Chitchat", model)); }
public ActionResult Chitchat(int id, PtItemCommentsVm vm) { ViewBag.screen = DetailScreenEnum.Chitchat; try { PtNewComment commentNew = new PtNewComment { ItemId = id, Title = vm.NewCommentText, UserId = CURRENT_USER_ID }; rpsCommentsRepo.AddNewComment(commentNew); return(RedirectToAction("Chitchat")); } catch { return(RedirectToAction("Chitchat")); } }