示例#1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var addEditEmployee = new AddEditEmployee();

            addEditEmployee.EmployeeAdded += AddEditEmployee_EmployeeAdded;
            addEditEmployee.ShowDialog();
            addEditEmployee.EmployeeAdded -= AddEditEmployee_EmployeeAdded;
        }
示例#2
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (dgvStaff.SelectedRows.Count == 0)
            {
                MessageBox.Show("Proszę zaznacz pracownika");
                return;
            }

            var addEditEmployee = new AddEditEmployee(Convert.ToInt32(dgvStaff.SelectedRows[0].Cells[0].Value));

            addEditEmployee.EmployeeAdded += AddEditEmployee_EmployeeAdded;
            addEditEmployee.ShowDialog();
            addEditEmployee.EmployeeAdded -= AddEditEmployee_EmployeeAdded;
        }