Exemple #1
0
 private void btn_logar_Click(object sender, EventArgs e)
 {
     if (txb_login.Text == "" || txb_login == null || txb_senha.Text == "" || txb_senha == null)
     {
         Console.Beep();
         MessageBox.Show("Login ou senha inválidos!");
     }
     else if( txb_login.Text == Convert.ToString(login) && txb_senha.Text == senha) // testando login
     {
         index index = new index(matricula_instrutor);
         index.Show();
         Hide();
     }
     else
     {
         Console.Beep();
         MessageBox.Show("Login ou senha inválidos!");
         txb_login.Text = "";
         txb_senha.Text = "";
     }
 }
Exemple #2
0
        private void btn_salvar_Click(object sender, EventArgs e)
        {
            if( txb_nome.Text != nome || txb_cpf.Text != Convert.ToString(cpf) || txb_telefone.Text != Convert.ToString(telefone) ||
                txb_email.Text != email || txb_cep.Text != Convert.ToString(cep) || txb_bairro.Text != bairro ||
                txb_rua.Text != rua || txb_estado.Text != uf)
            {
                nome = txb_nome.Text;
                cpf = Convert.ToDecimal(txb_cpf.Text);
                bairro = txb_bairro.Text;
                telefone = Convert.ToDecimal(txb_telefone.Text);
                email = txb_email.Text;
                cep = Convert.ToInt32(txb_cep.Text);                //foi pego todos os dados da tela
                rua = txb_rua.Text;
                uf = txb_estado.Text;

                MessageBox.Show("Dados alterados... Salvando no Banco");

                //try
                //{
                //    OracleConnection conn3 = new OracleConnection(oradb);
                //    conn3.Open();

                //    OracleCommand oda3 = conn3.CreateCommand();
                //    oda3.CommandType = CommandType.Text;
                //    oda3.CommandText = "UPDATE pessoa SET cep  = :cep, nome = :nome, cpf = :cpf, email = :email, numtelefone = :telefone WHERE matricula = :matricula_aluno";
                //    oda3.Parameters.Add("cep", cep);
                //    oda3.Parameters.Add("nome", nome);
                //    oda3.Parameters.Add("cpf", cpf);
                //    oda3.Parameters.Add("email", email);
                //    oda3.Parameters.Add("telefone", telefone);
                //    oda3.Parameters.Add("matricula_aluno", matricula_aluno);
                //    oda3.ExecuteNonQuery();

                //    OracleCommand oda4 = new OracleCommand("UPDATE endereco SET cep = " + cep + ", rua = '" + rua + "', bairro = '" + bairro + "', uf = '" + uf + "' cep=" + cep, conn3);
                //    oda4.ExecuteNonQuery();

                //    conn3.Close();
                //}
                //catch (Exception ex) // detecta todos os erros
                //{
                //    MessageBox.Show(ex.Message.ToString());
                //}

                MessageBox.Show("Dados alterados no Banco");

                index index = new index(matricula_instrutor);
                index.Show();
                Hide();
            }
        }
Exemple #3
0
        private void btn_salvar_Click(object sender, EventArgs e)
        {
            string nome, email, bairro, rua, uf;
            decimal cpf, telefone;
            int cep;
            DateTime dataNasci, dataCadas;

            if (txb_nome.Text == "" || txb_cpf.Text == "" || dataNascimento == dateCadastro ||
                ckb_masculino.CanSelect == false && ckb_feminino.CanSelect == false || txb_telefone.Text == "" ||
                txb_email.Text == "" || txb_cep.Text == "" || txb_bairro.Text == "" || txb_rua.Text == "" || txb_estado.Text == "")
            {
                MessageBox.Show("Preencha todos os campos!");
            }
            else
            {
                nome = txb_nome.Text;
                cpf = Convert.ToDecimal(txb_cpf.Text);
                bairro = txb_bairro.Text;
                dataNasci = dataNascimento.Value;
                dataCadas = dateCadastro.Value;
                telefone = Convert.ToDecimal(txb_telefone.Text);
                email = txb_email.Text;
                cep = Convert.ToInt32(txb_cep.Text);                //foi pego todos os dados da tela
                rua = txb_rua.Text;
                uf = txb_estado.Text;

                try
                {
                    OracleConnection conn = new OracleConnection(oradb);
                    conn.Open();

                    OracleCommand oda = new OracleCommand("", conn);

                    conn.Close();
                }
                catch (Exception ex) // detecta todos os erros
                {
                    MessageBox.Show(ex.Message.ToString());
                }

                index index = new index(matricula_instrutor); // apos salva no banco, volta pra tela index
                index.Show();
                Hide();
            }
        }
Exemple #4
0
 private void btn_voltar_Click(object sender, EventArgs e)
 {
     index index = new index(matricula_instrutor);
     index.Show();
     Hide();
 }
Exemple #5
0
 private void btn_voltar_Click(object sender, EventArgs e)
 {
     index index = new index(matricula_instrutor); // ir sempre guardando a matricula do instrutor logado.
     index.Show();
     Hide();
 }