private void bindingNavigatorDeleteItem_Click(object sender, EventArgs e) { //if (MessageBox.Show("Anda yakin menghapus data?", "Konfirmasi Hapus Data", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == DialogResult.OK) //{ formDel = new FormDeleteConfirm(FormDeleteConfirm.DeletePin.Giro); if (formDel.ShowDialog(this) == DialogResult.OK) { giro = (TGiro)DataMaster.GetObjectByProperty(typeof(TGiro), TGiro.ColumnNames.GiroNo, giroNoTextBox.Text, TGiro.ColumnNames.BankId, bankIdComboBox.SelectedValue.ToString()); if (giro != null) { DataMaster.Delete(giro); } ModuleControlSettings.SaveLog(ListOfAction.Delete, bankIdComboBox.SelectedValue.ToString() + ";" + giroNoTextBox.Text + ";" + ListOfGiroStatus.Baru.ToString(), ListOfTable.TGiro, lbl_UserName.Text); BindGiroData(); } }
void hapusTransaksiToolStripMenuItem_Click(object sender, EventArgs e) { formDel = new FormDeleteConfirm(FormDeleteConfirm.DeletePin.PO); if (formDel.ShowDialog(this) == DialogResult.OK) { Inventori.Facade.DataMasterMgtServices DataMaster = new Inventori.Facade.DataMasterMgtServices(); Inventori.Data.TTransaction trans = null; if (f_SearchTrans.grid_Search.RowCount > 0) { trans = (Inventori.Data.TTransaction)DataMaster.GetObjectByProperty(typeof(Inventori.Data.TTransaction), Inventori.Data.TTransaction.ColumnNames.TransactionId, decimal.Parse(f_SearchTrans.grid_Search.CurrentRow.Cells[0].Value.ToString())); } if (trans != null) { DataMaster.Delete(trans); ModuleControlSettings.SaveLog(ListOfAction.Delete, f_SearchTrans.grid_Search.CurrentRow.Cells[0].Value.ToString(), ListOfTable.TTransaction, toolStripStatusLabelLoginName.Text); f_SearchTrans.BindData(null, null); f_SearchTrans.Refresh(); } } }