示例#1
0
        public ActionResult Vote()
        {
            int id = Convert.ToInt32(Request.Form["id"]);

            if (!BGKFunction.GetMyRole().OyKullanma)
            {
                return(Content("Oy Kullanma yetkiniz yok :("));
            }
            else if (!BGKFunction.IsPostVoted(id))
            {
                bgk_oylama rating = new bgk_oylama();
                rating.Puan = Convert.ToInt32(Request.Form["point"]);
                if (Session["memberInfo"] != null)
                {
                    rating.UyeID = (int)Session["memberID"];
                }
                else
                {
                    rating.OylayanIP = BGKFunction.GetIPAddress();
                }
                rating.YaziID = id;
                Db.bgk_oylama.Add(rating);
                Db.SaveChanges();
                return(Content("Oy kullandığınız için teşekkür ederiz."));
            }
            else
            {
                return(Content("Daha önce oy kullandınız."));
            }
        }