Beispiel #1
0
        protected void BtnRank_Click(object sender, CommandEventArgs e)
        {
            NewsServiceClient newsSvc = new NewsServiceClient();

            AdminClientApp.NewsSVC.Ranking ranking = new AdminClientApp.NewsSVC.Ranking();
            using (ListView row = (ListView)((ImageButton)sender).Parent.Parent.Parent.Parent.Parent)
            {
                int newsID = int.Parse(e.CommandArgument.ToString());
                ranking.NewsID = newsID;
                ranking.UserID = int.Parse(Session["userID"].ToString());
                if (e.CommandName.ToString() == "Positive")
                {
                    ranking.Rank = 1;
                }
                else
                {
                    ranking.Rank = 0;
                }
                newsSvc.AddToRanking(ranking);
            }
        }