Esempio n. 1
0
        // GET: tblRates/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            RateUs tblRates = db.RateUs.Find(id);

            if (tblRates == null)
            {
                return(HttpNotFound());
            }
            return(View(tblRates));
        }
    // Use this for initialization
    void Start()
    {
        instance = this;
        DontDestroyOnLoad(gameObject);
        //ClearRateInfoBinaryData();

        RateInfo tmp = LoadRateInfoFromBinaryData();

        if (tmp == null)
        {
            rateInfo.count++;
            rateInfo.is_Rated = false;
            instance.SaveRateInfoBinaryData();
        }
        else
        {
            rateInfo = tmp;
            rateInfo.count++;
            instance.SaveRateInfoBinaryData();
        }
    }
Esempio n. 3
0
        public ActionResult Create([Bind(Include = "name,rating")] RateUs Rate)
        {
            if (ModelState.IsValid)
            {
                if (Request.Form["one"] != null)
                {
                    string name = User.Identity.Name;
                    int    rate = 1;
                    Rate.name   = name;
                    Rate.rating = rate;
                    db.RateUs.Add(Rate);
                    db.SaveChanges();
                    Response.Redirect("Thanks2");
                }
                else if (Request.Form["two"] != null)
                {
                    string name = User.Identity.Name;
                    int    rate = 2;
                    Rate.name   = name;
                    Rate.rating = rate;
                    db.RateUs.Add(Rate);
                    db.SaveChanges();
                    Response.Redirect("Thanks2");
                }
                else if (Request.Form["three"] != null)
                {
                    string name = User.Identity.Name;
                    int    rate = 3;
                    Rate.name   = name;
                    Rate.rating = rate;
                    db.RateUs.Add(Rate);
                    db.SaveChanges();
                    Response.Redirect("Thanks2");
                }
                else if (Request.Form["four"] != null)
                {
                    string name = User.Identity.Name;
                    int    rate = 4;
                    Rate.name   = name;
                    Rate.rating = rate;
                    db.RateUs.Add(Rate);
                    db.SaveChanges();
                    Response.Redirect("Thanks");
                }
                else if (Request.Form["five"] != null)
                {
                    string name = User.Identity.Name;
                    int    rate = 5;
                    Rate.name   = name;
                    Rate.rating = rate;
                    db.RateUs.Add(Rate);
                    db.SaveChanges();
                    Response.Redirect("Thanks");
                }


                return(RedirectToAction("Index"));
            }

            return(View(Rate));
        }