Ejemplo n.º 1
0
        public void enterAthleteTime(Athlete currAthlete, SpeedSkatingEvent currEvent)
        {
            SqlConnection conn         = new SqlConnection("Data Source=LAPTOP-TGJJO15J\\sqlexpress;Initial Catalog=WinterOlympics;Integrated Security=TRUE;MultipleActiveResultSets=True");
            string        timestring   = "00:" + minutes + ":" + seconds + ":" + milliseconds;
            string        updatestring = "update SpeedSkatingTimes set Time = '" + timestring + "' where EventID = " + currEvent.giveEventkId() + " and ParticipantID = " + currAthlete.giveAthleteID() + ";";

            conn.Open();
            SqlCommand cmd = new SqlCommand(updatestring, conn);

            cmd.ExecuteNonQuery();
            conn.Close();
        }
Ejemplo n.º 2
0
        public void enterSingleScoresIntoDB(FigureSkatingEvent CurrFigureSkatingEvent, Athlete CurrAthlete)
        {
            SqlConnection conn         = new SqlConnection("Data Source=LAPTOP-TGJJO15J\\sqlexpress;Initial Catalog=WinterOlympics;Integrated Security=TRUE;MultipleActiveResultSets=True");
            string        updatestring = "Update FigureSkatingScores Set Judge1ID = " + idsandscores[0, 0] + ", Judge1Score = " + idsandscores[1, 0] + ", Judge2ID = " + idsandscores[0, 1] + ", Judge2Score = " + idsandscores[1, 1] + ", Judge3ID = " + idsandscores[0, 2] + ", Judge3Score = " + idsandscores[1, 2] + ", Judge4ID = " + idsandscores[0, 3] + ", Judge4Score = " + idsandscores[1, 3] + ", Judge5ID = " + idsandscores[0, 4] + ", Judge5Score = " + idsandscores[1, 4] + ", Judge6ID = " + idsandscores[0, 5] + ", Judge6Score = " + idsandscores[1, 5] + ", Judge7ID = " + idsandscores[0, 6] + ", Judge7Score = " + idsandscores[1, 6] + ", Judge8ID = " + idsandscores[0, 7] + ", Judge8Score = " + idsandscores[1, 7] + ", Judge9ID = " + idsandscores[0, 8] + ", Judge9Score = " + idsandscores[1, 8] + " where EventID = " + CurrFigureSkatingEvent.giveEventkId() + " and ParticipantID = " + CurrAthlete.giveAthleteID() + "; ";

            conn.Open();
            SqlCommand cmd = new SqlCommand(updatestring, conn);

            cmd.ExecuteNonQuery();
            conn.Close();
        }
Ejemplo n.º 3
0
        public void enterSingleFinalScoreIntoDB(FigureSkatingEvent CurrFigureSkatingEvent, Athlete CurrAthlete)
        {
            SqlConnection conn         = new SqlConnection("Data Source=LAPTOP-TGJJO15J\\sqlexpress;Initial Catalog=WinterOlympics;Integrated Security=TRUE;MultipleActiveResultSets=True");
            string        updatestring = "Update FigureSkatingScores Set Score = " + finalscore + "where EventID = " + CurrFigureSkatingEvent.giveEventkId() + " and ParticipantID = " + CurrAthlete.giveAthleteID() + "; ";

            conn.Open();
            SqlCommand cmd = new SqlCommand(updatestring, conn);

            cmd.ExecuteNonQuery();
            conn.Close();
        }
        public void registerAthleteForEvent(Athlete currAthlete)
        {
            string        insertString = "Insert into SpeedSkatingTimes(EventID,ParticipantID) values(" + id + "," + currAthlete.giveAthleteID() + ");";
            SqlConnection conn         = new SqlConnection("Data Source=LAPTOP-TGJJO15J\\sqlexpress;Initial Catalog=WinterOlympics;Integrated Security=TRUE;MultipleActiveResultSets=True");

            conn.Open();
            SqlCommand cmd = new SqlCommand(insertString, conn);

            cmd.ExecuteNonQuery();
            conn.Close();
        }