47 lines
1.1 KiB
C#
47 lines
1.1 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using WCS.Business.Dto;
|
|||
|
|
|
|||
|
|
namespace WCS.Business.Dao
|
|||
|
|
{
|
|||
|
|
public class PlcDao
|
|||
|
|
{
|
|||
|
|
public PlcDao() { }
|
|||
|
|
|
|||
|
|
private static PlcDao _instance;
|
|||
|
|
|
|||
|
|
public static PlcDao Instance()
|
|||
|
|
{
|
|||
|
|
if (_instance == null)
|
|||
|
|
{
|
|||
|
|
_instance = new PlcDao();
|
|||
|
|
}
|
|||
|
|
return _instance;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
/// <summary>
|
|||
|
|
/// 获取PLC信息
|
|||
|
|
/// </summary>
|
|||
|
|
/// <returns></returns>
|
|||
|
|
public List<PlcDto> GetLotInfo()
|
|||
|
|
{
|
|||
|
|
try
|
|||
|
|
{
|
|||
|
|
List<PlcDto> plcs = DataCommon.DBServer.Queryable<PlcDto>().ToList();
|
|||
|
|
return plcs;
|
|||
|
|
|
|||
|
|
//第二种 SQL语句的方式
|
|||
|
|
//string sql = $"select * FROM t_plc ";
|
|||
|
|
//var sqlFunc = DataCommon.DBServer.SqlQueryable<PlcDto>(sql);
|
|||
|
|
//return sqlFunc.ToList();
|
|||
|
|
}
|
|||
|
|
catch (Exception ex)
|
|||
|
|
{
|
|||
|
|
_ = ex;
|
|||
|
|
return new List<PlcDto>();
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
}
|