// Редагувати СЛУЖБУ ДОСТАВКИ public static void updateCourier(Courier x) { try { MySqlCommand command = new MySqlCommand("UPDATE fruitsvegetables.couriers SET name = '" + x.getName() + "', phone = '" + x.getPhone() + "', price = '" + x.getPrice() + "' WHERE idCouriers = " + x.getIdCouriers() + ";", connect); command.ExecuteNonQuery(); } catch (MySql.Data.MySqlClient.MySqlException ex) { MessageBox.Show(ex.Message); } }
// Додати СЛУЖБУ ДОСТАВКИ public static void addCourier(Courier x) { try { MySqlCommand command = new MySqlCommand("INSERT INTO fruitsvegetables.couriers (`idCouriers`, `name`, `phone`, `price`) VALUES ( null, '" + x.getName() + "', '" + x.getPhone() + "', '" + x.getPrice() + "');", connect); command.ExecuteNonQuery(); } catch (MySql.Data.MySqlClient.MySqlException ex) { MessageBox.Show(ex.Message); } }