예제 #1
0
        public static void UpVoteAnswer(int answerID)
        {
            Answers a = Answers.Read(answerID);

            a.UpVotes = a.UpVotes + 1;
            IDbConnection db = new SqlConnection(server);

            db.Update(a);
        }
예제 #2
0
        public static void DownVoteAnswer(int answerID)
        {
            Answers a = Answers.Read(answerID);

            a.UpVotes = a.UpVotes - 1;
            IDbConnection db = new SqlConnection(server);

            //db.Update(a);
            db.Query($"Update Answers SET Upvotes='{a.UpVotes}' where ID='{answerID}'");
        }