private void DgpJobRoles_CellContentClick(object sender, DataGridViewCellEventArgs e) { try { if (e.ColumnIndex == 4) { string id = dgvJobRoles.Rows[e.RowIndex].Cells[0].Value.ToString(); if (id.Trim() != "") { if (DialogResult.Yes == MessageBox.Show("Tem certeza que deseja excluir o cargo?", "Confirmação", MessageBoxButtons.YesNo, MessageBoxIcon.Question)) { int idI = int.Parse(id); if (!_planningService.ExistsWithJobRole(idI)) { _service.ActivateOrDeactivateById(idI, false); LoadToDataGridView(); } else { MessageBox.Show("Cargos associados a projetos não podem ser excluídos!", "Aviso", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } } else if (e.ColumnIndex == 3) { string id = dgvJobRoles.SelectedCells[0].Value.ToString(); JobRole jobRole = _service.ReadById(long.Parse(id)); JobRoleForm jobRoleForm = new JobRoleForm(jobRole.Id); jobRoleForm.ShowDialog(); } } catch (Exception) { } }
private void Button3_Click_1(object sender, EventArgs e) { JobRoleForm jobRoleForm = new JobRoleForm(); jobRoleForm.ShowDialog(); }
private void BtnNovoRecurso_Click(object sender, EventArgs e) { JobRoleForm jobRoleForm = new JobRoleForm(); jobRoleForm.ShowDialog(); }