public void loadpersona() { Ventanaprincipal Ventana1 = new Ventanaprincipal(); BindingSource dataSource = new BindingSource(); dataSource.DataSource = servicio.GetAll(); Ventana1.dgvdata.DataSource = dataSource; Ventana1.dgvdata.ClearSelection(); }
private void button1_Click(object sender, EventArgs e) { if (Ventanaprincipal.index < 0) { Addpersonas(); this.Hide(); Ventanaprincipal Principal = new Ventanaprincipal(); Principal.ShowDialog(); } else { editar(); } }
private void btnlogin_Click(object sender, EventArgs e) { if (txtcuenta.Text == "admin" && txtcontra.Text == "1234") { MessageBox.Show("Se ha iniciado sesion..."); this.Hide(); Ventanaprincipal Ventana2 = new Ventanaprincipal(); Ventana2.Show(); } else { MessageBox.Show("Error al iniciar sesion... \nEl Usuario o la Contraseña son incorrectos"); } }