Пример #1
0
 public frmPaket()
 {
     koneksi   = KoneksiDB.Koneksi.getKoneksi();
     impPaket  = new ImpPaket();
     impVendor = new ImpVendor();
     entPaket  = new EntPaket();
     InitializeComponent();
     cmbVendor();
     CmbViewVendor.Focus();
 }
Пример #2
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);
 }
Пример #3
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);
 }