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.

61 lines
2.0 KiB

using Module.Common;
using Module.DB.DBUtility;
using Module.DB.Model.DBEapModel;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Module.DB.SQLServerDAL
{
/// <summary>
/// 获取状态变量参数信息
/// </summary>
public class SEapStatusParamInfo
{
/// <summary>
/// 查询状态变量参数消息
/// </summary>
/// <returns>状态变量参数消息列表</returns>
public static List<EapStatusParam> GetStatusInfoList()
{
try
{
var list = new List<EapStatusParam>();
string countSql = "SELECT * FROM t_eap_status_param" + " ";
countSql += "ORDER BY f_sn asc";
SQLServerHelper sHelper = new SQLServerHelper();
DataTable dtResult = sHelper.QuerySql(countSql);
int rownum = dtResult.Rows.Count;
if (rownum > 0)
{
for (var i = 0; i < rownum; i++)
{
var alarmInfo = new EapStatusParam();
var temp = dtResult.Rows[i];
object objID = temp["f_sn"];
alarmInfo.f_sn = (objID == null || objID.ToString().Trim() == "") ? 0 : Convert.ToInt32(objID);
object objSvid = temp["f_svid"];
alarmInfo.f_svid = (objSvid == null || objSvid.ToString().Trim() == "") ? 0 : Convert.ToUInt32(objSvid);
alarmInfo.f_svname = temp["f_svname"].ToString();
alarmInfo.f_unit = temp["f_unit"].ToString();
list.Add(alarmInfo);
}
}
return list;
}
catch (Exception ex)
{
ex.ToString();
return null;
}
}
}
}