Beispiel #1
0
        //addButton_Click Action
        private void addButton_Click(object sender, EventArgs e)
        {
            //Check UNIQUE
            if (_customerManager.IsNameExists(customerNameTextBox.Text))
            {
                MessageBox.Show(customerNameTextBox.Text + " Already Exists!");
                return;
            }
            bool isAdded = _customerManager.AddCustomerInfo(customerNameTextBox.Text, customerAddressTextBox.Text, contactTextBox.Text);

            if (isAdded)
            {
                MessageBox.Show("Saved");
                showDataGridView.DataSource = _customerManager.Display();
            }
            else
            {
                MessageBox.Show("Not Saved");
            }
        }