36 lines
992 B
C#
36 lines
992 B
C#
using System;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Text.RegularExpressions;
|
|
using ToolLibrary.LogHelper;
|
|
using YunDa.SOMS.DataTransferObject.GeneralInformation.ProtectionDeviceInfoDto;
|
|
using YunDa.SOMS.ProDB;
|
|
using YunDa.SOMS.ProDB.Models;
|
|
|
|
namespace Yunda.SOMS.DataMonitoringServer.SQLiteData
|
|
{
|
|
public class ProtdbHandle
|
|
{
|
|
public TbEventZj GetTbEventZj(string sqlPath,int code)
|
|
{
|
|
var fileName = Path.GetFileName(sqlPath);
|
|
try
|
|
{
|
|
using (var context = new ProtdbContext(sqlPath))
|
|
{
|
|
// 查询数据
|
|
var tbEventZj = context.TbEventZjs.FirstOrDefault(t=>t.SelfCheckCode == code);
|
|
return tbEventZj;
|
|
|
|
}
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
Log4Helper.Error(this.GetType(), "获取装置参数时发生错误", ex);
|
|
}
|
|
return default;
|
|
}
|
|
|
|
}
|
|
}
|