Beispiel #1
0
 // Редагувати СЛУЖБУ ДОСТАВКИ
 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);
     }
 }
Beispiel #2
0
 // Додати СЛУЖБУ ДОСТАВКИ
 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);
     }
 }