Exemplo n.º 1
0
        //genera el 11 titular aleatorio de un equipo
        public List <JugadorVO> generar11Titular(int codEquipo)
        {
            var jugadorDAO = new JugadorDAO();
            var plantilla  = fachadaDatos.verListaJugadoresEquipo(codEquipo);

            return(generador.generaXAleatoriosLista(plantilla, 11));
        }
Exemplo n.º 2
0
        public object execute(DbConnection connection)
        {
            var jugadorDAO     = new JugadorDAO();
            var listaJugadores = jugadorDAO.verPlantillaEquipo(connection, null, cod_Equipo, 0, 2);

            return(listaJugadores);
        }
Exemplo n.º 3
0
    // Start is called before the first frame update
    void Start()
    {
        PsicologoDAO     psicologoDAO = new PsicologoDAO();
        List <Psicologo> psicologos   = psicologoDAO.Lista();

        if (psicologos.Count > 0)
        {
            TutorDAO     tutorDAO = new TutorDAO();
            List <Tutor> tutores  = tutorDAO.Lista();

            if (tutores.Count > 0)
            {
                JugadorDAO jugadorDAO = new JugadorDAO();
                Jugador    jugador    = jugadorDAO.BuscarJugadorActivo();
                if (jugador == null)
                {
                    MotorMicrojuego.AbrirLogin();
                }
            }
            else
            {
                MotorMicrojuego.AbrirRegistroTutor();
            }
        }
        else
        {
            MotorMicrojuego.AbrirRegistroPsicologo();
        }
    }
Exemplo n.º 4
0
        public bool Login(string nombre, string contrasenia)
        {
            Console.WriteLine("Estoy en Login xd");
            bool       seLogeo         = false;
            bool       usuarioLogueado = false;
            JugadorDAO usuarioALoguear = new JugadorDAO();

            try
            {
                string contraseniaEncriptada = string.Empty;
                byte[] encryted = System.Text.Encoding.Unicode.GetBytes(contrasenia);
                contraseniaEncriptada = Convert.ToBase64String(encryted);

                usuarioLogueado = usuarioALoguear.ValidarUsuario(nombre, contraseniaEncriptada);

                if (usuarioLogueado)
                {
                    Console.WriteLine("Usuario Logeado");
                    seLogeo = true;
                }
                else
                {
                    Console.WriteLine("No paso Logeado");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
            return(seLogeo);
        }
Exemplo n.º 5
0
        public object execute(DbConnection connection)
        {
            var jugadorDAO       = new JugadorDAO();
            var datosTotales     = jugadorDAO.verJugador(connection, null, cod_Jugador);
            var hcoIntegranteDAO = new HcoIntegranteDAO();
            var historial        = hcoIntegranteDAO.verHistorialEquipos(connection, null, cod_Jugador);
            var partidoJugadoDAO = new PartidoJugadoDAO();
            var temporadas       = partidoJugadoDAO.temporadasConPartidosJugados(connection, null, cod_Jugador);

            return(new PerfilCompletoJugador(datosTotales, historial, temporadas));
        }
Exemplo n.º 6
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.º 7
0
    // Start is called before the first frame update
    void Start()
    {
        JugadorDAO   = new JugadorDAO();
        PsicologoDAO = new PsicologoDAO();
        TutorDAO     = new TutorDAO();


        if (!MotorMicrojuego.DesdeIniciarSesion)
        {
            Destroy(buttonInicioSesion.gameObject);
        }
    }
Exemplo n.º 8
0
        public object execute(DbConnection connection)
        {
            var equipoDAO      = new EquipoDAO();
            var jugadorDAO     = new JugadorDAO();
            var entrenadorDAO  = new EntrenadorDAO();
            var directivoDAO   = new DirectivoDAO();
            var estadioDAO     = new EstadioDAO();
            var equipo         = equipoDAO.buscarEquipoId(connection, null, cod_Equipo);
            var estadio        = estadioDAO.buscarEstadioId(connection, null, equipo.Cd_Estadio);
            var listaJugadores = jugadorDAO.listarJugadoresEquipo(connection, null,
                                                                  cod_Equipo, 0, 2);
            var listaEntrenadores = entrenadorDAO.verEntrenadoresEquipo(connection, null, cod_Equipo, 0, 2);
            var listaDirectivos   = directivoDAO.verDirectivosEquipo(connection, null, cod_Equipo, 0, 2);

            return(new EquipoTotalCO <JugadorVO>(equipo, listaJugadores, null, listaEntrenadores, null, listaDirectivos, estadio));
        }
Exemplo n.º 9
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();
            }
        }
    }
Exemplo n.º 10
0
        /// <summary>
        /// Método que inicializa los datos que se utilizarán en estas pruebas
        /// </summary>
        public void InicializarDatos()
        {
            jugador    = new Jugador();
            jugadorDAO = new JugadorDAO();

            string contrasenia           = "12344";
            string contraseniaEncriptada = string.Empty;

            byte[] encryted = System.Text.Encoding.Unicode.GetBytes(contrasenia);
            contraseniaEncriptada = Convert.ToBase64String(encryted);


            jugador.nickName          = "AldoDiaz";
            jugador.nombre            = "AldoColorado";
            jugador.correoElectronico = "*****@*****.**";
            jugador.contrasenia       = contraseniaEncriptada;
        }
Exemplo n.º 11
0
        public void CrearJugador(Jugador jugador)
        {
            bool       creado     = false;
            JugadorDAO jugadorDAO = new JugadorDAO();

            creado = jugadorDAO.Crear(jugador);

            if (creado)
            {
                var conexion = OperationContext.Current.GetCallbackChannel <IClient>();
                conexion.VerificarCreacionJugador(true);
                Console.WriteLine("Jugador creado");
            }
            else
            {
                Console.WriteLine("No se creo");
            }
        }
Exemplo n.º 12
0
        public object execute(DbConnection connection)
        {
            IntegranteDAO    integranteDAO    = new IntegranteDAO();
            JugadorDAO       jugadorDAO       = new JugadorDAO();
            EntrenadorDAO    entrenadorDAO    = new EntrenadorDAO();
            DirectivoDAO     directivoDAO     = new DirectivoDAO();
            HcoIntegranteDAO hcoIntegranteDAO = new HcoIntegranteDAO();
            JugadorVO        jugadorVO;
            EntrenadorVO     entrenadorVO;
            DirectivoVO      directivoVO;

            IntegranteVO integranteVO = integranteDAO.verIntegrante(connection, null, cod_Integrante);

            var listaHcoIntegrante = hcoIntegranteDAO.obtenerListaHcoIntegranteVO(connection, null, cod_Integrante);

            HcoIntegranteVO hcoIntegranteVO = (HcoIntegranteVO)listaHcoIntegrante[listaHcoIntegrante.Count - 1];

            jugadorVO = jugadorDAO.obtenerJugadorVO(connection, null, hcoIntegranteVO.Cod_Integrante,
                                                    hcoIntegranteVO.Cod_Equipo, hcoIntegranteVO.Version_Integrante);

            if (jugadorVO != null)
            {
                return(new JugadorCO(jugadorVO, listaHcoIntegrante, integranteVO));
            }


            entrenadorVO = entrenadorDAO.obtenerEntrenadorVO(connection, null, cod_Integrante,
                                                             hcoIntegranteVO.Cod_Equipo, hcoIntegranteVO.Version_Integrante);
            if (entrenadorVO != null)
            {
                return(new EntrenadorCO(entrenadorVO, listaHcoIntegrante, integranteVO));
            }

            directivoVO = directivoDAO.obtenerDirectivoVO(connection, null, cod_Integrante,
                                                          hcoIntegranteVO.Cod_Equipo, hcoIntegranteVO.Version_Integrante);
            if (directivoVO != null)
            {
                return(new DirectivoCO(directivoVO, listaHcoIntegrante, integranteVO));
            }

            return(null);
        }
Exemplo n.º 13
0
        public object execute(DbConnection connection, DbTransaction transaction)
        {
            IntegranteDAO    integranteDAO    = new IntegranteDAO();
            HcoIntegranteDAO hcoIntegranteDAO = new HcoIntegranteDAO();
            JugadorDAO       jugadorDAO       = new JugadorDAO();
            EntrenadorDAO    entrenadorDAO    = new EntrenadorDAO();
            DirectivoDAO     directivoDAO     = new DirectivoDAO();

            if (info.Integrante != null)
            {
                integranteDAO.updateIntegrante(connection, transaction, info.Integrante);
            }
            var hcoIntegranteActual = info.ListaHcoIntegrantes[info.ListaHcoIntegrantes.Count - 1];

            hcoIntegranteDAO.updateHcoIntegrante(connection, transaction, hcoIntegranteActual);

            if (info.GetType().Name.Equals("JugadorCO"))
            {
                if ((info as JugadorCO).Jugador != null)
                {
                    jugadorDAO.updateJugador(connection, transaction, (info as JugadorCO).Jugador);
                }
            }
            else
            if (info.GetType().Name.Equals("EntrenadorCO"))
            {
                if ((info as EntrenadorCO).Entrenador != null)
                {
                    entrenadorDAO.updateEntrenador(connection, transaction, (info as EntrenadorCO).Entrenador);
                }
            }
            else
            {
                if ((info as DirectivoCO).Directivo != null)
                {
                    directivoDAO.updateDirectivo(connection, transaction, (info as DirectivoCO).Directivo);
                }
            }

            return(info);
        }
Exemplo n.º 14
0
        public bool Login(string nombre, string contrasenia)
        {
            bool       usuarioLogueado = false;
            JugadorDAO usuarioALoguear = new JugadorDAO();

            string contraseniaEncriptada = string.Empty;

            byte[] encryted = System.Text.Encoding.Unicode.GetBytes(contrasenia);
            contraseniaEncriptada = Convert.ToBase64String(encryted);

            usuarioLogueado = usuarioALoguear.ValidarUsuario(nombre, contraseniaEncriptada);

            if (usuarioLogueado)
            {
                Console.WriteLine("Usuario Logeado");
            }
            else
            {
                Console.WriteLine("No paso Logeado");
            }
            return(usuarioLogueado);
        }
Exemplo n.º 15
0
        public object execute(DbConnection connection, DbTransaction transaction)
        {
            IntegranteDAO    integranteDAO    = new IntegranteDAO();
            JugadorDAO       jugadorDAO       = new JugadorDAO();
            HcoIntegranteDAO hcoIntegranteDAO = new HcoIntegranteDAO();
            IntegranteVO     integranteVO     = jugadorCO.Integrante;
            int cod_Integrante = jugadorCO.Jugador.Cod_Integrante;

            if (integranteDAO.Exists(connection, transaction, cod_Integrante))
            {
            }
            else
            {
                integranteVO   = integranteDAO.create(connection, transaction, jugadorCO.Integrante);
                cod_Integrante = integranteVO.Cod_Integrante;
            }


            HcoIntegranteVO hcoIntegranteCreado = null;

            foreach (HcoIntegranteVO hcoIntegrante in jugadorCO.ListaHcoIntegrantes)
            {
                hcoIntegrante.Cod_Integrante = cod_Integrante;
                hcoIntegranteCreado          = hcoIntegranteDAO.create(connection, transaction,
                                                                       hcoIntegrante);
            }
            jugadorCO.Jugador.Cod_Integrante     = cod_Integrante;
            jugadorCO.Jugador.Cod_Equipo         = hcoIntegranteCreado.Cod_Equipo;
            jugadorCO.Jugador.Version_Integrante = hcoIntegranteCreado.Version_Integrante;



            JugadorVO jugadorVO = jugadorDAO.create(connection, transaction,
                                                    jugadorCO.Jugador);

            return(new JugadorCO(jugadorVO, jugadorCO.ListaHcoIntegrantes, integranteVO));
        }
Exemplo n.º 16
0
        public void Login(String nickName, string contrasenia)
        {
            bool       usuarioLogueado = false;
            JugadorDAO usuarioALoguear = new JugadorDAO();

            //string contraseniaEncriptada = string.Empty;
            //byte[] encryted = System.Text.Encoding.Unicode.GetBytes(contrasenia);
            //contraseniaEncriptada = Convert.ToBase64String(encryted);

            usuarioLogueado = usuarioALoguear.ValidarUsuario(nickName, contrasenia);

            if (usuarioLogueado)
            {
                Console.WriteLine("Usuario Logeado");
                Console.WriteLine("Conectando");
                var conexion = OperationContext.Current.GetCallbackChannel <IClient>();
                conexion.VerificarUsuarioLogeado(true);
                Console.WriteLine("Paso de conectando lol");
            }
            else
            {
                Console.WriteLine("No paso Logeado");
            }
        }
Exemplo n.º 17
0
        public object execute(DbConnection connection, DbTransaction transaction)
        {
            var equipoVO          = equipoTotal.Equipo;
            var estadioVO         = equipoTotal.Estadio;
            var listaJugadores    = equipoTotal.ListaJugadores;
            var listaEntrenadores = equipoTotal.ListaEntrenadoresCreate;
            var listaDirectivos   = equipoTotal.ListaDirectivosCreate;



            //Creamos el EquipoVO
            if (equipoVO != null)
            {
                EquipoDAO equipoDAO = new EquipoDAO();
                equipoVO = equipoDAO.create(connection, transaction, equipoVO);
            }


            //Creamos el EstadioVO
            if (estadioVO != null)
            {
                EstadioDAO estadioDAO = new EstadioDAO();
                estadioVO = estadioDAO.create(connection, transaction, estadioVO);
            }


            //Creamos todos los jugadoresCOs
            if (listaJugadores != null)
            {
                HcoIntegranteDAO hcoIntegranteDAO = new HcoIntegranteDAO();
                IntegranteDAO    integranteDAO    = new IntegranteDAO();
                JugadorDAO       jugadorDAO       = new JugadorDAO();

                foreach (JugadorCO jugadorCO in listaJugadores)
                {
                    IntegranteVO integranteVO   = jugadorCO.Integrante;
                    int          cod_Integrante = jugadorCO.cod_Integrante();


                    if (integranteDAO.Exists(connection, transaction, cod_Integrante))
                    {
                    }
                    else
                    {
                        integranteVO   = integranteDAO.create(connection, transaction, jugadorCO.Integrante);
                        cod_Integrante = integranteVO.Cod_Integrante;
                    }

                    HcoIntegranteVO hcoIntegranteCreado = null;
                    foreach (HcoIntegranteVO hcoIntegrante in jugadorCO.ListaHcoIntegrantes)
                    {
                        hcoIntegrante.Cod_Integrante = cod_Integrante;
                        hcoIntegranteCreado          = hcoIntegranteDAO.create(connection, transaction,
                                                                               hcoIntegrante);
                    }



                    //linea anadida
                    if (jugadorCO.GetType().Name.Equals("JugadorCO"))
                    {
                        (jugadorCO as JugadorCO).Jugador.Cod_Integrante     = cod_Integrante;
                        (jugadorCO as JugadorCO).Jugador.Version_Integrante = hcoIntegranteCreado.Version_Integrante;
                        JugadorVO jugadorVO = jugadorDAO.create(connection, transaction,
                                                                (jugadorCO as JugadorCO).Jugador);
                    }
                }
            }


            //creamos todos los EntrenadorCOs
            if (listaEntrenadores != null)
            {
                foreach (EntrenadorCO entrenadorCO in listaEntrenadores)
                {
                    IntegranteDAO    integranteDAO    = new IntegranteDAO();
                    EntrenadorDAO    entrenadorDAO    = new EntrenadorDAO();
                    HcoIntegranteDAO hcoIntegranteDAO = new HcoIntegranteDAO();
                    IntegranteVO     integranteVO     = entrenadorCO.Integrante;
                    int cod_Integrante = entrenadorCO.Entrenador.Cod_Integrante;

                    if (integranteDAO.Exists(connection, transaction, cod_Integrante))
                    {
                    }
                    else
                    {
                        integranteVO   = integranteDAO.create(connection, transaction, entrenadorCO.Integrante);
                        cod_Integrante = integranteVO.Cod_Integrante;
                    }

                    HcoIntegranteVO hcoIntegranteCreado = null;
                    foreach (HcoIntegranteVO hcoIntegrante in entrenadorCO.ListaHcoIntegrantes)
                    {
                        hcoIntegrante.Cod_Integrante = cod_Integrante;
                        hcoIntegranteCreado          = hcoIntegranteDAO.create(connection, transaction,
                                                                               hcoIntegrante);
                    }

                    entrenadorCO.Entrenador.Cod_Integrante = cod_Integrante;

                    //linea anadida
                    if (entrenadorCO.GetType().Name.Equals("EntrenadorCO"))
                    {
                        (entrenadorCO as EntrenadorCO).Entrenador.Cod_Integrante     = cod_Integrante;
                        (entrenadorCO as EntrenadorCO).Entrenador.Version_Integrante = hcoIntegranteCreado.Version_Integrante;
                        EntrenadorVO entrenadorVO = entrenadorDAO.create(connection, transaction,
                                                                         (entrenadorCO as EntrenadorCO).Entrenador);
                    }
                }
            }


            //Creamos todos los DirectivoCOs
            if (listaDirectivos != null)
            {
                foreach (DirectivoCO directivoCO in listaDirectivos)
                {
                    IntegranteDAO    integranteDAO    = new IntegranteDAO();
                    DirectivoDAO     directivoDAO     = new DirectivoDAO();
                    HcoIntegranteDAO hcoIntegranteDAO = new HcoIntegranteDAO();
                    IntegranteVO     integranteVO     = directivoCO.Integrante;
                    int cod_Integrante = directivoCO.Directivo.Cod_Integrante;

                    if (integranteDAO.Exists(connection, transaction, cod_Integrante))
                    {
                    }
                    else
                    {
                        integranteVO   = integranteDAO.create(connection, transaction, directivoCO.Integrante);
                        cod_Integrante = integranteVO.Cod_Integrante;
                    }

                    HcoIntegranteVO hcoIntegranteCreado = null;
                    foreach (HcoIntegranteVO hcoIntegrante in directivoCO.ListaHcoIntegrantes)
                    {
                        hcoIntegrante.Cod_Integrante = cod_Integrante;
                        hcoIntegranteCreado          = hcoIntegranteDAO.create(connection, transaction,
                                                                               hcoIntegrante);
                    }

                    directivoCO.Directivo.Cod_Integrante = cod_Integrante;

                    //linea anadida
                    if (directivoCO.GetType().Name.Equals("DirectivoCO"))
                    {
                        (directivoCO as DirectivoCO).Directivo.Cod_Integrante     = cod_Integrante;
                        (directivoCO as DirectivoCO).Directivo.Version_Integrante = hcoIntegranteCreado.Version_Integrante;
                        DirectivoVO directivoVO = directivoDAO.create(connection, transaction,
                                                                      (directivoCO as DirectivoCO).Directivo);
                    }
                }
            }
            return(new EquipoTotalCO <JugadorCO>(equipoVO, listaJugadores, listaEntrenadores, null, listaDirectivos, null,
                                                 estadioVO));
        }
    // Start is called before the first frame update
    void Start()
    {
        TutorDAO     tutorDAO     = new TutorDAO();
        PsicologoDAO psicologoDAO = new PsicologoDAO();
        JugadorDAO   jugadorDAO   = new JugadorDAO();

        if (psicologoDAO.Lista().Count < 1)
        {
            Psicologo psicologo = new Psicologo()
            {
                Nombre     = "Psicologo",
                Correo     = "*****@*****.**",
                Telefono   = "0123456789",
                Cedula     = "cedula",
                Contrasena = "contrasena"
            };

            psicologoDAO.Crear(psicologo);
        }

        if (tutorDAO.Lista().Count < 1)
        {
            Tutor tutor = new Tutor()
            {
                Nombre   = "Tutor",
                Correo   = "*****@*****.**",
                Telefono = "0123456789"
            };
            tutorDAO.Crear(tutor);
        }

        if (jugadorDAO.Lista().Count < 1)
        {
            Jugador jugador = new Jugador()
            {
                Nombre        = "Jugador",
                NombreUsuario = "Jugador1",
                Contrasena    = "contrasena",
                Edad          = 12,
                Sexo          = "M",
                IdTutor       = 1,
                IdPsicologo   = 1,
                Sesion        = true
            };
            jugadorDAO.Crear(jugador);
        }

        //ConfiguracionDAO dao = new ConfiguracionDAO();
        //Configuracion configuracion = new Configuracion
        //{
        //    Sfx = 1,
        //    Volumen = 2,
        //    IdJugador = 5,
        //};
        //dao.Crear(configuracion);

        //configuracion = dao.Buscar(configuracion.IdConfiguracion);
        //Debug.Log(configuracion);

        //configuracion.Sfx = 300;
        //dao.Actualizar(configuracion);

        //configuracion = dao.Buscar(configuracion.IdConfiguracion);
        //Debug.Log(configuracion);


        //List<Configuracion> configuraciones;

        //Debug.Log("Antes: ");
        //configuraciones = dao.Lista();
        //foreach (Configuracion configures2 in configuraciones)
        //{
        //    Debug.Log(configures2.ToString());
        //    dao.Eliminar(configures2);
        //}

        //Debug.Log("Despues: ");
        //configuraciones = dao.Lista();
        //foreach (Configuracion configures2 in configuraciones)
        //{
        //    Debug.Log(configures2.ToString());
        //}
    }
Exemplo n.º 19
0
 void Start()
 {
     PartidaDAO = new PartidaDAO();
     jugadorDAO = new JugadorDAO();
 }
Exemplo n.º 20
0
 public JugadorNE()
 {
     jugadorDao = new JugadorDAO();
 }
Exemplo n.º 21
0
 public JugadorBO()
 {
     JuDAO = new JugadorDAO();
 }