Exemple #1
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();
            }
        }
Exemple #2
0
 public static int Get_Finish(Leg l)
 {
     return(l.GetFinish());
 }