Esempio n. 1
0
        public ActionResult Details(int id)
        {
            PopsRatingDB db = new PopsRatingDB();

            ViewBag.rating = db.avg_rating(id);
            return(View(pops.list(id)[0]));
        }
Esempio n. 2
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));
        }
Esempio n. 3
0
        // GET: PopsRating
        public ActionResult Index()
        {
            PopsRatingDB db = new PopsRatingDB();

            return(View(db.list()));
        }