Exemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string name = txtName.Text;

            if (name != "")
            {
                try
                {
                    CC.AddUser(name);

                    dataUsers.DataSource = CC.GetAllUsers();
                    txtName.Text         = string.Empty;
                }
                catch (Exception)
                {
                    MessageBox.Show("Connection error");
                }
            }

            else
            {
                MessageBox.Show("Write a Sales Rep name to add it");
            }

            btnAdd.Enabled = false;
        }