public ActionResult StworzKomentarzJava(int id, string content) { Debug.WriteLine(id + content); Comments comment = new Comments(); comment.content = content; comment.User_ID = ObsługaBazyDanych.zwrocIdUzytkownikaPoUsername(User.Identity.Name); ObsługaBazyDanych.dodajKomentarz(id, comment); return(Json(new { id1 = id }, JsonRequestBehavior.AllowGet)); }
public ActionResult StworzKomentarz(Comments comment) { var idPostu = (int)TempData["PostCommentId"]; if (ModelState.IsValid) { comment.User_ID = ObsługaBazyDanych.zwrocIdUzytkownikaPoUsername(User.Identity.Name); ObsługaBazyDanych.dodajKomentarz(idPostu, comment); return(RedirectToAction("WyswietlPost", new { id = idPostu })); } return(View()); }