Пример #1
0
        private void addButton_Click(object sender, EventArgs e)
        {
            Customer customer = new Customer();

            customer.Name = nameTextBox.Text;
            //Name unique check
            if (_customerManager.IsNameExists(customer))
            {
                MessageBox.Show(nameTextBox.Text + " Already Exists!");
                return;
            }
            customer.address = addressTextBox.Text;
            customer.contact = contactTextBox.Text;

            if (_customerManager.AddMethod(customer))
            {
                MessageBox.Show("Saved");
            }
            else
            {
                MessageBox.Show("Not saved");
            }
            showDataGridView.DataSource = _customerManager.ShowMethod();
        }