Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            var dialog = MessageBox.Show("Are you sure you wan't to add this employee?", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dialog == DialogResult.Yes)
            {
                emp.Insert(new Employee(txtEmpID.Text, txtFullname.Text, txtPosition.Text));
                MessageBox.Show("Employee Added!", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                NewEmployee?.Invoke(emp);
                Close();
            }
        }