public void LoginValidacion() { ViewLogin vl1 = new ViewLogin(); con.Conectarx(); a = Convert.ToString(user); String b = Convert.ToString(psw); String query = "SELECT COUNT(*) From Personas where Usuario = '" + a + "' and Contraseña = '" + b + "'"; SqlCommand comm = new SqlCommand(query, con.conexion); int count = System.Convert.ToInt32(comm.ExecuteScalar()); if (count > 0) { vh1.Show(); } else { MessageBox.Show("Usuario o contraseña incorrectos", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error); vl1.Show(); return; } }
private void ViewRealizarPedidos_Load(object sender, EventArgs e) { ViewLogin vl = new ViewLogin(); vl.Hide(); this.txtBusqueda.MaxLength = 20; this.agregarGrillaBusqueda(); }