Пример #1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var addEditEmployee = new AddEditEmployee();

            addEditEmployee.FormClosing += AddEditEmployee_FormClosing;
            addEditEmployee.ShowDialog();
        }
Пример #2
0
        private void DismissalEmployee(int id)
        {
            var employees = _fileHelper.DeserializeFromFile();

            AddEditEmployee employee = new AddEditEmployee();

            employee.AddNewEmployeeToList(employees, id);
        }
Пример #3
0
        private void btnEdit_Click(object sender, EventArgs e)
        {
            if (dvgEmployes.SelectedRows.Count == 0)
            {
                MessageBox.Show("Proszę zaznacz pracownika, którego dane chcesz edytować");
            }

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

            addEditEmployee.FormClosing += AddEditEmployee_FormClosing;
            addEditEmployee.ShowDialog();
        }