Exemplo n.º 1
0
        public ActionResult PopulateNAVParameter([FromBody] UploadNAV model)
        {
            bool   blnResult = false;
            string ErrMsg    = "";
            List <ProcessModel> listProcess = new List <ProcessModel>();

            try
            {
                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/Utilitas/PopulateNAVParameter?NIK=" + _intNIK + "&Guid=" + _strGuid, 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, listProcess }));
        }
Exemplo n.º 2
0
        public JsonResult PopulateNAVParameter([FromBody] UploadNAV model, [FromQuery] int NIK, [FromQuery] string Guid)
        {
            bool   blnResult;
            string ErrMsg;

            blnResult = cls.ReksaPopulateNAVParameter(model, NIK, Guid, out ErrMsg);
            ErrMsg    = ErrMsg.Replace("ReksaPopulateNAVParameter - Core .Net SqlClient Data Provider\n", "");
            return(Json(new { blnResult, ErrMsg }));
        }