| | |
| | | /// <summary> |
| | | /// 更新监测值列表 |
| | | /// </summary> |
| | | public static void UpdateMonitorValue(this List<HydroMonitorValueViewModel> allMonitorValueList, string monitorInfo) |
| | | public static void UpdateMonitorValue(this List<HydroMonitorValueViewModel> all, string monitorInfo) |
| | | { |
| | | if (allMonitorValueList == null || allMonitorValueList.Count < 1) |
| | | if (all == null || all.Count < 1) |
| | | { |
| | | return; |
| | | } |
| | |
| | | return; |
| | | } |
| | | var allWorkingMonitorList = JsonHelper.Json2Object<List<HydroWorkingMonitorViewModel>>(monitorInfo); |
| | | if (allWorkingMonitorList == null || allWorkingMonitorList.Count < 1) |
| | | { |
| | | return; |
| | | } |
| | | allMonitorValueList.UpdateMonitorValue(allWorkingMonitorList); |
| | | all.UpdateMonitorValue(allWorkingMonitorList); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 更新监测值列表 |
| | | /// </summary> |
| | | public static void UpdateMonitorValue(this List<HydroMonitorValueViewModel> allMonitorValueList, List<HydroWorkingMonitorViewModel> allWorkingMonitorList) |
| | | public static void UpdateMonitorValue |
| | | ( |
| | | this List<HydroMonitorValueViewModel> all, |
| | | List<HydroWorkingMonitorViewModel> allWorkingMonitorList |
| | | ) |
| | | { |
| | | if (allMonitorValueList == null || allMonitorValueList.Count < 1) |
| | | if (all == null || all.Count < 1) |
| | | { |
| | | return; |
| | | } |
| | |
| | | { |
| | | return; |
| | | } |
| | | foreach (var monitorValue in allMonitorValueList) |
| | | foreach (var monitorValue in all) |
| | | { |
| | | var workingMonitor = allWorkingMonitorList.Find(x => x.Relation == monitorValue.Vmo.Relation && x.PropName == monitorValue.Vmo.PropName); |
| | | if (workingMonitor != null) |
| | | { |
| | | monitorValue.PropValue = workingMonitor.PropValue; |
| | | monitorValue.UpdatePropValue(workingMonitor.PropValue); |
| | | } |
| | | } |
| | | } |