public ActionResult Post_Datos_Generales(Calorias_Datos_GeneralesModel varCalorias) { try { if (!_tokenManager.GenerateToken()) { return(Json(null, JsonRequestBehavior.AllowGet)); } _ICaloriasApiConsumer.SetAuthHeader(_tokenManager.Token); var result = ""; var Calorias_Datos_GeneralesInfo = new Calorias_Datos_Generales { Clave = varCalorias.Clave , Cantidad = varCalorias.Cantidad }; result = _ICaloriasApiConsumer.Update_Datos_Generales(Calorias_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(Calorias_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)); } }