public ActionResult Details(int id) { PopsRatingDB db = new PopsRatingDB(); ViewBag.rating = db.avg_rating(id); return(View(pops.list(id)[0])); }
public ActionResult Rate(PopsRating novo) { PopsRatingDB db = new PopsRatingDB(); if (ModelState.IsValid) { if (novo.rating_pos < 1 || novo.rating_pos > 5) { return(View(novo)); } novo.id_user = int.Parse(Session["userid"].ToString()); db.create(novo); return(RedirectToAction("index")); } return(View(novo)); }
// GET: PopsRating public ActionResult Index() { PopsRatingDB db = new PopsRatingDB(); return(View(db.list())); }