Пример #1
0
 private void BtnEdit_Click(object sender, RoutedEventArgs e)
 {
     if (string.IsNullOrEmpty(ComboBoxJasaLayanan.Text))
     {
         MessageBox.Show("Silahkan pilih data terlebih dahulu", "Warning");
         return;
     }
     else
     {
         conn.Open();
         TransaksiProduk tr = new TransaksiProduk();
         adapter = new MySqlDataAdapter("update detail_transaksi_jasalayanan dt, transaksi tr SET dt.ID_JASA_LAYANAN = '" + ComboBoxJasaLayanan.SelectedValue + "', dt.JUMLAH = '" + JumlahJasaLayananText.Text + "' WHERE dt.ID_TRANSAKSI = tr.ID_TRANSAKSI AND tr.ID_TRANSAKSI = '" + idTransaksi + "' AND dt.ID_DETAILTRANSAKSI_JASALAYANAN = '" + idDetail + "'", conn);
         adapter.Fill(ds, "detail_transaksi_jasalayanan");
         MessageBox.Show("Edit berhasil!", "Success");
         conn.Close();
         this.Close();
     }
 }
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            TransaksiProduk TP = new TransaksiProduk();

            TP.GetRecords();
        }