Example #1
0
 public Object PostTipoComponentes([FromBody] ProcessMsg.Model.TipoComponenteBo TipoComponente)
 {
     try
     {
         if (HttpContext.Current.Session["token"] == null)
         {
             return(Redirect(Request.RequestUri.GetLeftPart(UriPartial.Authority)));
         }
         ProcessMsg.Bitacora.AddBitacora("Modulo", null, TipoComponente.Bitacora('I'), 'I', DateTime.Now, int.Parse(HttpContext.Current.Session["token"].ToString()), TipoComponente.Bitacora('?'));
         if (ProcessMsg.ComponenteModulo.AddTipoComponentes(TipoComponente.Nombre, TipoComponente.isCompBD, TipoComponente.isCompDLL, TipoComponente.Extensiones, TipoComponente.isCompCambios) == 1)
         {
             return(Content(HttpStatusCode.OK, true));
         }
         return(Content(HttpStatusCode.Created, false));
     }
     catch (Exception ex)
     {
         throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.ExpectationFailed, ex.Message));
     }
 }
Example #2
0
 public Object UpdComponentesModulos(int idTipoComponentes, [FromBody] ProcessMsg.Model.TipoComponenteBo TipoComponente)
 {
     try
     {
         if (HttpContext.Current.Session["token"] == null)
         {
             return(Redirect(Request.RequestUri.GetLeftPart(UriPartial.Authority)));
         }
         var tipo = ProcessMsg.ComponenteModulo.GetTipoComponentes().SingleOrDefault(x => x.idTipoComponentes == idTipoComponentes);
         if (tipo != null)
         {
             ProcessMsg.Bitacora.AddBitacora("Modulo", tipo.Bitacora('U'), TipoComponente.Bitacora('U'), 'U', DateTime.Now, int.Parse(HttpContext.Current.Session["token"].ToString()), tipo.Bitacora('?'));
             if (ProcessMsg.ComponenteModulo.UpdTipoComponentes(idTipoComponentes, TipoComponente.Nombre, TipoComponente.Extensiones, TipoComponente.isCompBD, TipoComponente.isCompDLL, TipoComponente.isCompCambios) == 1)
             {
                 return(Content(HttpStatusCode.OK, true));
             }
         }
         return(Content(HttpStatusCode.Created, false));
     }
     catch (Exception ex)
     {
         throw new HttpResponseException(Request.CreateErrorResponse(HttpStatusCode.ExpectationFailed, ex.Message));
     }
 }