コード例 #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            GlobalVariables.selectedCustomerID = 0;
            frmCustomersAdd editForm = new frmCustomersAdd();

            editForm.ShowDialog();
            // repopulate list view with updated customer details
            lvCustomers.Items.Clear();
            DisplayCustomers();
        }
コード例 #2
0
        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (lvCustomers.SelectedItems.Count == 0)
            {
                MessageBox.Show("Please select a Customer to update");
                return;
            }
            GlobalVariables.selectedCustomerID = int.Parse(lvCustomers.SelectedItems[0].Text);
            frmCustomersAdd editForm = new frmCustomersAdd();

            editForm.ShowDialog();
            // repopulate list view with updated customer details
            lvCustomers.Items.Clear();
            DisplayCustomers();
        }