首次提交:添加src文件夹代码
This commit is contained in:
46
src/StandardDomeNewApp/BLL/ControlPLCAddress.cs
Normal file
46
src/StandardDomeNewApp/BLL/ControlPLCAddress.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace StandardDomeNewApp.BLL
|
||||
{
|
||||
[NotMapped]
|
||||
public class ControlPLCAddress:Model.TControlPlcAddress
|
||||
{
|
||||
public Model.TControlPlcAddress Query()
|
||||
{
|
||||
using (Model.SQLModel SQLModel = new Model.SQLModel())
|
||||
{
|
||||
Model.TControlPlcAddress controlPLC
|
||||
= new Model.TControlPlcAddress();
|
||||
controlPLC = SQLModel.TControlPlcAddress.Where(
|
||||
item => item.ControlName==ControlName).FirstOrDefault();
|
||||
return controlPLC;
|
||||
}
|
||||
}
|
||||
public bool Update()
|
||||
{
|
||||
using (Model.SQLModel SQLModel = new Model.SQLModel())
|
||||
{
|
||||
bool flag = false;
|
||||
var controlPLCInfo = SQLModel.TControlPlcAddress
|
||||
.Where(item => item.ControlName == ControlName).FirstOrDefault();
|
||||
controlPLCInfo.Description = Description;
|
||||
controlPLCInfo.PlcFilterKey = PlcFilterKey;
|
||||
controlPLCInfo.Address = Address;
|
||||
controlPLCInfo.Offset = Offset;
|
||||
controlPLCInfo.Multiplier = Multiplier;
|
||||
controlPLCInfo.OperationPara = OperationPara;
|
||||
controlPLCInfo.Uom = Uom;
|
||||
//cancelbywang2022-09-21 数据库没有这个字段
|
||||
//controlPLCInfo.RoomCode = RoomCode;
|
||||
SQLModel.SaveChanges();
|
||||
flag = true;
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user