public HttpResponseMessage Put([FromBody] Language language) { try { DbLibrary dbLibrary = new DbLibrary(); BO_Language boLanguage = new BO_Language(dbLibrary); DataMessage dataMessage = new DataMessage(boLanguage.Update(language)); 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)); } }
public HttpResponseMessage PutState(int LanguageId, bool State) { try { DbLibrary dbLibrary = new DbLibrary(); BO_Language boLanguage = new BO_Language(dbLibrary); DataMessage dataMessage = new DataMessage(boLanguage.ChangeState(LanguageId, 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)); } }
public HttpResponseMessage GetLanguage(int LanguageId) { try { DbLibrary dbLibrary = new DbLibrary(); BO_Language boLanguage = new BO_Language(dbLibrary); DataMessage dataMessage = new DataMessage(boLanguage.GetId(LanguageId)); 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)); } }