using Yw.Vmo;
|
|
namespace HStation.WinFrmUI
|
{
|
/// <summary>
|
/// 监测点辅助类
|
/// </summary>
|
public class SimulationMonitorHelper
|
{
|
/// <summary>
|
///
|
/// </summary>
|
public SimulationMonitorHelper(long modelId)
|
{
|
_modelId = modelId;
|
}
|
|
private long _modelId;//模型id
|
private List<HydroMonitorVmo> _allMonitorList = null;//所有监测点列表
|
|
/// <summary>
|
/// 获取
|
/// </summary>
|
public async Task<List<HydroMonitorVmo>> Get()
|
{
|
if (_allMonitorList == null)
|
{
|
_allMonitorList = await BLLFactory<Yw.BLL.HydroMonitor>.Instance.GetByModelID(_modelId);
|
if (_allMonitorList == null)
|
{
|
_allMonitorList = new List<HydroMonitorVmo>();
|
}
|
}
|
return _allMonitorList;
|
}
|
|
/// <summary>
|
/// 更新
|
/// </summary>
|
public async Task<List<HydroMonitorVmo>> Update(string code)
|
{
|
var allMonitorList = await Get();
|
allMonitorList.RemoveAll(x => x.Relation == code);
|
var monitorList = await BLLFactory<Yw.BLL.HydroMonitor>.Instance.GetByRelation(_modelId, code);
|
if (monitorList != null && monitorList.Count > 0)
|
{
|
allMonitorList.AddRange(monitorList);
|
}
|
return monitorList;
|
}
|
|
|
|
|
|
}
|
}
|