public ActionResult Create(ThresholdViewModel threshold) { Dictionary <string, string> standardDict = GetDictFromBlob("Standard.AlertThresholds.json"); Dictionary <string, string> currentDict = GetDictFromBlob("Configuration.AlertThresholds.json"); standardDict.Add(threshold.ID, threshold.standard.ToString()); currentDict.Add(threshold.ID, threshold.current.ToString()); WriteDictToBlob(standardDict, "Standard.AlertThresholds.json"); WriteDictToBlob(currentDict, "Configuration.AlertThresholds.json"); return(RedirectToAction("Threshold_Details")); }
public static KPIViewModel getKpiViewModel(decimal?Value, double?GreenThreshold, double?YellowThreshold) { ThresholdViewModel threshold = new ThresholdViewModel(); threshold.green = GreenThreshold; threshold.yellow = YellowThreshold; KPIViewModel result = new KPIViewModel(); result.value = Value; result.threshold = threshold; return(result); }