Exemplo n.º 1
0
        public ActionResult Post_Datos_Generales(Padecimientos_Datos_GeneralesModel varPadecimientos)
        {
            try
            {
                if (!_tokenManager.GenerateToken())
                    return Json(null, JsonRequestBehavior.AllowGet);
                _IPadecimientosApiConsumer.SetAuthHeader(_tokenManager.Token);

                var result = "";
                var Padecimientos_Datos_GeneralesInfo = new Padecimientos_Datos_Generales
                {
                    Clave = varPadecimientos.Clave
                                            ,Descripcion = varPadecimientos.Descripcion

                };

                result = _IPadecimientosApiConsumer.Update_Datos_Generales(Padecimientos_Datos_GeneralesInfo).Resource.ToString();
                Session["KeyValueInserted"] = result;
                return Json(result, JsonRequestBehavior.AllowGet);
            }
            catch (ServiceException ex)
            {
                return Json(false, JsonRequestBehavior.AllowGet);
            }
        }
        public ApiResponse <int> Update_Datos_Generales(Padecimientos_Datos_Generales entity)
        {
            try
            {
                var result = RestApiHelper.InvokeApi <int>(baseApi, ApiControllerUrl + "/Put_Datos_Generales",
                                                           Method.PUT, ApiHeader, entity);

                return(new ApiResponse <int>(true, result));
            }
            catch (Exception ex)
            {
                return(new ApiResponse <int>(false, -1));
            }
        }