private void btnAdd_Click(object sender, EventArgs e) { frmAddCustomer addCustomerForm = new frmAddCustomer(); Customer customer = addCustomerForm.GetNewCustomer(); if (customer != null) { customers += customer; } }
private void btnDelete_Click(object sender, EventArgs e) { int i = lstCustomers.SelectedIndex; if (i != -1) { Customer customer = customers[i]; string message = "Are you sure you want to delete " + customer.FirstName + " " + customer.LastName + "?"; DialogResult button = MessageBox.Show(message, "Confirm Delete", MessageBoxButtons.YesNo); if (button == DialogResult.Yes) { customers -= customer; } } }
private void HandleChange(CustomerList list) { customers.Save(); FillCustomerListBox(); }
private void RespondToChange(CustomerList customers) { MessageBox.Show("Change must have fired."); //CustomerDB.SaveCustomers(customers); FillCustomerListBox(); }
private void Customers_hasBeenEdited(CustomerList customers) { throw new NotImplementedException(); }
private void SaveAndUpdate(CustomerList list) { list.Save(); FillCustomerListBox(); }