Exemple #1
0
        private void btnNewCustomer_Click(object sender, EventArgs e)
        {
            frmAddCustomer addAddCustomerForm = new frmAddCustomer();

            addAddCustomerForm.addCustomer = true;
            DialogResult result = addAddCustomerForm.ShowDialog();

            if (result == DialogResult.OK)
            {
                customer       = addAddCustomerForm.customer;
                txtCustID.Text = customer.CustomID.ToString();
                this.DisplayCustomer();
            }
        }
Exemple #2
0
        private void btnModify_Click(object sender, EventArgs e)
        {
            frmAddCustomer addCustomerForm = new frmAddCustomer();

            addCustomerForm.addCustomer = false;
            addCustomerForm.customer    = customer;
            DialogResult result = addCustomerForm.ShowDialog();

            if (result == DialogResult.OK)
            {
                customer = addCustomerForm.customer;
                this.DisplayCustomer();
            }
            else if (result == DialogResult.Retry)
            {
                this.ClearControls();
                this.GetCustomer(customer.CustomID);
            }
        }