61 lines
2.1 KiB
C#
61 lines
2.1 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 PressureTestPackageListService
|
|
{
|
|
/// <summary>
|
|
/// 根据项目Id获取一览表信息
|
|
/// </summary>
|
|
/// <param name="projectId"></param>
|
|
/// <returns></returns>
|
|
public static List<Model.SYBData_PressureTestPackageList> GetListsByProjectId(string projectId)
|
|
{
|
|
return (from x in Funs.DB.SYBData_PressureTestPackageList where x.ProjectId == projectId select x).ToList();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加试压包一览表
|
|
/// </summary>
|
|
/// <param name="list"></param>
|
|
public static void AddLists(Model.SYBData_PressureTestPackageList list)
|
|
{
|
|
SGGLDB db = Funs.DB;
|
|
Model.SYBData_PressureTestPackageList newLists = new SYBData_PressureTestPackageList();
|
|
newLists.PressureTestPackageListId = list.PressureTestPackageListId;
|
|
newLists.ProjectId = list.ProjectId;
|
|
newLists.SerialNumber = list.SerialNumber;
|
|
newLists.PipelineCode = list.PipelineCode;
|
|
newLists.PressureTestPackageCode = list.PressureTestPackageCode;
|
|
newLists.Remark = list.Remark;
|
|
newLists.CompileMan = list.CompileMan;
|
|
newLists.CompileDate = list.CompileDate;
|
|
db.SYBData_PressureTestPackageList.InsertOnSubmit(newLists);
|
|
db.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据项目Id删除一览表信息
|
|
/// </summary>
|
|
/// <param name="projectId"></param>
|
|
public static void DeleteListsByProjectId(string projectId)
|
|
{
|
|
SGGLDB db = Funs.DB;
|
|
var list = (from x in db.SYBData_PressureTestPackageList where x.ProjectId == projectId select x).ToList();
|
|
if (list.Count > 0)
|
|
{
|
|
db.SYBData_PressureTestPackageList.DeleteAllOnSubmit(list);
|
|
db.SubmitChanges();
|
|
}
|
|
}
|
|
}
|
|
}
|