Shuxia Ning
2024-11-25 d4898c5d7e1bbbbba384a0e29f29c066d6f502a7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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;
        }
 
 
 
 
 
    }
}