private void button1_Click(object sender, EventArgs e) { //Read user int id = int.Parse(txtUser.Text); User user = DAOUser.readUser(id); PnlReadUser1 pnl = new PnlReadUser1(); pnl.user = user; pnl.updateData(); pnl.Show(); this.Hide(); }
private void button1_Click(object sender, EventArgs e) { string user = txtUser.Text.Trim(); int id = int.Parse(user); string pwd = txtPwd.Text.Trim(); string hash = ComputeSha1Hash(pwd); string registro = DAOUser.getPwd(id); if (hash == registro) { //Mostarr el pnl User u = DAOUser.readUser(id); PnlUser pnl = new PnlUser(); pnl.user = u; pnl.Show(); this.Hide(); } else { MessageBox.Show("Usuario o contraseña incorrecta.", "Error Login", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }