private void btnVoltar_Click(object sender, EventArgs e) { Perfil p = new Perfil(idLogin); p.Show(); this.Close(); }
private void btnEntrar_Click(object sender, EventArgs e) { string Login = txtLoginL.Text; string Senha = txtSenhaL.Text; Conexao conexao = new Conexao(); conexao.conectar(); string query = "SELECT Login, Senha From Cadastro WHERE Login = '******' AND Senha = '" + Senha + "' ;"; MySqlCommand cmd = new MySqlCommand(query, conexao.cn); MySqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { Login = dr["Login"].ToString(); Senha = dr["Senha"].ToString(); Metodos met = new Metodos(); met.buscarId(Login); idLogin = met.idLogin; Perfil P = new Perfil(idLogin); this.Hide(); P.Show(); } else { MessageBox.Show("Usuário ou Senha não encontrados!", "Erro!"); } conexao.desconectar(); }
private void button1_Click(object sender, EventArgs e) { Perfil p = new Perfil(idLogin); p.Show(); this.Hide(); }
private void btnSelecionar_Click(object sender, EventArgs e) { Metodos met = new Metodos(); met.buscarId(Login); idLogin = met.idLogin; if (rdImagem1.Checked == true) { idFoto = 1; met.EnviarIdFoto(Login, idFoto); Perfil p = new Perfil(idLogin); p.Show(); this.Close(); } if (rdImagem2.Checked == true) { idFoto = 2; met.EnviarIdFoto(Login, idFoto); Perfil p = new Perfil(idLogin); p.Show(); this.Close(); } if (rdImagem3.Checked == true) { idFoto = 3; met.EnviarIdFoto(Login, idFoto); Perfil p = new Perfil(idLogin); p.Show(); this.Close(); } if (rdImagem4.Checked == true) { idFoto = 4; met.EnviarIdFoto(Login, idFoto); Perfil p = new Perfil(idLogin); p.Show(); this.Close(); } if (rdImagem5.Checked == true) { idFoto = 5; met.EnviarIdFoto(Login, idFoto); Perfil p = new Perfil(idLogin); p.Show(); this.Close(); } if (rdImagem6.Checked == true) { idFoto = 6; met.EnviarIdFoto(Login, idFoto); Perfil p = new Perfil(idLogin); p.Show(); this.Close(); } }
private void btnCadastrar_Click(object sender, EventArgs e) { if (txtSenha.Text == txtCSenha.Text) { Cadastro cad = new Cadastro(); dal da = new dal(); string dia = DataNasc.Value.Day.ToString(); string mes = DataNasc.Value.Month.ToString(); string ano = DataNasc.Value.Year.ToString(); string data = (ano + "/" + mes + "/" + dia); cad.Data = data; cad.Nome = txtNome.Text; cad.Email = txtEmail.Text; cad.Login = txtLogin.Text; cad.Senha = txtSenha.Text; if (rbtMasculino.Checked == true) { cad.Sexo = "M"; } if (rbtFeminino.Checked == true) { cad.Sexo = "F"; } da.cadastro(cad); txtNome.Text = ""; txtLogin.Text = ""; txtEmail.Text = ""; txtSenha.Text = ""; txtCSenha.Text = ""; txtNome.Focus(); MessageBox.Show("Você está registrado!"); Perfil p = new Perfil(); this.Close(); p.Show(); } else { MessageBox.Show("Confirme se sua senha e email estão iguais!"); } }