예제 #1
0
 public Boolean updatePaket(EntPaket ep, int id_paket)
 {
     status = false;
     try
     {
         koneksi.Open();
         query = "UPDATE paket SET id_vendor ='" + ep.getIDVendor() + "', nama_paket ='" + ep.getNamaPaket() + "', harga =" + ep.getHarga() + " WHERE id_paket=" + id_paket + "";
         MySqlCommand command = koneksi.CreateCommand();
         command.CommandText = query;
         command.ExecuteNonQuery();
         status = true;
         koneksi.Close();
     }
     catch (MySqlException me)
     {
         Console.WriteLine(me);
     }
     return(status);
 }
예제 #2
0
 public Boolean insertPaket(EntPaket ep)
 {
     status = false;
     try
     {
         koneksi.Open();
         query = "INSERT INTO paket (id_vendor,nama_paket,harga) VALUES ('" + ep.getIDVendor() + "' ,'" + ep.getNamaPaket() + "' , " + ep.getHarga() + ")";
         MySqlCommand command = koneksi.CreateCommand();
         command.CommandText = query;
         command.ExecuteNonQuery();
         status = true;
         koneksi.Close();
     }
     catch (MySqlException me)
     {
         Console.WriteLine(me);
     }
     return(status);
 }