public List <ApuestaDTO2> GetGmailTipoMercado(string g, double t)
        {
            var repo = new ApuestasRepository();
            List <ApuestaDTO2> lista = repo.RetrieveByEmailMercado(g, t);

            return(lista);
        }
예제 #2
0
        public List <Apuesta> GetBYCU(double cuota_1, double cuota_2)
        {
            var            repo     = new ApuestasRepository();
            List <Apuesta> apuestas = repo.RetrieveBYCU(cuota_1, cuota_2);

            return(apuestas);
        }
예제 #3
0
        // GET: api/Apuestas/5
        public List <ApuestaDTOEVME> Get(string email)
        {
            var repo = new ApuestasRepository();
            List <ApuestaDTOEVME> apuestas = repo.RetrieveDTOEVME(email);

            return(apuestas);
        }
예제 #4
0
        public Apuesta Get(int ApuestaId)
        {
            var     repo = new ApuestasRepository();
            Apuesta a    = repo.RetrieveById(ApuestaId);

            return(a);
        }
예제 #5
0
        // GET: api/Apuestas?Id_Mercado=id & Email_Usuario=user
        //[Authorize(Roles = "Admin")]
        public IEnumerable <Apuesta> GetEmail(string user, int id)
        {
            var            repo     = new ApuestasRepository();
            List <Apuesta> apuestas = repo.RetrieveById_mercadoandEmail_Usuario(user, id);

            return(apuestas);
        }
예제 #6
0
        // GET: api/Apuestas?Email_Usuario=usuario &? Id_Mercado=id
        public IEnumerable <ApuestaEmailDTO> Get(string usuario, int id)
        {
            var repo = new ApuestasRepository();
            List <ApuestaEmailDTO> apuestas = repo.RetrieveByUsuarioandId_mercado(usuario, id);

            return(apuestas);
        }
        public List <ApuestaDTO3> GetGmailIdMercado(string g, int i)
        {
            var repo = new ApuestasRepository();
            List <ApuestaDTO3> lista = repo.RetrieveByEmailIdMercado(g, i);

            return(lista);
        }
예제 #8
0
        public Apuesta Get(int id_apuesta)
        {
            var     repo    = new ApuestasRepository();
            Apuesta apuesta = repo.RetrieveById(id_apuesta);

            return(apuesta);
        }
예제 #9
0
        // ejercicio 2 del examen
        public IEnumerable <Apuestas> GetCuota(double cuota)
        {
            var             repo = new ApuestasRepository();
            List <Apuestas> apus = repo.RetrieveByCuota(cuota);

            return(apus);
        }
예제 #10
0
        // ejercicio 1 examen
        public IEnumerable <Apuestas> GetTodasApuestas(int idUsuario)
        {
            var             repo   = new ApuestasRepository();
            List <Apuestas> apuest = repo.RetrieveByidUsuario(idUsuario);

            return(apuest);
        }
예제 #11
0
        // GET: api/Apuestas/5
        public Apuestas Get(int id)
        {
            var      repo = new ApuestasRepository();
            Apuestas a    = repo.Retrieve();

            return(a);
        }
예제 #12
0
        public List <ApuestaDTOID> Get(double cuota)
        {
            var repo = new ApuestasRepository();
            List <ApuestaDTOID> apuestas = repo.RetrieveBYC(cuota);

            return(apuestas);
        }
예제 #13
0
        public List <Apuesta> Get(string equipo)
        {
            var            repo     = new ApuestasRepository();
            List <Apuesta> apuestas = repo.RetrieveBYE(equipo);

            return(apuestas);
        }
예제 #14
0
        public List <ApuestaDTO> GetDTO()
        {
            var repo = new ApuestasRepository();
            List <ApuestaDTO> apuestas = repo.RetrieveDTO();

            return(apuestas);
        }
예제 #15
0
        // GET: api/Apuestas?emailUsu=valor1&mercadoApu=valor2
        public IEnumerable <ApuestasMercadoEmail> GetMercadoEmail(int mercadoApu, string emailUsu)
        {
            var repo = new ApuestasRepository();
            List <ApuestasMercadoEmail> apus = repo.RetrieveByEmailAndMercado(mercadoApu, emailUsu);

            return(apus);
        }
예제 #16
0
        // GET: api/Apuestas
        public List <Apuesta> Get()
        {
            var            repo     = new ApuestasRepository();
            List <Apuesta> apuestas = repo.Retrieve();

            return(apuestas);
        }
예제 #17
0
        // GET: api/Apuestas?apuestaid=apuestaid

        /*** Ejercicio 3 Cambio controller ***/
        public ApuestaDTO Get(int apuestaid)
        {
            var        repo    = new ApuestasRepository();
            ApuestaDTO apuesta = repo.RetrieveToDTO(apuestaid);

            return(apuesta);
        }
예제 #18
0
        // GET: api/Apuestas

        public IEnumerable <ApuestaDTO> Get()
        {
            var repo = new ApuestasRepository();
            List <ApuestaDTO> apuestas = repo.Retrieve();

            return(apuestas);
        }
예제 #19
0
        public IEnumerable <ApuestaDTO2> GetDTO()
        {
            ApuestasRepository rep   = new ApuestasRepository();
            List <ApuestaDTO2> lista = rep.RetrieveDTO();

            return(lista);
        }
예제 #20
0
        public IEnumerable <Apuestas> GetMercado(int id)
        {
            var             repo   = new ApuestasRepository();
            List <Apuestas> apuest = repo.RetrieveByMercado(id);

            return(apuest);
        }
예제 #21
0
        // GET: api/Apuestas/5
        public Apuesta Get(int id)
        {
            var     repo    = new ApuestasRepository();
            Apuesta apuesta = repo.retireveId(id);

            return(apuesta);
        }
예제 #22
0
        public IEnumerable <Apuestas> GetEmail(string Email)
        {
            var             repo   = new ApuestasRepository();
            List <Apuestas> apuest = repo.RetrieveByEmail(Email);

            return(apuest);
        }
예제 #23
0
        /*
         * [Authorize(Roles = "Admin")] */// solo los usuarios con rol admin pueden tener acceso a la funcion que devuelve todas las apuestas de un mercado
        // GET: api/Apuestas
        public IEnumerable <ApuestasDTO> GetDTO(int id)
        {
            var repos = new ApuestasRepository();
            List <ApuestasDTO> apuest = repos.RetrieveDTO(id);

            return(apuest);
        }
예제 #24
0
        //AE4-6
        // GET: api/Apuestas
        public IEnumerable <Apuestas5datos> Get()
        {
            var repo = new ApuestasRepository();
            List <Apuestas5datos> apuestas = repo.GetApuestas();

            return(apuestas);
        }
예제 #25
0
        // POST: api/Apuestas
        public void Post([FromBody] Apuesta apuesta)
        {
            var reposMercado = new MercadosRepository();
            var repo         = new ApuestasRepository();

            //Vamos a ejecutar la fórmula para dar el valor de la cuota
            //consultar el valor actual de la cuota
            //Mercado mercado = new Mercado();
            var   mercado    = reposMercado.GetCuota(apuesta.FK_MercadoId);
            float probalidad = 0;

            if (apuesta.Tipo.ToString() == "O")
            {
                probalidad    = mercado.DineroOver / (mercado.DineroOver + mercado.DineroUnder);
                apuesta.Cuota = (float)((1 / probalidad) * 0.95);
                //update de la cuota en caso que sea Over
                reposMercado.UpdateOver(apuesta.FK_MercadoId, apuesta.Cuota);
            }
            else if (apuesta.Tipo.ToString() == "U")
            {
                probalidad    = mercado.DineroUnder / (mercado.DineroOver + mercado.DineroUnder);
                apuesta.Cuota = (float)((1 / probalidad) * 0.95);
                //update de la cuota en caso que se Under
                reposMercado.UpdateUnder(apuesta.FK_MercadoId, apuesta.Cuota);
            }

            repo.Save(apuesta);
        }
예제 #26
0
        //[Authorize(Roles = "Admin")]//AE4-7
        public IEnumerable <ApuestasMercado> GetApuestasMercado(int id)
        {
            var repo = new ApuestasRepository();
            List <ApuestasMercado> apuestas = repo.ApuestasMercado(id);

            return(apuestas);
        }
예제 #27
0
        // GET: api/apuestas
        public IEnumerable <Apuestas> Get()
        {
            //Devuelve un array de eventos en formato JSON
            var             repo     = new ApuestasRepository();
            List <Apuestas> apuestas = repo.Retrieve();

            return(apuestas);
        }
예제 #28
0
        public IEnumerable <ApuestasUsuarioEmail> GetApuestasEmail(string id)
        {
            string email = id;
            var    repo  = new ApuestasRepository();
            List <ApuestasUsuarioEmail> apuestas = repo.ApuestasUsuario(email);

            return(apuestas);
        }
예제 #29
0
        public Apuestas Get(int id)
        {
            //Devuelve un array de eventos en formato JSON
            var      repo     = new ApuestasRepository();
            Apuestas apuestas = repo.Retrieve(id);

            return(apuestas);
        }
예제 #30
0
        public ApuestasDTO Get(string Email)
        {
            var repo = new ApuestasRepository();
            //Apuestas a = repo.Retrieve();
            ApuestasDTO a = repo.RetrieveDTO();

            return(a);
        }