Пример #1
0
        //public HttpResponseMessage Save(string cod_estudio, string desc_estudio)
        public HttpResponseMessage Save([FromBody] Model.estudio estudio)
        {
            var message = new HttpResponseMessage(HttpStatusCode.InternalServerError);

            try
            {
                base.BusinessInstance.Add(estudio);

                message = Request.CreateResponse(HttpStatusCode.OK);
            }
            catch (Exception ex) //TODO: Change that with specific exception
            {
                message = Request.CreateResponse <Exception>(HttpStatusCode.InternalServerError, ex);
            }
            return(message);
        }
Пример #2
0
        public HttpResponseMessage Update([FromBody] Model.estudio estudio)
        {
            var message = new HttpResponseMessage(HttpStatusCode.InternalServerError);

            try
            {
                //var estudio = new Model.estudio();
                //estudio.cod_estudio = Convert.ToInt16(cod_estudio);
                //estudio.desc_estudio = desc_estudio;

                base.BusinessInstance.SaveOrUpdate(estudio);

                message = Request.CreateResponse(HttpStatusCode.OK);
            }
            catch (Exception ex) //TODO: Change that with specific exception
            {
                message = Request.CreateResponse <Exception>(HttpStatusCode.InternalServerError, ex);
            }
            return(message);
        }