public ActionResult OneNokta(FormCollection aCollection) { CommentsModel CM = new CommentsModel(); CM.AddCommnet(aCollection["Text_Comments"], int.Parse(Session["UserID"].ToString()), int.Parse(aCollection["NoktaID_Hidden"].ToString())); return RedirectToAction("OneNokta", new { @NoktaID = aCollection["NoktaID_Hidden"] }); }
public ActionResult OneNokta(int NoktaID) { NoktaModel N=new NoktaModel(); CommentsModel CM=new CommentsModel(); ViewBag.ANokta = N.SelectNokta(NoktaID); ViewBag.Comments = CM.SelectCommnet(NoktaID); NoktaContext c = new NoktaContext(); ViewBag.NumberOfVotesUp = c.Voteses.Where(x=>x.NoktaId==NoktaID && x.VoteValue == true).Count(); ViewBag.NumberOfVotesDown = c.Voteses.Where(x=>x.NoktaId==NoktaID && x.VoteValue == false).Count(); return View(); }