Exemple #1
0
 public HttpResponseMessage GetCountryId(string CountryId)
 {
     try
     {
         DbLibrary    dbLibrary   = new DbLibrary();
         BO_Editorial boEditorial = new BO_Editorial(dbLibrary);
         DataMessage  dataMessage = new DataMessage(boEditorial.GetCountryId(CountryId));
         return(Request.CreateResponse(HttpStatusCode.OK, dataMessage));
     }
     catch (Exception e)
     {
         ErrorMessage mensaje = new ErrorMessage("2.1", "Excepción en la obtención del Id: " + e.GetBaseException().Message, e.ToString());
         return(Request.CreateResponse(HttpStatusCode.BadRequest, mensaje));
     }
 }
Exemple #2
0
 public HttpResponseMessage Put([FromBody] Editorial editorial)
 {
     try
     {
         DbLibrary    dbLibrary   = new DbLibrary();
         BO_Editorial boEditorial = new BO_Editorial(dbLibrary);
         DataMessage  dataMessage = new DataMessage(boEditorial.Update(editorial));
         return(Request.CreateResponse(HttpStatusCode.OK, dataMessage));
     }
     catch (Exception e)
     {
         ErrorMessage mensaje = new ErrorMessage("2.1", "Excepción en la actualización del registro: " + e.GetBaseException().Message, e.ToString());
         return(Request.CreateResponse(HttpStatusCode.BadRequest, mensaje));
     }
 }
Exemple #3
0
 public HttpResponseMessage PutState(int EditorialId, bool State)
 {
     try
     {
         DbLibrary    dbLibrary   = new DbLibrary();
         BO_Editorial boEditorial = new BO_Editorial(dbLibrary);
         DataMessage  dataMessage = new DataMessage(boEditorial.ChangeState(EditorialId, State));
         return(Request.CreateResponse(HttpStatusCode.OK, dataMessage));
     }
     catch (Exception e)
     {
         ErrorMessage mensaje = new ErrorMessage("2.1", "Excepción en el cambio de estado del registro: " + e.GetBaseException().Message, e.ToString());
         return(Request.CreateResponse(HttpStatusCode.BadRequest, mensaje));
     }
 }