Esempio n. 1
0
 public HttpResponseMessage GuardarPlanAccionCorrectiva(List <EDPlanAccionCorrectiva> planescorrectivos)
 {
     try
     {
         var logica = new LNInspeccion();
         var result = logica.GuardarPlanAccionCorrectiva(planescorrectivos);
         if (result != null)
         {
             var response = Request.CreateResponse <List <EDPlanAccionCorrectiva> >(HttpStatusCode.Created, result);
             return(response);
         }
         else
         {
             var response = Request.CreateResponse(HttpStatusCode.ExpectationFailed);
             return(response);
         }
     }
     catch (Exception ex)
     {
         var response = Request.CreateResponse(HttpStatusCode.InternalServerError);
         return(response);
     }
 }
Esempio n. 2
0
 public HttpResponseMessage ObtenerTiposDePeligro()
 {
     try
     {
         var logica = new LNInspeccion();
         var result = logica.ObtenerTiposDePeligro();
         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);
     }
 }
Esempio n. 3
0
 public HttpResponseMessage EditarCondicion(EDCondicionInsegura condicion)
 {
     try
     {
         var logica = new LNInspeccion();
         var result = logica.EditarCondicion(condicion);
         if (result != null)
         {
             var response = Request.CreateResponse <EDCondicionInsegura>(HttpStatusCode.Created, result);
             return(response);
         }
         else
         {
             var response = Request.CreateResponse(HttpStatusCode.ExpectationFailed);
             return(response);
         }
     }
     catch (Exception ex)
     {
         var response = Request.CreateResponse(HttpStatusCode.InternalServerError);
         return(response);
     }
 }
Esempio n. 4
0
 public HttpResponseMessage ConsultarInspeccionPorTipo(int idsede, string tipoInspeccion, DateTime?fechai, DateTime?fechaf, int NIT)
 {
     try
     {
         var logica = new LNInspeccion();
         var result = logica.ObtenerInspecciones(idsede, tipoInspeccion, fechai, fechaf);
         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);
     }
 }
Esempio n. 5
0
 public HttpResponseMessage GuardarPlanInspeccion(EDPlanInspeccion planinspeccion)
 {
     try
     {
         var logica = new LNInspeccion();
         var result = logica.GuardarPlaneacion(planinspeccion);
         if (result != null)
         {
             var response = Request.CreateResponse <EDPlanInspeccion>(HttpStatusCode.Created, result);
             return(response);
         }
         else
         {
             var response = Request.CreateResponse(HttpStatusCode.ExpectationFailed);
             return(response);
         }
     }
     catch (Exception ex)
     {
         var response = Request.CreateResponse(HttpStatusCode.InternalServerError);
         return(response);
     }
 }
Esempio n. 6
0
 public HttpResponseMessage ContinuarEjecutarPlan(int consecutivo, string responsable, string fecha, string describeinspeccion, int pkplan, int id)
 {
     try
     {
         var logica = new LNInspeccion();
         var result = logica.ContinuarEjecucionPlan(consecutivo, responsable, fecha, describeinspeccion, pkplan, id);
         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);
     }
 }
Esempio n. 7
0
 public HttpResponseMessage ObtenerInspeccionNoEjecutada(int Idinspeccion)
 {
     try
     {
         var logica = new LNInspeccion();
         var result = logica.ObtenerConfiguracionesPorIns(Idinspeccion);
         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);
     }
 }
Esempio n. 8
0
 public HttpResponseMessage EliminarPlaneacion(int IdPlaneacion)
 {
     try
     {
         var logica = new LNInspeccion();
         var result = logica.EliminarPlaneacion(IdPlaneacion);
         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);
     }
 }
Esempio n. 9
0
 public HttpResponseMessage ObtenerInspeccionNoEjecutada(int IdInspeccion, int IdPlaneacion, EDInformacionAuditoria edInfoauditoria)
 {
     try
     {
         var logica = new LNInspeccion();
         var result = logica.EliminarInspeccion(IdInspeccion, IdPlaneacion, edInfoauditoria);
         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);
     }
 }
Esempio n. 10
0
 public HttpResponseMessage EjecutarPlan(int ConsecutivoPlanVM, string responsable, string Fecha, string DescripcionTipoInspeccionse, int id)
 {
     try
     {
         var logica = new LNInspeccion();
         var result = logica.EjecutarPlan(ConsecutivoPlanVM, responsable, Fecha, DescripcionTipoInspeccionse, id);
         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);
     }
 }