protected virtual void OnCustomerSaving(Customer customer) { if(null != this.CustomerSaving) { this.CustomerSaving(this, new CustomerEventArgs{ Customer = customer}); } }
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; }
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); }
public void UpdateCustomer(Customer customer) { for (int i = 0; i < _customers.Count; i++) { if (_customers[i].Id == customer.Id) { _customers[i] = customer; break; } } }
public void UpdateVIPCustomer(Customer customer) { for (int i = 0; i < _vipCustomers.Count; i++) { if (_vipCustomers[i].Id == customer.Id) { _vipCustomers[i] = customer; break; } } //var target = _vipCustomers.Where(c => c.Id == customer.Id).FirstOrDefault(); //target = customer; }//end method
public void ListAllCustomers(Customer[] customers) { this.dataGridViewCustomers.DataSource = customers; }