예제 #1
0
        private static void VoteForPizza()
        {
            PostParams = WebUtil.RetrievePostParameters();

            var pizza = DataBridge.GetPizzaById(int.Parse(PostParams["pizzaid"]));

            var vote = PostParams["pizzaVote"];

            if (vote == "up")
            {
                pizza.UpVotes++;
            }
            else if (vote == "down")
            {
                pizza.DownVotes++;
            }

            DataBridge.SaveChanges();
        }