Esempio n. 1
0
        //Insert Button
        private void addButton_Click(object sender, EventArgs e)
        {
            if (_customerManagement.UniqueCustomerName(customerNameTextBox.Text))
            {
                MessageBox.Show("Name already exits");
                return;
            }
            //add Customer
            bool isAdded = _customerManagement.InsertCustomer(customerNameTextBox.Text, Convert.ToInt32(customerNoTextBox.Text), addressTextBox.Text, Convert.ToInt32(codeTextBox.Text));

            if (isAdded)
            {
                MessageBox.Show("Saved");
            }
            else
            {
                MessageBox.Show("Not Saved");
            }
            //show
            showDataGridView.DataSource = _customerManagement.ShowCustomerInfo();
        }