예제 #1
0
파일: CustomerUi.cs 프로젝트: siam35/batch7
        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();
        }