void p_logueo() { DataTable dt = new DataTable(); objeuser.usuario = txtusuario.Text; objeuser.clave = txtpass.Text; dt = objnuser.N_user(objeuser); if (dt.Rows.Count > 0) { MessageBox.Show("Bienvenido " + dt.Rows[0][1].ToString(), "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); usuario_nombre = dt.Rows[0][0].ToString(); apellidos = dt.Rows[0][1].ToString(); roll = dt.Rows[0][2].ToString(); frm1.ShowDialog(); Login1 login = new Login1(); login.ShowDialog(); if (login.DialogResult == DialogResult.OK) { Application.Run(new Principal()); } txtusuario.Clear(); txtpass.Clear(); } else { MessageBox.Show("Usuario o Contraseña Incorrecta", "Mensaje", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void beforeButton_Click(object sender, EventArgs e) { Form f1 = new Principal(); this.Hide(); f1.ShowDialog(); this.Close(); }