コード例 #1
0
ファイル: Main.cs プロジェクト: michalrekiec/StaffResources
        private void btnAdd_Click(object sender, EventArgs e)
        {
            var addEditEmployee = new AddEditEmployee();

            addEditEmployee.EmployeeAdded += AddEditEmployee_EmployeeAdded;
            addEditEmployee.ShowDialog();
            addEditEmployee.EmployeeAdded -= AddEditEmployee_EmployeeAdded;
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: michalrekiec/StaffResources
        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;
        }