|
|
|
@ -1,7 +1,4 @@
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using FreeSql.DataAnnotations;
|
|
|
|
|
using Mesnac.Action.ChemicalWeighing.FreeDb;
|
|
|
|
|
using FreeSql.DataAnnotations;
|
|
|
|
|
|
|
|
|
|
namespace Mesnac.Action.ChemicalWeighing.AutoControl.DB
|
|
|
|
|
{
|
|
|
|
@ -28,33 +25,7 @@ namespace Mesnac.Action.ChemicalWeighing.AutoControl.DB
|
|
|
|
|
|
|
|
|
|
public int Type { get; set; }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class DeviceMaterrialService
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void Save(List<DeviceMaterrial> materrials)
|
|
|
|
|
{
|
|
|
|
|
var deviceMaterrial = materrials.First();
|
|
|
|
|
|
|
|
|
|
FreeSqlUnit.Instance.Delete<DeviceMaterrial>()
|
|
|
|
|
.Where(x => x.Type == deviceMaterrial.Type && x.DeviceId == deviceMaterrial.DeviceId)
|
|
|
|
|
.ExecuteDeleted();
|
|
|
|
|
|
|
|
|
|
FreeSqlUnit.Instance.Insert(materrials).ExecuteAffrows();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static List<DeviceMaterrial> GetByTypeId(int type, int deviceId)
|
|
|
|
|
{
|
|
|
|
|
return FreeSqlUnit.Instance.Select<DeviceMaterrial>()
|
|
|
|
|
.Where(x => x.Type == type && x.DeviceId == deviceId)
|
|
|
|
|
.ToList();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int Code { get; set; }
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|