Example #1
0
        private void m_EditCustomerButton_Click(object sender, EventArgs e)
        {
            if (m_CustomerListView.SelectedItems.Count == 1)
            {
                CustomerListViewItem customer = m_CustomerListView.SelectedItems[0] as CustomerListViewItem;
                CustomerForm         dialog   = new CustomerForm(customer.Customer);
                if (dialog.ShowDialog() == DialogResult.OK)
                {
                    SaveCustomer(dialog);
                }

                dialog.Close();
                dialog.Dispose();
            }
        }
Example #2
0
        private void m_DeleteCustomerButton_Click(object sender, EventArgs e)
        {
            if (m_CustomerListView.SelectedItems.Count == 1)
            {
                CustomerListViewItem customerListViewItem =
                    m_CustomerListView.SelectedItems[0] as CustomerListViewItem;

                customerListViewItem.Customer.IsActive   = false;
                customerListViewItem.Customer.IsModified = true;

                m_Model.SaveCustomer(customerListViewItem.Customer);

                RefreshCustomers();
            }
        }