Beispiel #1
0
 protected virtual void OnCustomerSaving(Customer customer)
 {
     if(null != this.CustomerSaving)
     {
         this.CustomerSaving(this, new CustomerEventArgs{ Customer = customer});
     }
 }
Beispiel #2
0
 public void DisplayCustomerInfo(Customer customer)
 {
     this.buttonOK.Enabled = true;
     this.textBoxId.Text = customer.Id;
     this.textBox1stName.Text = customer.FirstName;
     this.textBoxLastName.Text = customer.LastName;
     this.textBoxAddress.Text = customer.Address;
 }
Beispiel #3
0
 private void buttonOK_Click(object sender, EventArgs e)
 {
     var customer        = new Customer();
     customer.Id         = this.textBoxId.Text.Trim();
     customer.FirstName  = this.textBox1stName.Text.Trim();
     customer.LastName   = this.textBoxLastName.Text.Trim();
     customer.Address    = this.textBoxAddress.Text.Trim();
     this.OnCustomerSaving(customer);
 }
Beispiel #4
0
 public void UpdateCustomer(Customer customer)
 {
     for (int i = 0; i < _customers.Count; i++)
     {
         if (_customers[i].Id == customer.Id)
         {
             _customers[i] = customer;
             break;
         }
     }
 }
Beispiel #5
0
 public void ListAllCustomers(Customer[] customers)
 {
     this.dataGridViewCustomers.DataSource = customers;
 }