private void btnIngresar_Click(object sender, EventArgs e) { if (lblUsuario.Text != null || txtPwd.Text == null) { Bussiness.Logic.UsuarioLogic userLogic = new Bussiness.Logic.UsuarioLogic(); int id = userLogic.Login(txtUsuario.Text, txtPwd.Text); if (id != 0) { Usuario user = userLogic.GetOne(id); int tipoUsuario = user.MiTipo(); //En lugar de hacer 3 if, podria definir los botonoes segun el tipo de usuario, pero por ahora lo dejo asi. if (tipoUsuario == 0) { UIAdmin frmAdmin = new UIAdmin(user); frmAdmin.Show(); } else if (tipoUsuario == 1) { UIDocente frmDocente = new UIDocente(user); frmDocente.Show(); } else { UIAlumno frmAlumno = new UIAlumno(user); frmAlumno.Show(); } this.Close(); } else { lblError.Visible = true; }; } else { lblUsuario.Text = "Usuario o contraseña vacios"; } }
public Usuarios() { UsuarioNegocio = new Bussiness.Logic.UsuarioLogic(); }