Пример #1
0
        private void addButton_Click(object sender, EventArgs e)
        {
            if (_customerManager.isNameExist(customerNameTextBox.Text))
            {
                MessageBox.Show("Customer Name Is ALREADY Exists!!!");
                return;
            }
            if (String.IsNullOrEmpty(customerNameTextBox.Text) || (String.IsNullOrEmpty(contactNumberTextBox.Text)))
            {
                MessageBox.Show("Name and Mobile Number Must be Added!!!");
                return;
            }

            bool added = _customerManager.AddData(customerNameTextBox.Text, contactNumberTextBox.Text);

            if (added)
            {
                MessageBox.Show("Successfully added.");
            }
            else
            {
                MessageBox.Show("Can't be added.");
            }

            customerDetailsDataGridView.DataSource = _customerManager.ShowData();
        }