public ActionResult MaintainKinerjaProduk([FromBody] KinerjaProduk model) { bool blnResult = false; string ErrMsg = ""; try { model.NIK = _intNIK; model.Module = strModule; var Content = new StringContent(JsonConvert.SerializeObject(model)); using (HttpClient client = new HttpClient()) { client.BaseAddress = new Uri(_strAPIUrl); Content.Headers.ContentType = new MediaTypeWithQualityHeaderValue("application/json"); var request = client.PostAsync("/api/IBMB/MaintainKinerja", Content); var response = request.Result.Content.ReadAsStringAsync().Result; JObject strObject = JObject.Parse(response); blnResult = strObject.SelectToken("blnResult").Value <bool>(); ErrMsg = strObject.SelectToken("errMsg").Value <string>(); } } catch (Exception e) { ErrMsg = e.Message; return(Json(new { blnResult, ErrMsg })); } return(Json(new { blnResult, ErrMsg })); }
public JsonResult MaintainKinerja([FromBody] KinerjaProduk model) { bool blnResult = false; string ErrMsg = ""; blnResult = cls.ReksaMaintainKinerja(model, out ErrMsg); ErrMsg = ErrMsg.Replace("ReksaMaintainKinerja - Core .Net SqlClient Data Provider\n", ""); return(Json(new { blnResult, ErrMsg })); }