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