Exemplo n.º 1
0
    public static void CerrarSesion()
    {
        JugadorDAO jugadorDAO = new JugadorDAO();
        Jugador    jugador    = jugadorDAO.BuscarJugadorActivo();

        if (jugador != null)
        {
            jugador.Sesion = false;
            jugadorDAO.Actualizar(jugador);
            MotorMicrojuego.MenuPrincipal();
        }
    }
Exemplo n.º 2
0
    public void Autenticar()
    {
        JugadorDAO     jugadorDAO = new JugadorDAO();
        List <Jugador> jugadores  = jugadorDAO.Lista();

        foreach (Jugador jugador in jugadores)
        {
            if (jugador.NombreUsuario == NombreUsuario.text &&
                jugador.Contrasena == Contrasena.text)
            {
                jugador.Sesion = true;
                jugadorDAO.Actualizar(jugador);
                MotorMicrojuego.MenuPrincipal();
            }
        }
    }