private void SimpanTSB_Click(object sender, EventArgs e) { mrate K = new mrate(); K.DATE = txtDate.Value; K.CURRENCYID = txtCurrencyID.Text; K.KURS = (float)Convert.ToDouble(txtKurs.Text); if (new mrateCRUD().insertData(K)) { MessageBox.Show("Data berhasil di tambahkan"); Binding(); } else { MessageBox.Show("Data gagal ditambahkan"); } }
private void UbahTSB_Click(object sender, EventArgs e) { mrate k = new mrate(); k.ID = Convert.ToInt32(txtID.Text); k.DATE = txtDate.Value; k.CURRENCYID = txtCurrencyID.Text; if (new mrateCRUD().updateData(k)) { MessageBox.Show("Update Sukses"); Binding(); } else { MessageBox.Show("Update tidak berhasil"); } }