private void Ingresar_Click(object sender, EventArgs e) { int o = 0; foreach (Cliente c in Listas.clientes) { if (c.Rut == textBox1.Text && c.Contraseña == textBox2.Text) { o++; this.Hide(); foreach (Banco r in Listas.Cuentas) { if (c.Rut == r.Rut) { CuentaCliente = r; } } Cliente1 cliente = new Cliente1(c, this); cliente.Show(); break; } } foreach (Administrador a in Listas.administradores) { if (a.Rut == textBox1.Text && a.Contraseña == textBox2.Text) { o++; this.Hide(); Administrador1 administrador = new Administrador1(a, this); administrador.Show(); break; } } foreach (Padre p in Listas.padres) { if (p.Rut == textBox1.Text && p.Contraseña == textBox2.Text) { o++; this.Hide(); Padre1 padre = new Padre1(this); padre.Show(); break; } } if (o == 0) { MessageBox.Show("Usuario no encontrado", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } textBox1.Text = ""; textBox2.Text = ""; }
public LocalesU(Cliente c, Cliente1 cl) { this.CurrentC = c; this.ParentWindow = cl; InitializeComponent(); this.CenterToScreen(); this.Text = "Locales"; listView1.Visible = true; listView1.Items.Clear(); ListViewItem item = new ListViewItem(); foreach (Local local in Listas.locales) { item = listView1.Items.Add(local.Nombre1); item.SubItems.Add(local.Direccion); item.SubItems.Add(local.Despacho.ToString()); item.SubItems.Add(local.Credito.ToString()); item.SubItems.Add(local.Debito.ToString()); item.SubItems.Add(local.Efectivo.ToString()); item.SubItems.Add(local.Cheque.ToString()); item.SubItems.Add(local.Ubicacion); } }