public void carregarCodigoGerente() { try { { FormProjeto projeto = new FormProjeto(); SQLiteConnection conn = new SQLiteConnection(connectBase); if (conn.State == ConnectionState.Closed) { conn.Open(); } SQLiteCommand cmd = new SQLiteCommand("SELECT codPessoa FROM tbPessoas WHERE nomePessoa = '" + projeto.comboGerente.Text.Trim() + "'", conn); SQLiteDataReader ler = cmd.ExecuteReader(); ler.Read(); projeto.textCodGerente.Text = ler["codPessoa"].ToString(); conn.Close(); } } catch (Exception) { MessageBox.Show("Gerente não selecionado \n "); } }
private void projetoToolStripMenuItem_Click(object sender, EventArgs e) { FormProjeto Projetos = new FormProjeto(); Projetos.ShowDialog(); }