public async Task <IHttpActionResult> Verifica(int id, int idTipo)
        {
            entRespuesta respuesta = new entRespuesta();

            id = JwtManager.getIdUserSession();
            try
            {
                var lista = await _ir.GetList <Prueba>(x => x.idUsuario == id && x.idTipoPregunta == idTipo && x.completado == true && x.esSimulacion == false);

                var registro = lista.OrderByDescending(z => z.fechaInicioPrueba).FirstOrDefault();
                if (registro != null)
                {
                    var viewmodels = Mapper.Map <Prueba, PruebaViewModels>(registro);
                    respuesta.codigo  = 1;
                    respuesta.mensaje = "true";
                    respuesta.data    = registro;
                    return(Ok(respuesta));
                }
                else
                {
                    respuesta.codigo  = 0;
                    respuesta.mensaje = "false";
                    respuesta.data    = null;
                    return(Ok(respuesta));
                }
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Example #2
0
        public async Task <IHttpActionResult> VerContacto(int id)
        {
            try
            {
                id = JwtManager.getIdUserSession();
                var entidad = await _ir.GetList <Contacto>(z => z.idUsuario == id && z.vigente == true);

                return(Ok(entidad));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Example #3
0
        public async Task <IHttpActionResult> ObtenerNivelJerarquico(string id)
        {
            var lista = await _ir.GetList <OfertasEmpleo>(z => z.proveedorEmpleo == id);//obtenemos las ofertas de empleo por el proveedor

            var listaViewModels = Mapper.Map <List <OfertasEmpleo>, List <OfertaViewModels> >(lista);

            return(Ok(listaViewModels));
        }
        public async Task <IHttpActionResult> Lista(int id)
        {
            try
            {
                id = JwtManager.getIdUserSession();
                var lista = await _ir.GetList <Coworking>(z => z.idUsuario == id && z.vigente == true);//listamos los coworking por el id de usuario

                var listaViewmodels = Mapper.Map <List <Coworking>, List <CoworkingViewModels> >(lista);
                return(Ok(listaViewmodels));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Example #5
0
        public async Task <IHttpActionResult> ListaEmpresas()
        {
            try
            {
                entRespuesta ent   = new entRespuesta();
                var          lista = await _ir.GetList <IttEmpresa>(z => z.vigente == true);               //obtenemos las empresas

                var listaViewModels = Mapper.Map <List <IttEmpresa>, List <IttEmpresaViewModels> >(lista); //mapeamos el objeto
                ent.data = listaViewModels;
                return(Ok(ent));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }