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 ListAllCustomers(Customer[] customers) { this.dataGridViewCustomers.DataSource = customers; }