Exemple #1
0
 public static bool GetLegGewonnen(Leg l)
 {
     if (l.GetRest() == 0)
     {
         return(true);
     }
     return(false);
 }
Exemple #2
0
        public static void InsertLeg(Leg leg, Set set)
        {
            string query = "INSERT INTO leg (`id_leg`, `id_set`, `legNummer`, `rest`, `finish`) VALUES ('" + leg.GetId() + "', '" + set.GetId() + "', '" + leg.GetLegNummer() + "', '" + leg.GetRest() + "', '" + leg.GetFinish() + "')";

            //open connection
            if (OpenConnection() == true)
            {
                try
                {
                    //create command and assign the query and connection from the constructor
                    MySqlCommand cmd = new MySqlCommand(query, connection);

                    //Execute command
                    cmd.ExecuteNonQuery();
                }
                catch (Exception e)
                {
                    Console.WriteLine("Leg:" + e.Message);
                    Console.ReadLine();
                }
                //close connection
                CloseConnection();
            }
        }