89 lines
4.5 KiB
C#
89 lines
4.5 KiB
C#
using Model;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BLL
|
|
{
|
|
/// <summary>
|
|
/// 管道静电接地测试记录
|
|
/// </summary>
|
|
public class ElectrostaticGroundingService
|
|
{
|
|
/// <summary>
|
|
/// 根据主键获取管道静电接地测试记录
|
|
/// </summary>
|
|
/// <param name="electrostaticGroundingId"></param>
|
|
/// <returns></returns>
|
|
public static Model.JGZL_ElectrostaticGrounding GetElectrostaticGroundingById(string electrostaticGroundingId)
|
|
{
|
|
return Funs.DB.JGZL_ElectrostaticGrounding.FirstOrDefault(e => e.ElectrostaticGroundingId == electrostaticGroundingId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加
|
|
/// </summary>
|
|
/// <param name="electrostaticGrounding"></param>
|
|
public static void AddElectrostaticGrounding(Model.JGZL_ElectrostaticGrounding electrostaticGrounding)
|
|
{
|
|
SGGLDB db = Funs.DB;
|
|
Model.JGZL_ElectrostaticGrounding newElectrostaticGrounding = new JGZL_ElectrostaticGrounding();
|
|
newElectrostaticGrounding.ElectrostaticGroundingId = electrostaticGrounding.ElectrostaticGroundingId;
|
|
newElectrostaticGrounding.ProjectId = electrostaticGrounding.ProjectId;
|
|
newElectrostaticGrounding.PipelineCode = electrostaticGrounding.PipelineCode;
|
|
newElectrostaticGrounding.ConnectionType = electrostaticGrounding.ConnectionType;
|
|
newElectrostaticGrounding.BWSpecification = electrostaticGrounding.BWSpecification;
|
|
newElectrostaticGrounding.BWMaterial = electrostaticGrounding.BWMaterial;
|
|
newElectrostaticGrounding.BWResistance = electrostaticGrounding.BWResistance;
|
|
newElectrostaticGrounding.GWSpecification = electrostaticGrounding.GWSpecification;
|
|
newElectrostaticGrounding.GWMaterial = electrostaticGrounding.GWMaterial;
|
|
newElectrostaticGrounding.GWResistance = electrostaticGrounding.GWResistance;
|
|
newElectrostaticGrounding.CompileMan = electrostaticGrounding.CompileMan;
|
|
newElectrostaticGrounding.CompileDate = electrostaticGrounding.CompileDate;
|
|
db.JGZL_ElectrostaticGrounding.InsertOnSubmit(newElectrostaticGrounding);
|
|
db.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改
|
|
/// </summary>
|
|
/// <param name="electrostaticGrounding"></param>
|
|
public static void UpdateElectrostaticGrounding(Model.JGZL_ElectrostaticGrounding electrostaticGrounding)
|
|
{
|
|
SGGLDB db = Funs.DB;
|
|
Model.JGZL_ElectrostaticGrounding newElectrostaticGrounding = db.JGZL_ElectrostaticGrounding.FirstOrDefault(e => e.ElectrostaticGroundingId == electrostaticGrounding.ElectrostaticGroundingId);
|
|
if (newElectrostaticGrounding != null)
|
|
{
|
|
newElectrostaticGrounding.PipelineCode = electrostaticGrounding.PipelineCode;
|
|
newElectrostaticGrounding.ConnectionType = electrostaticGrounding.ConnectionType;
|
|
newElectrostaticGrounding.BWSpecification = electrostaticGrounding.BWSpecification;
|
|
newElectrostaticGrounding.BWMaterial = electrostaticGrounding.BWMaterial;
|
|
newElectrostaticGrounding.BWResistance = electrostaticGrounding.BWResistance;
|
|
newElectrostaticGrounding.GWSpecification = electrostaticGrounding.GWSpecification;
|
|
newElectrostaticGrounding.GWMaterial = electrostaticGrounding.GWMaterial;
|
|
newElectrostaticGrounding.GWResistance = electrostaticGrounding.GWResistance;
|
|
newElectrostaticGrounding.CompileMan = electrostaticGrounding.CompileMan;
|
|
newElectrostaticGrounding.CompileDate = electrostaticGrounding.CompileDate;
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据主键删除管道静电接地测试记录
|
|
/// </summary>
|
|
/// <param name="electrostaticGroundingId"></param>
|
|
public static void DeleteElectrostaticGroundingById(string electrostaticGroundingId)
|
|
{
|
|
SGGLDB db = Funs.DB;
|
|
Model.JGZL_ElectrostaticGrounding electrostaticGrounding = db.JGZL_ElectrostaticGrounding.FirstOrDefault(e => e.ElectrostaticGroundingId == electrostaticGroundingId);
|
|
if (electrostaticGrounding != null)
|
|
{
|
|
db.JGZL_ElectrostaticGrounding.DeleteOnSubmit(electrostaticGrounding);
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
}
|
|
}
|