using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Web.UI.WebControls; namespace BLL { /// /// 项目级施工日志明细 /// public static class CQMSConstructionLogItemService { public static Model.SGGLDB db = Funs.DB; /// /// 根据主键获取项目级施工日志 /// /// /// public static Model.CQMS_ConstructionLogItem GetConstructionLogItemByConstructionLogIdAndUnitId(string ConstructionLogId, string unitId) { return Funs.DB.CQMS_ConstructionLogItem.FirstOrDefault(e => e.ConstructionLogId == ConstructionLogId && e.UnitId == unitId); } /// /// 添加项目级施工日志 /// /// public static void AddConstructionLogItem(Model.CQMS_ConstructionLogItem ConstructionLogItem) { Model.SGGLDB db = Funs.DB; Model.CQMS_ConstructionLogItem newConstructionLogItem = new Model.CQMS_ConstructionLogItem { ConstructionLogItemId = ConstructionLogItem.ConstructionLogItemId, ConstructionLogId = ConstructionLogItem.ConstructionLogId, UnitId = ConstructionLogItem.UnitId, ConstructionManager = ConstructionLogItem.ConstructionManager, SafetyGuardian = ConstructionLogItem.SafetyGuardian, ConstructionWorker = ConstructionLogItem.ConstructionWorker, MechanicNum = ConstructionLogItem.MechanicNum, MechanicNum1 = ConstructionLogItem.MechanicNum1, MechanicNum2 = ConstructionLogItem.MechanicNum2, MechanicNum3 = ConstructionLogItem.MechanicNum3, MechanicNum4 = ConstructionLogItem.MechanicNum4, MechanicNum5 = ConstructionLogItem.MechanicNum5, MechanicNum6 = ConstructionLogItem.MechanicNum6, MechanicNum7 = ConstructionLogItem.MechanicNum7, MechanicNum8 = ConstructionLogItem.MechanicNum8, MechanicNum9 = ConstructionLogItem.MechanicNum9, MechanicNum10 = ConstructionLogItem.MechanicNum10, MechanicNum11 = ConstructionLogItem.MechanicNum11, MechanicNum12 = ConstructionLogItem.MechanicNum12, MechanicNum13 = ConstructionLogItem.MechanicNum13, MechanicNum14 = ConstructionLogItem.MechanicNum14, MechanicNum15 = ConstructionLogItem.MechanicNum15, MechanicNum16 = ConstructionLogItem.MechanicNum16, MechanicNum17 = ConstructionLogItem.MechanicNum17, LabourNum = ConstructionLogItem.LabourNum, MainConstructionMachine = ConstructionLogItem.MainConstructionMachine, ConstructionContent = ConstructionLogItem.ConstructionContent, ConstructionEnvironment = ConstructionLogItem.ConstructionEnvironment, SafetyWorkSituation = ConstructionLogItem.SafetyWorkSituation, SafetyAndQualityMeasures = ConstructionLogItem.SafetyAndQualityMeasures, HabituaViolations = ConstructionLogItem.HabituaViolations, SafetyStandardization = ConstructionLogItem.SafetyStandardization, CivilizedConstruction = ConstructionLogItem.CivilizedConstruction, Equipment1 = ConstructionLogItem.Equipment1, Equipment2 = ConstructionLogItem.Equipment2, Equipment3 = ConstructionLogItem.Equipment3, Equipment4 = ConstructionLogItem.Equipment4, Equipment5 = ConstructionLogItem.Equipment5, Equipment6 = ConstructionLogItem.Equipment6, Equipment7 = ConstructionLogItem.Equipment7, ProcessHandover = ConstructionLogItem.ProcessHandover, WorkArrangement = ConstructionLogItem.WorkArrangement, MeetingSituation = ConstructionLogItem.MeetingSituation, VisaRecords = ConstructionLogItem.VisaRecords, UnresolvedIssues = ConstructionLogItem.UnresolvedIssues, FileProcessing = ConstructionLogItem.FileProcessing, RectificationOfIssues = ConstructionLogItem.RectificationOfIssues, ImportantEvents = ConstructionLogItem.ImportantEvents, ProblemAndCauseAnalysis = ConstructionLogItem.ProblemAndCauseAnalysis, }; db.CQMS_ConstructionLogItem.InsertOnSubmit(newConstructionLogItem); db.SubmitChanges(); } /// /// 修改项目级施工日志 /// /// public static void UpdateConstructionLogItem(Model.CQMS_ConstructionLogItem ConstructionLogItem) { Model.SGGLDB db = Funs.DB; Model.CQMS_ConstructionLogItem newConstructionLogItem = db.CQMS_ConstructionLogItem.FirstOrDefault(e => e.ConstructionLogId == ConstructionLogItem.ConstructionLogId && e.UnitId == ConstructionLogItem.UnitId); if (newConstructionLogItem != null) { newConstructionLogItem.ConstructionManager = ConstructionLogItem.ConstructionManager; newConstructionLogItem.SafetyGuardian = ConstructionLogItem.SafetyGuardian; newConstructionLogItem.ConstructionWorker = ConstructionLogItem.ConstructionWorker; newConstructionLogItem.MechanicNum = ConstructionLogItem.MechanicNum; newConstructionLogItem.MechanicNum1 = ConstructionLogItem.MechanicNum1; newConstructionLogItem.MechanicNum2 = ConstructionLogItem.MechanicNum2; newConstructionLogItem.MechanicNum3 = ConstructionLogItem.MechanicNum3; newConstructionLogItem.MechanicNum4 = ConstructionLogItem.MechanicNum4; newConstructionLogItem.MechanicNum5 = ConstructionLogItem.MechanicNum5; newConstructionLogItem.MechanicNum6 = ConstructionLogItem.MechanicNum6; newConstructionLogItem.MechanicNum7 = ConstructionLogItem.MechanicNum7; newConstructionLogItem.MechanicNum8 = ConstructionLogItem.MechanicNum8; newConstructionLogItem.MechanicNum9 = ConstructionLogItem.MechanicNum9; newConstructionLogItem.MechanicNum10 = ConstructionLogItem.MechanicNum10; newConstructionLogItem.MechanicNum11 = ConstructionLogItem.MechanicNum11; newConstructionLogItem.MechanicNum12 = ConstructionLogItem.MechanicNum12; newConstructionLogItem.MechanicNum13 = ConstructionLogItem.MechanicNum13; newConstructionLogItem.MechanicNum14 = ConstructionLogItem.MechanicNum14; newConstructionLogItem.MechanicNum15 = ConstructionLogItem.MechanicNum15; newConstructionLogItem.MechanicNum16 = ConstructionLogItem.MechanicNum16; newConstructionLogItem.MechanicNum17 = ConstructionLogItem.MechanicNum17; newConstructionLogItem.LabourNum = ConstructionLogItem.LabourNum; newConstructionLogItem.MainConstructionMachine = ConstructionLogItem.MainConstructionMachine; newConstructionLogItem.ConstructionContent = ConstructionLogItem.ConstructionContent; newConstructionLogItem.ConstructionEnvironment = ConstructionLogItem.ConstructionEnvironment; newConstructionLogItem.SafetyWorkSituation = ConstructionLogItem.SafetyWorkSituation; newConstructionLogItem.SafetyAndQualityMeasures = ConstructionLogItem.SafetyAndQualityMeasures; newConstructionLogItem.HabituaViolations = ConstructionLogItem.HabituaViolations; newConstructionLogItem.SafetyStandardization = ConstructionLogItem.SafetyStandardization; newConstructionLogItem.CivilizedConstruction = ConstructionLogItem.CivilizedConstruction; newConstructionLogItem.Equipment1 = ConstructionLogItem.Equipment1; newConstructionLogItem.Equipment2 = ConstructionLogItem.Equipment2; newConstructionLogItem.Equipment3 = ConstructionLogItem.Equipment3; newConstructionLogItem.Equipment4 = ConstructionLogItem.Equipment4; newConstructionLogItem.Equipment5 = ConstructionLogItem.Equipment5; newConstructionLogItem.Equipment6 = ConstructionLogItem.Equipment6; newConstructionLogItem.Equipment7 = ConstructionLogItem.Equipment7; newConstructionLogItem.ProcessHandover = ConstructionLogItem.ProcessHandover; newConstructionLogItem.WorkArrangement = ConstructionLogItem.WorkArrangement; newConstructionLogItem.MeetingSituation = ConstructionLogItem.MeetingSituation; newConstructionLogItem.VisaRecords = ConstructionLogItem.VisaRecords; newConstructionLogItem.UnresolvedIssues = ConstructionLogItem.UnresolvedIssues; newConstructionLogItem.FileProcessing = ConstructionLogItem.FileProcessing; newConstructionLogItem.RectificationOfIssues = ConstructionLogItem.RectificationOfIssues; newConstructionLogItem.ImportantEvents = ConstructionLogItem.ImportantEvents; newConstructionLogItem.ProblemAndCauseAnalysis = ConstructionLogItem.ProblemAndCauseAnalysis; db.SubmitChanges(); } } /// /// 根据主键删除项目级施工日志 /// /// public static void DeleteConstructionLogItemById(string ConstructionLogItemId) { Model.SGGLDB db = Funs.DB; var q = from x in db.CQMS_ConstructionLogItem where x.ConstructionLogItemId == ConstructionLogItemId select x; if (q.Count() > 0) { db.CQMS_ConstructionLogItem.DeleteAllOnSubmit(q); db.SubmitChanges(); } } } }