public JsonResult RefreshMaintenanceUpFrontSelling(int ProdukId, string FeeType) { bool blnResult = false; string ErrMsg = ""; List <ParamUpFrontSellingModel> listReksaParamUpFrontSelling = new List <ParamUpFrontSellingModel>(); List <ParamUpFrontSellGLModel> listReksaListGL = new List <ParamUpFrontSellGLModel>(); ParamUpFrontSellingModel listFee = new ParamUpFrontSellingModel(); try { using (HttpClient client = new HttpClient()) { client.BaseAddress = new Uri(_strAPIUrl); MediaTypeWithQualityHeaderValue contentType = new MediaTypeWithQualityHeaderValue("application/json"); client.DefaultRequestHeaders.Accept.Add(contentType); HttpResponseMessage response = client.GetAsync("/api/Parameter/PopulateUpFrontSellingFee?NIK=" + _intNIK + "&strModule=" + strModule + "&ProdId=" + ProdukId + "&TrxType=" + FeeType).Result; string stringData = response.Content.ReadAsStringAsync().Result; JObject strObject = JObject.Parse(stringData); blnResult = strObject.SelectToken("blnResult").Value <bool>(); ErrMsg = strObject.SelectToken("errMsg").Value <string>(); JToken strTokenParam = strObject["listReksaParamFee"]; JToken strTokenGL = strObject["listReksaListGL"]; string strJsonParamMaintenance = JsonConvert.SerializeObject(strTokenParam); string strJsonGL = JsonConvert.SerializeObject(strTokenGL); listReksaParamUpFrontSelling = JsonConvert.DeserializeObject <List <ParamUpFrontSellingModel> >(strJsonParamMaintenance); listReksaListGL = JsonConvert.DeserializeObject <List <ParamUpFrontSellGLModel> >(strJsonGL); } ParameterUpFrontSellFeeListViewModel vModel = new ParameterUpFrontSellFeeListViewModel(); if (listReksaParamUpFrontSelling.Count > 0) { listFee = listReksaParamUpFrontSelling[0]; } else { listFee.PercentDefault = 0; listFee.ProdId = 0; listFee.TrxType = ""; } while (listReksaListGL.Count < 5) { listReksaListGL.Add(new ParamUpFrontSellGLModel()); } vModel.ListGL = listReksaListGL; vModel.ParamUpFrontSelling = listFee; } catch (Exception e) { ErrMsg = e.Message; } return(Json(new { blnResult, ErrMsg, listFee, listReksaListGL })); }
public IActionResult UpFrontSellingFee() { ParameterUpFrontSellFeeListViewModel vModel = new ParameterUpFrontSellFeeListViewModel(); return(View(vModel)); } //RefreshMaintenanceUpFrontSelling