You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.8 KiB
63 lines
1.8 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using QMAPP.DAL;
|
|
using QMFrameWork.Log;
|
|
using QMAPP.FJC.Entity.Equipment;
|
|
using QMFrameWork.Data;
|
|
|
|
namespace QMAPP.FJC.DAL.Equipment
|
|
{
|
|
public class AlarmTableDAL: BaseDAL
|
|
{
|
|
public List<AlarmTable> GetAlarmTable()
|
|
{
|
|
List<AlarmTable> list = new List<AlarmTable>();
|
|
try
|
|
{
|
|
List<DataParameter> parameters = new List<DataParameter>();
|
|
string sql = "SELECT * FROM T_EQP_ALARMTABLE WHERE ALARM_STATE>'0' ORDER BY EQPT_CODE,ALARM_CODE";
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
list = session.GetList<AlarmTable>(sql, parameters.ToArray()).ToList();
|
|
}
|
|
return list;
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogManager.LogHelper.Error(new LogInfo()
|
|
{
|
|
ErrorInfo = ex,
|
|
Tag = ex.StackTrace,
|
|
Info = "数据层-获取报警列表"
|
|
});
|
|
throw;
|
|
}
|
|
}
|
|
|
|
public int SaveAlarm(AlarmEntity alarm)
|
|
{
|
|
try
|
|
{
|
|
|
|
|
|
using (IDataSession session = AppDataFactory.CreateMainSession())
|
|
{
|
|
//插入基本信息
|
|
return session.Insert<AlarmEntity>(alarm);
|
|
};
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
LogManager.LogHelper.Error(new LogInfo()
|
|
{
|
|
ErrorInfo = ex,
|
|
Tag = ex.StackTrace,
|
|
Info = "数据层-保存报警信息"
|
|
});
|
|
throw;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|