Example #1
0
 protected virtual void OnCustomerSaving(Customer customer)
 {
     if(null != this.CustomerSaving)
     {
         this.CustomerSaving(this, new CustomerEventArgs{ Customer = customer});
     }
 }
Example #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;
 }
Example #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);
 }
Example #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;
         }
     }
 }
Example #5
0
        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
Example #6
0
 public void ListAllCustomers(Customer[] customers)
 {
     this.dataGridViewCustomers.DataSource = customers;
 }