private void buttonHapus_Click(object sender, EventArgs e) { try { if (string.IsNullOrEmpty(txtCari.Text.Trim())) { MessageBox.Show("Text Pencarian Kosong"); throw null; } var list = new CustomerControl(); list.DeleteCustomer(txtCari.Text); MessageBox.Show("Data Berhasil Dihapus"); buttonHapus.Enabled = false; } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public void DeleteCustomer(int customerId) { customerControl.DeleteCustomer(customerId); }