private void FCadastroCandidato_Load(object sender, EventArgs e) { lblCurso.Select(); objRecrutador = new ClsRecrutador(); carregaCursos(); if (modoEdicao) { panel2.Visible = false; gbInformacoesPessoais.Location = new Point(gbInformacoesPessoais.Location.X, this.Height / 2 - (gbInformacoesPessoais.Location.Y + gbInformacoesPessoais.Height + 40 + gbEndereco.Height) / 2); gbEndereco.Location = new Point(gbEndereco.Location.X, gbInformacoesPessoais.Location.Y + gbInformacoesPessoais.Height + 40); gbCursoEtec.Location = new Point(gbCursoEtec.Location.X, this.Height / 2 - (gbCursoEtec.Location.Y + gbCursoEtec.Height + 40 + gbConta.Height) / 2); gbConta.Location = new Point(gbConta.Location.X, gbCursoEtec.Location.Y + gbCursoEtec.Height + 40); btnFinalizar.Location = new Point(gbConta.Location.X + gbConta.Width - btnFinalizar.Width, gbConta.Location.Y + gbConta.Height + 6); this.Text = "Conta"; objCandidato = ClsCandidato.CarregaCandidato(dados, idCandidato); objCandidato.CursoEtec = ClsCursoEtec.CarregaCursoEtec(dados, idCandidato); btnFinalizar.Text = "Alterar"; atualizaTela(); mudaCorCampos(); } else { objCandidato = new ClsCandidato(); } }
private void BtnConsultar_Click(object sender, EventArgs e) { if (ValidaConsultar()) { try { localCurso = cboCurso.SelectedItem.ToString(); localPeriodo = cboPeriodo.SelectedItem.ToString(); localModulo = cboModulo.SelectedItem.ToString(); DataTable tabela = ClsRecrutador.TabelaCandidatos(dados, localCurso, localPeriodo, localModulo); dtConsulta.DataSource = tabela; dtConsulta.Columns["Id"].Visible = false; dtConsulta.Columns["curriculo_id"].Visible = false; dtConsulta.Columns["Periodo"].HeaderText = "Período"; dtConsulta.Columns["Modulo"].HeaderText = "Módulo"; dtConsulta.ColumnHeadersDefaultCellStyle.Font = new Font("Century Gothic", 10); int numLinhas = dtConsulta.Rows.Count; for (int i = 0; i < numLinhas - 1; i++) { dtConsulta.Rows[i].HeaderCell.Value = String.Format("{0}", dtConsulta.Rows[i].Index + 1); if (dtConsulta.Rows[i].Cells[5].Value.ToString() == "") { dtConsulta.Rows[i].DefaultCellStyle.BackColor = Color.FromArgb(243, 160, 160); } } } catch (Exception ex) { MessageBox.Show("Erro:" + ex.Message); } } }