StockMaterrialDbHelp 改成静态

wangsr
nodyang 1 year ago
parent 15497c35fe
commit bb594c19b0

@ -35,7 +35,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl.DB
{ {
public void Save(List<DeviceMaterrial> materrials) public static void Save(List<DeviceMaterrial> materrials)
{ {
var deviceMaterrial = materrials.First(); var deviceMaterrial = materrials.First();
@ -47,7 +47,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl.DB
} }
public List<DeviceMaterrial> GetByTypeId(int type, int deviceId) public static List<DeviceMaterrial> GetByTypeId(int type, int deviceId)
{ {
return FreeSqlUnit.Instance.Select<DeviceMaterrial>() return FreeSqlUnit.Instance.Select<DeviceMaterrial>()
.Where(x => x.Type == type && x.DeviceId == deviceId) .Where(x => x.Type == type && x.DeviceId == deviceId)

@ -15,7 +15,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl.DB
/// 获取干混机物料 /// 获取干混机物料
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public List<MyNameValue> GetDryerMaterrial() public static List<MyNameValue> GetDryerMaterrial()
{ {
var list = GetStockMaterrial(1); var list = GetStockMaterrial(1);
list.RemoveAll(x => x.Id == 5); list.RemoveAll(x => x.Id == 5);
@ -27,7 +27,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl.DB
/// 获取糊化机物料 /// 获取糊化机物料
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public List<MyNameValue> GetSiloMaterrial() public static List<MyNameValue> GetSiloMaterrial()
{ {
var list1 = GetStockMaterrial(1); var list1 = GetStockMaterrial(1);
list1 = list1.Where(x => x.Id == 5 || x.Id == 6).ToList(); list1 = list1.Where(x => x.Id == 5 || x.Id == 6).ToList();
@ -40,7 +40,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl.DB
/// <param name="id"></param> /// <param name="id"></param>
/// <returns></returns> /// <returns></returns>
public int GetCodeById(int id) public static int GetCodeById(int id)
{ {
string sql = $"select Code from lj_stock_material where Id={id}"; string sql = $"select Code from lj_stock_material where Id={id}";
var dataTable = DBHelp.GetTable(sql); var dataTable = DBHelp.GetTable(sql);
@ -50,7 +50,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl.DB
private List<MyNameValue> GetStockMaterrial(int mtypId) private static List<MyNameValue> GetStockMaterrial(int mtypId)
{ {
string sql = "select Id, Code, StockName, MTypeId, MTypeName, MId, MName, Remark from lj_stock_material"; string sql = "select Id, Code, StockName, MTypeId, MTypeName, MId, MName, Remark from lj_stock_material";

Loading…
Cancel
Save