using System.Collections.Generic; using System.Linq; using System.Web.UI.WebControls; namespace BLL { public class CQMS_ConstructionTestService { /// /// 获取施工试验信息 /// /// /// public static Model.Material_ConstructionTest GetConstructionTestByConstructionTestId(string ConstructionTestId) { return Funs.DB.Material_ConstructionTest.FirstOrDefault(e => e.ConstructionTestId == ConstructionTestId); } /// /// 添加施工试验信息 /// /// public static void AddConstructionTest(Model.Material_ConstructionTest ConstructionTest) { Model.SGGLDB db = Funs.DB; Model.Material_ConstructionTest newConstructionTest = new Model.Material_ConstructionTest(); newConstructionTest.ConstructionTestId = ConstructionTest.ConstructionTestId; newConstructionTest.ProjectId = ConstructionTest.ProjectId; newConstructionTest.UnitId = ConstructionTest.UnitId; newConstructionTest.ConstructionTestName = ConstructionTest.ConstructionTestName; newConstructionTest.ConstructionTestTypeId = ConstructionTest.ConstructionTestTypeId; newConstructionTest.SpotCheckRate = ConstructionTest.SpotCheckRate; newConstructionTest.SpotCheckNum = ConstructionTest.SpotCheckNum; newConstructionTest.Witness = ConstructionTest.Witness; newConstructionTest.CheckResult = ConstructionTest.CheckResult; newConstructionTest.CheckUnit = ConstructionTest.CheckUnit; newConstructionTest.CompileMan = ConstructionTest.CompileMan; newConstructionTest.CompileDate = ConstructionTest.CompileDate; db.Material_ConstructionTest.InsertOnSubmit(newConstructionTest); db.SubmitChanges(); } /// /// 修改施工试验信息 /// /// public static void UpdateConstructionTest(Model.Material_ConstructionTest ConstructionTest) { Model.SGGLDB db = Funs.DB; Model.Material_ConstructionTest newConstructionTest = db.Material_ConstructionTest.FirstOrDefault(e => e.ConstructionTestId == ConstructionTest.ConstructionTestId); if (newConstructionTest != null) { newConstructionTest.UnitId = ConstructionTest.UnitId; newConstructionTest.ConstructionTestName = ConstructionTest.ConstructionTestName; newConstructionTest.ConstructionTestTypeId = ConstructionTest.ConstructionTestTypeId; newConstructionTest.SpotCheckRate = ConstructionTest.SpotCheckRate; newConstructionTest.SpotCheckNum = ConstructionTest.SpotCheckNum; newConstructionTest.Witness = ConstructionTest.Witness; newConstructionTest.CheckResult = ConstructionTest.CheckResult; newConstructionTest.CheckUnit = ConstructionTest.CheckUnit; newConstructionTest.CompileMan = ConstructionTest.CompileMan; newConstructionTest.CompileDate = ConstructionTest.CompileDate; db.SubmitChanges(); } } /// /// 根据主键删除施工试验信息 /// /// public static void DeleteConstructionTestById(string ConstructionTestId) { Model.SGGLDB db = Funs.DB; Model.Material_ConstructionTest ConstructionTest = db.Material_ConstructionTest.FirstOrDefault(e => e.ConstructionTestId == ConstructionTestId); if (ConstructionTest != null) { db.Material_ConstructionTest.DeleteOnSubmit(ConstructionTest); db.SubmitChanges(); } } } }