using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IStation.Service
{
///
/// 监测波动记录(一个信号只能有一条)
///
public partial class MonitorFluctRecord
{
private readonly DAL.MonitorFluctRecord _dal = new DAL.MonitorFluctRecord();
///
/// 通过 MonitorPointID 获取
///
public List GetByMonitorPointID(long CorpID, long MonitorPointID)
{
var entity_list = _dal.GetByMonitorPointID(CorpID, MonitorPointID);
var model_list = Entity2Models(entity_list);
return model_list;
}
///
/// 通过 SignalID 获取
///
public Model.MonitorFluctRecord GetBySignalID(long CorpID, long MonitorPointID, long SignalID)
{
var entity = _dal.GetBySignalID(CorpID, MonitorPointID, SignalID);
var model = Entity2Model(entity);
return model;
}
///
/// 通过 SignalID 判断是否存在
///
public bool IsExistBySignalID(long CorpID, long MonitorPointID, long SignalID)
{
return _dal.IsExistBySignalID(CorpID, MonitorPointID, SignalID);
}
///
/// 通过 MonitorPointID 判断是否存在
///
public bool IsExistByMonitorPointID(long CorpID, long MonitorPointID)
{
return _dal.IsExistByMonitorPointID(CorpID,MonitorPointID);
}
///
/// 插入或更新
///
public bool InsertOrUpdate(Model.MonitorFluctRecord model)
{
if (model == null)
return false;
var entity = Model2Entity(model);
return _dal.InsertOrUpdate(entity);
}
}
}