internal void LoadGear(string filename, object side)
 {
     using (FileStream fs = new FileStream(filename, FileMode.Open))
     {
         String str;
         Gear g;
         StreamReader sr = new StreamReader(fs);
         List<String> myLines = new List<String>();
         while ((str = sr.ReadLine()) != null)
         {
             if (!myLines.Contains(str))
             {
                 myLines.Add(str);
             }
         }
         foreach(String s in myLines) {
             g = new Gear(s, 1, 10, (Side)side);
             this.InsertGear(g);
         }
     }
 }
 public void InsertInBothTables(Gear g, Unit u)
 {
     InsertGear(g);
     InsertUnit(u);
 }
 public void UpdateGear(Gear g)
 {
     using (MySqlConnection conn = new MySqlConnection(this.ConnectionString))
     {
         conn.Open();
         string commandText = "UPDATE Geschaeftspartner SET CLASSNAME = ?, UPGRADELEVEL = ?, PRICE = ? WHERE id = ?";
         MySqlCommand cmd = new MySqlCommand(commandText, conn);
         cmd.Parameters.AddWithValue("?", g.Classname);
         cmd.Parameters.AddWithValue("?", g.UpgradeLevel);
         cmd.Parameters.AddWithValue("?", g.Price);
         ExecutionErrorHandler(cmd);
     }
 }
 public void InsertGear(Gear g)
 {
     using (MySqlConnection conn = new MySqlConnection(this.ConnectionString))
     {
         conn.Open();
         string commandText = "INSERT INTO Gear(CLASSNAME, UPGRADELEVEL, PRICE, SIDE) VALUES (?class, ?upgrade, ?price, ?side)";
         MySqlCommand cmd = new MySqlCommand(commandText, conn);
         cmd.Parameters.AddWithValue("?class", g.Classname);
         cmd.Parameters.AddWithValue("?upgrade", Convert.ToInt32(g.UpgradeLevel));
         cmd.Parameters.AddWithValue("?price", g.Price);
         cmd.Parameters.AddWithValue("?side", g.Side);
         ExecutionErrorHandler(cmd);
     }
 }