Example #1
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     frmAddCustomer addCustomerForm = new frmAddCustomer();
     Customer customer = addCustomerForm.GetNewCustomer();
     if (customer != null)
     {
         customers += customer;
     }
 }
Example #2
0
 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;
         }
     }
 }
Example #3
0
 private void HandleChange(CustomerList list)
 {
     customers.Save();
     FillCustomerListBox();
 }
Example #4
0
 private void HandleChange(CustomerList list)
 {
     customers.Save();
     FillCustomerListBox();
 }
Example #5
0
 private void RespondToChange(CustomerList customers)
 {
     MessageBox.Show("Change must have fired.");
     //CustomerDB.SaveCustomers(customers);
     FillCustomerListBox();
 }
Example #6
0
 private void Customers_hasBeenEdited(CustomerList customers)
 {
     throw new NotImplementedException();
 }
Example #7
0
 private void SaveAndUpdate(CustomerList list)
 {
     list.Save();
     FillCustomerListBox();
 }