예제 #1
0
        public HttpResponseMessage ObtenerCalificacionFinalEstandares(string NIT, string IdEval)
        {
            HttpResponseMessage response = null;

            try
            {
                LNEvaluacionStandMinimos logica = new LNEvaluacionStandMinimos();
                int IdEvalInt = 0;
                if (int.TryParse(IdEval, out IdEvalInt))
                {
                }
                var calificacion = logica.ObtenerCalificacionFinal(NIT, IdEvalInt);
                if (calificacion != null)
                {
                    response = Request.CreateResponse <EDValoracionFinal>(HttpStatusCode.OK, calificacion);
                    return(response);
                }
                else
                {
                    response = Request.CreateResponse(HttpStatusCode.ExpectationFailed);
                    return(response);
                }
            }
            catch (Exception ex)
            {
                response = Request.CreateResponse(HttpStatusCode.InternalServerError);
                return(response);
            }
        }
예제 #2
0
        public HttpResponseMessage ObtenerCiclos(string NIT, string IdEval)
        {
            HttpResponseMessage response = null;

            try
            {
                LNEvaluacionStandMinimos logica = new LNEvaluacionStandMinimos();
                int IdEvalInt = 0;
                if (int.TryParse(IdEval, out IdEvalInt))
                {
                }
                var Ciclos = logica.ObtenerCiclos(NIT, IdEvalInt);
                if (Ciclos != null)
                {
                    response = Request.CreateResponse(HttpStatusCode.OK, Ciclos);
                    return(response);
                }
                else
                {
                    response = Request.CreateResponse(HttpStatusCode.ExpectationFailed);
                    return(response);
                }
            }
            catch (Exception ex)
            {
                response = Request.CreateResponse(HttpStatusCode.InternalServerError, ex);
                return(response);
            }
        }
예제 #3
0
        public HttpResponseMessage ObtenerActividades(string NIT, int idEval)
        {
            HttpResponseMessage response = null;

            try
            {
                LNEvaluacionStandMinimos logica = new LNEvaluacionStandMinimos();
                var actividades = logica.ObtenerActividades(NIT, idEval);
                if (actividades != null)
                {
                    response = Request.CreateResponse(HttpStatusCode.OK, actividades);
                    return(response);
                }
                else
                {
                    response = Request.CreateResponse(HttpStatusCode.ExpectationFailed);
                    return(response);
                }
            }
            catch (Exception ex)
            {
                response = Request.CreateResponse(HttpStatusCode.InternalServerError);
                return(response);
            }
        }
예제 #4
0
        public HttpResponseMessage ObtenerCriterios(int idCiclo, string NIT, string IdEval)
        {
            HttpResponseMessage response = null;

            try
            {
                LNEvaluacionStandMinimos logica = new LNEvaluacionStandMinimos();
                int IdEvalInt = 0;
                if (int.TryParse(IdEval, out IdEvalInt))
                {
                }
                var Estandares = logica.ListaEstandarEditar(idCiclo, NIT, IdEvalInt);
                if (Estandares != null)
                {
                    response = Request.CreateResponse(HttpStatusCode.OK, Estandares);
                    return(response);
                }
                else
                {
                    response = Request.CreateResponse(HttpStatusCode.ExpectationFailed);
                    return(response);
                }
            }
            catch (Exception ex)
            {
                response = Request.CreateResponse(HttpStatusCode.InternalServerError);
                return(response);
            }
        }
예제 #5
0
        public HttpResponseMessage ObtenerEvaluaciones(int Idempresa, int IdEval)
        {
            HttpResponseMessage response = null;

            try
            {
                LNEvaluacionStandMinimos logica = new LNEvaluacionStandMinimos();
                var Estandares = logica.Evaluacion(Idempresa, IdEval);
                if (Estandares != null)
                {
                    response = Request.CreateResponse(HttpStatusCode.OK, Estandares);
                    return(response);
                }
                else
                {
                    response = Request.CreateResponse(HttpStatusCode.ExpectationFailed);
                    return(response);
                }
            }
            catch (Exception ex)
            {
                response = Request.CreateResponse(HttpStatusCode.InternalServerError);
                return(response);
            }
        }
예제 #6
0
        public HttpResponseMessage ObtenerReporteActividadesExcel(string Nit, int Idval)
        {
            HttpResponseMessage response = null;

            try
            {
                LNEvaluacionStandMinimos logica = new LNEvaluacionStandMinimos();
                var archivo = logica.ObtenerActividadesExcel(Nit, Idval);
                if (archivo != null)
                {
                    response = Request.CreateResponse <byte[]>(HttpStatusCode.OK, archivo);
                    return(response);
                }
                else
                {
                    response = Request.CreateResponse(HttpStatusCode.ExpectationFailed);
                    return(response);
                }
            }
            catch (Exception ex)
            {
                response = Request.CreateResponse(HttpStatusCode.InternalServerError);
                return(response);
            }
        }
예제 #7
0
        public void GenerarExcelPlanAccionLogicaTest()
        {
            LNEvaluacionStandMinimos logica = new LNEvaluacionStandMinimos();

            byte [] archivo = logica.ObtenerActividadesExcel("3", 1);
            Assert.IsNotNull(archivo, "La peticion fallo, el objeto es nulo");
            Assert.IsTrue(archivo.Length > 0, "La peticion fallo, la lista de estandares esta vacia");
        }
예제 #8
0
 public HttpResponseMessage VerificarEstado(int Ideval)
 {
     try
     {
         var logica    = new LNEvaluacionStandMinimos();
         var Respuesta = logica.VerificarCambiarEstado(Ideval);
         var response  = Request.CreateResponse(HttpStatusCode.OK, Respuesta);
         return(response);
     }
     catch (Exception ex)
     {
         var response = Request.CreateResponse(HttpStatusCode.InternalServerError);
         return(response);
     }
 }
예제 #9
0
        public HttpResponseMessage ValidarEvaluacionCriterio(EDEvaluacionEmpresa EDEvaluacionEmpresa)
        {
            HttpResponseMessage response = null;

            try
            {
                LNEvaluacionStandMinimos logica = new LNEvaluacionStandMinimos();
                var Respuesta = logica.verificarcriterio(EDEvaluacionEmpresa.Estado, EDEvaluacionEmpresa.Pk_Id_EvaluacionEmpresa);
                response = Request.CreateResponse(HttpStatusCode.OK, Respuesta);
                return(response);
            }
            catch (Exception ex)
            {
                response = Request.CreateResponse(HttpStatusCode.InternalServerError, ex);
                return(response);
            }
        }
예제 #10
0
        public HttpResponseMessage EditarEvaluacionEstandares(EDEvaluacionEstandarMinimo EvaluacionEstandar)
        {
            HttpResponseMessage response = null;

            try
            {
                LNEvaluacionStandMinimos logica = new LNEvaluacionStandMinimos();
                var result = logica.EditarEvaluacionEstandar(EvaluacionEstandar);
                response = Request.CreateResponse <EDCiclo>(HttpStatusCode.Created, result);
                return(response);
            }
            catch (Exception ex)
            {
                response = Request.CreateResponse(HttpStatusCode.InternalServerError);
                return(response);
            }
        }
예제 #11
0
        public HttpResponseMessage CerrarEvaluacion(int idEval, int idempresa)
        {
            HttpResponseMessage response = null;

            try
            {
                LNEvaluacionStandMinimos logica = new LNEvaluacionStandMinimos();
                var cerrado = logica.CerrarEvaluacion(idEval, idempresa);
                response = Request.CreateResponse(HttpStatusCode.OK, cerrado);
                return(response);
            }
            catch (Exception ex)
            {
                response = Request.CreateResponse(HttpStatusCode.InternalServerError);
                return(response);
            }
        }
예제 #12
0
        public HttpResponseMessage EliminarEvaluacion(EDEvaluacionEmpresa EDEvaluacionEmpresa)
        {
            HttpResponseMessage response = null;

            try
            {
                LNEvaluacionStandMinimos logica = new LNEvaluacionStandMinimos();
                var actividades = logica.EliminarEvaluacion(EDEvaluacionEmpresa);
                response = Request.CreateResponse(HttpStatusCode.OK, actividades);
                return(response);
            }
            catch (Exception ex)
            {
                response = Request.CreateResponse(HttpStatusCode.InternalServerError);
                return(response);
            }
        }
예제 #13
0
        public void GuardarEvaluacionEstandaresLogicaTest()
        {
            EDEvaluacionEstandarMinimo eval = new EDEvaluacionEstandarMinimo
            {
                IdCriterio           = 2,
                IdEmpresaEvaluar     = 3,
                IdValoracionCriterio = 2,
                IdCiclo       = 1,
                Justificacion = "No tiene",
                Actividades   = CrearActividades()
            };

            LNEvaluacionStandMinimos logica = new LNEvaluacionStandMinimos();
            EDCiclo ciclo = logica.GuardarEvaluacionEstandar(eval);

            Assert.IsNotNull(ciclo, "La peticion fallo, el objeto es nulo");
            Assert.IsTrue(ciclo.Id_Ciclo > 0, "La peticion fallo, la lista de estandares esta vacia");
        }
예제 #14
0
        public HttpResponseMessage ObtenerCriterioConsulta(int idCiclo, string NIT, string IdEval, int idElemento, bool tipo)
        {
            HttpResponseMessage response = null;

            try
            {
                LNEvaluacionStandMinimos logica = new LNEvaluacionStandMinimos();
                int IdEvalInt = 0;
                if (int.TryParse(IdEval, out IdEvalInt))
                {
                }
                EDCiclo EDCiclo = new EDCiclo();
                if (tipo)
                {
                    EDCiclo = logica.ObtenerEstandaresPorCicloConsulta1(idCiclo, NIT, IdEvalInt, idElemento);
                }
                else
                {
                    EDCiclo = logica.ObtenerEstandaresPorCicloConsulta(idCiclo, NIT, IdEvalInt, idElemento);
                }


                if (EDCiclo != null)
                {
                    response = Request.CreateResponse <EDCiclo>(HttpStatusCode.OK, EDCiclo);
                    return(response);
                }
                else
                {
                    response = Request.CreateResponse(HttpStatusCode.ExpectationFailed);
                    return(response);
                }
            }
            catch (Exception ex)
            {
                response = Request.CreateResponse(HttpStatusCode.InternalServerError);
                return(response);
            }
        }
예제 #15
0
 public HttpResponseMessage ObtenerEvaluaaciones(int IdEmpresa)
 {
     try
     {
         var logica = new LNEvaluacionStandMinimos();
         var result = logica.ListaEvaluaciones(IdEmpresa);
         if (result != null)
         {
             var response = Request.CreateResponse(HttpStatusCode.OK, result);
             return(response);
         }
         else
         {
             var response = Request.CreateResponse(HttpStatusCode.ExpectationFailed);
             return(response);
         }
     }
     catch (Exception ex)
     {
         var response = Request.CreateResponse(HttpStatusCode.InternalServerError);
         return(response);
     }
 }