using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BLL { /// /// 其他巡检记录管理 /// public static class TestRunOthersCheckService { /// /// 根据主键获取其他巡检记录管理 /// /// /// public static Model.ProduceTestRun_TestRunOthersCheck GetTestRunOthersCheckById(string testRunOthersCheckId) { return Funs.DB.ProduceTestRun_TestRunOthersCheck.FirstOrDefault(e => e.TestRunOthersCheckId == testRunOthersCheckId); } /// /// 添加其他巡检记录管理 /// /// public static void AddTestRunOthersCheck(Model.ProduceTestRun_TestRunOthersCheck testRunOthersCheck) { Model.ProduceTestRun_TestRunOthersCheck newTestRunOthersCheck = new Model.ProduceTestRun_TestRunOthersCheck(); newTestRunOthersCheck.TestRunOthersCheckId = testRunOthersCheck.TestRunOthersCheckId; newTestRunOthersCheck.ProjectId = testRunOthersCheck.ProjectId; newTestRunOthersCheck.UnitWorkId = testRunOthersCheck.UnitWorkId; newTestRunOthersCheck.UnitHead = testRunOthersCheck.UnitHead; newTestRunOthersCheck.CheckRecord = testRunOthersCheck.CheckRecord; newTestRunOthersCheck.TestRunOthersCheckCode = testRunOthersCheck.TestRunOthersCheckCode; newTestRunOthersCheck.CheckMan = testRunOthersCheck.CheckMan; newTestRunOthersCheck.Major = testRunOthersCheck.Major; newTestRunOthersCheck.StartDate = testRunOthersCheck.StartDate; newTestRunOthersCheck.EndDate = testRunOthersCheck.EndDate; newTestRunOthersCheck.Description = testRunOthersCheck.Description; newTestRunOthersCheck.ProblemsAndSolutions = testRunOthersCheck.ProblemsAndSolutions; newTestRunOthersCheck.AttachUrl = testRunOthersCheck.AttachUrl; newTestRunOthersCheck.Remark = testRunOthersCheck.Remark; Funs.DB.ProduceTestRun_TestRunOthersCheck.InsertOnSubmit(newTestRunOthersCheck); Funs.DB.SubmitChanges(); } /// /// 修改其他巡检记录管理 /// /// public static void UpdateTestRunOthersCheck(Model.ProduceTestRun_TestRunOthersCheck testRunOthersCheck) { Model.ProduceTestRun_TestRunOthersCheck newTestRunOthersCheck = Funs.DB.ProduceTestRun_TestRunOthersCheck.FirstOrDefault(e => e.TestRunOthersCheckId == testRunOthersCheck.TestRunOthersCheckId); if (newTestRunOthersCheck != null) { newTestRunOthersCheck.ProjectId = testRunOthersCheck.ProjectId; newTestRunOthersCheck.UnitWorkId = testRunOthersCheck.UnitWorkId; newTestRunOthersCheck.UnitHead = testRunOthersCheck.UnitHead; newTestRunOthersCheck.CheckRecord = testRunOthersCheck.CheckRecord; newTestRunOthersCheck.TestRunOthersCheckCode = testRunOthersCheck.TestRunOthersCheckCode; newTestRunOthersCheck.CheckMan = testRunOthersCheck.CheckMan; newTestRunOthersCheck.Major = testRunOthersCheck.Major; newTestRunOthersCheck.StartDate = testRunOthersCheck.StartDate; newTestRunOthersCheck.EndDate = testRunOthersCheck.EndDate; newTestRunOthersCheck.Description = testRunOthersCheck.Description; newTestRunOthersCheck.ProblemsAndSolutions = testRunOthersCheck.ProblemsAndSolutions; newTestRunOthersCheck.AttachUrl = testRunOthersCheck.AttachUrl; newTestRunOthersCheck.Remark = testRunOthersCheck.Remark; Funs.DB.SubmitChanges(); } } /// /// 根据主键删除其他巡检记录管理 /// /// public static void DeleteTestRunOthersCheckById(string testRunOthersCheckId) { Model.ProduceTestRun_TestRunOthersCheck newTestRunOthersCheck = Funs.DB.ProduceTestRun_TestRunOthersCheck.FirstOrDefault(e => e.TestRunOthersCheckId == testRunOthersCheckId); if (newTestRunOthersCheck != null) { if (!string.IsNullOrEmpty(newTestRunOthersCheck.AttachUrl)) { UploadAttachmentService.DeleteFile(Funs.RootPath, newTestRunOthersCheck.AttachUrl); } Funs.DB.ProduceTestRun_TestRunOthersCheck.DeleteOnSubmit(newTestRunOthersCheck); Funs.DB.SubmitChanges(); } } } }