public void postBikeAndOrder(BikeAndOrder BikeAndOrder)
 {
     AddBikeAndOrderParametersForQuerry(
         "insert into Utstyr_has_bestilling(utstyr_utstyr_id, bestilling_bestilling_id) values(@BikeAndOrder.Bike_id, @BikeAndOrder.Order_id);",
         BikeAndOrder
         );
 }
 public void UpdateBikeAndOrder(int bikeId, BikeAndOrder BikeAndOrder)
 {
     AddBikeAndOrderParametersForQuerry(
         "update Utstyr_has_bestilling set [email protected]_id where bestilling_bestilling_id=" + bikeId.ToString() + ";",
         BikeAndOrder
         );
 }
 private void AddBikeAndOrderParametersForQuerry(string command, BikeAndOrder BikeAndOrder)
 {
     try
     {
         using (MySqlConnection conn = new MySqlConnection(ConnectionString))
         {
             conn.Open();
             MySqlCommand cmd = conn.CreateCommand();
             cmd.CommandText = command;
             cmd.Parameters.AddWithValue("@BikeAndOrder.Bike_id", BikeAndOrder.Bike_id);
             cmd.Parameters.AddWithValue("@BikeAndOrder.Order_id", BikeAndOrder.Order_id);
             cmd.ExecuteNonQuery();
             conn.Close();
         }
     }
     catch (MySqlException e)
     {
         throw e;
     }
 }