Exemplo n.º 1
0
        public void AddRankID(round round, Int64 id, judge_value value)
        {
            String judge_string = value == judge_value.A ? "a" : "b";
            String query        = String.Format("UPDATE rounds SET judge_{0}_ranks = {1} WHERE id = {2};", judge_string, id, round.id);

            using (SQLiteCommand command = new SQLiteCommand(query, connection))
            {
                command.ExecuteNonQuery();
            }
        }
Exemplo n.º 2
0
        public void AddScore(round round, Int64 team_a_score, Int64 team_b_score, judge_value value)
        {
            String judge_string = value == judge_value.A ? "a" : "b";
            String query        = String.Format("UPDATE rounds SET judge_{0}_score_team_a = {1} WHERE id = {2}", judge_string, team_a_score, round.id);

            using (SQLiteCommand command = new SQLiteCommand(query, connection))
            {
                command.ExecuteNonQuery();
            }
            String query2 = String.Format("UPDATE rounds SET judge_{0}_score_team_b = {1} WHERE id = {2}", judge_string, team_b_score, round.id);

            using (SQLiteCommand command = new SQLiteCommand(query2, connection))
            {
                command.ExecuteNonQuery();
            }
        }
Exemplo n.º 3
0
        public List <round> GetRounds(Int64 round_number = 0)
        {
            List <round> rounds = new List <round>();
            String       query  = "SELECT * FROM rounds";

            if (round_number != 0)
            {
                query = String.Format("SELECT * FROM rounds WHERE round_number = {0}", round_number);
            }
            using (SQLiteCommand command = new SQLiteCommand(query, connection))
            {
                using (SQLiteDataReader reader = command.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        round round = ReaderToRound(reader);
                        rounds.Add(round);
                    }
                }
            }
            return(rounds);
        }