-
Notifications
You must be signed in to change notification settings - Fork 0
/
TelaConsultaEdicao.cs
82 lines (75 loc) · 3.57 KB
/
TelaConsultaEdicao.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
using System;
using System.Data;
using System.Windows.Forms;
using System.Data.SQLite;
namespace talentoso
{
public partial class TelaConsultaEdicao : Form
{
public TelaConsultaEdicao()
{
InitializeComponent();
}
public string numero_id;
public string classificacao;
private Int64 id_pessoa;
private void TelaConsultaEdicao_Load(object sender, EventArgs e)
{
/* txbNome.Enabled = false;
txbEmail.Enabled = false;
mtxbNascimento.Enabled = false;
mtxbCelular.Enabled = false;
txbClassificacao.Enabled = false;
txbCurso.Enabled = false;
txbMatricula.Enabled = false;
txbSemestre.Enabled = false;
dgListaTalento.Enabled = false;
*/
switch (classificacao)
{
case "dicente":
{
using (SQLiteConnection cnn = new SQLiteConnection("data source=talentoso.db"))
{
cnn.Open();
/*Carregando os dados pessoais e acadêmicos
* através do numero da linha
* onde tal cadastro está armazenado na tabaela 'formulario'*/
string query = "SELECT *FROM formulario where numero = "+numero_id;
using (SQLiteCommand command = new SQLiteCommand(query, cnn))
{
using (SQLiteDataReader reader = command.ExecuteReader())
{
reader.Read();
id_pessoa = Convert.ToInt64(reader["numero"]);
txbNome.Text = reader["nome"].ToString();
txbEmail.Text = reader["email"].ToString();
mtxbNascimento.Text = reader["nascimento"].ToString();
mtxbCelular.Text = reader["telefone"].ToString();
txbClassificacao.Text = reader["classificacao"].ToString(); //
txbCurso.Text = reader["curso"].ToString();
txbSemestre.Text = reader["semestre"].ToString(); //
txbMatricula.Text = reader["matricula"].ToString();
}
}/*Fim*/
/*Carregando lista de talentos do id_pessoa.*/
query = "SELECT numero, classe, talento, experiencia, descricao FROM talento_dicente WHERE id_pessoa = " + id_pessoa + " ORDER BY numero";
using (SQLiteCommand command = new SQLiteCommand(query, cnn))
{
using (SQLiteDataAdapter dalist = new SQLiteDataAdapter(command))
{
DataTable dtlist = new DataTable();
dalist.Fill(dtlist);
dgListaTalento.DataSource = dtlist.DefaultView;
}
}/*Fim*/
cnn.Close();
}
}break;
case "docente":
{
}break;
}
}
}
}