public static void Update(Objeto obj) { MySqlConnection connectionLive = databaseMySqlConnection(); MySqlCommand command = new MySqlCommand("modificar" + obj.Tipo, connectionLive); command.CommandType = CommandType.StoredProcedure; Query(obj, connectionLive, command); }
private static void Query(Objeto obj, MySqlConnection con, MySqlCommand com) { foreach (Parametro param in obj.Parametros) { com.Parameters.AddWithValue(param.Arg, param.Value); } try { con.Open(); com.ExecuteNonQuery(); con.Close(); } catch (MySqlException ex) { } }