diff --git a/SGGL/BLL/BaseInfo/AccidentTypeService.cs b/SGGL/BLL/BaseInfo/AccidentTypeService.cs index 631793d1..e48c9f7b 100644 --- a/SGGL/BLL/BaseInfo/AccidentTypeService.cs +++ b/SGGL/BLL/BaseInfo/AccidentTypeService.cs @@ -8,8 +8,6 @@ namespace BLL /// public static class AccidentTypeService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据主键获取事故类型 /// diff --git a/SGGL/BLL/BaseInfo/BaseCompanytemplateService.cs b/SGGL/BLL/BaseInfo/BaseCompanytemplateService.cs index 6d1a6d20..9841501c 100644 --- a/SGGL/BLL/BaseInfo/BaseCompanytemplateService.cs +++ b/SGGL/BLL/BaseInfo/BaseCompanytemplateService.cs @@ -11,10 +11,7 @@ namespace BLL public static class Base_CompanytemplateService { - public static Model.SGGLDB db = Funs.DB; - - - #region 获取列表 + #region 获取列表 /// /// 记录数 /// @@ -25,7 +22,7 @@ namespace BLL } public static List GetBase_CompanyTemplateByModle(Model.Base_CompanyTemplate table) { - var q= from x in db.Base_CompanyTemplate + var q= from x in Funs.DB.Base_CompanyTemplate where ( string.IsNullOrEmpty(table.TemplateId)||x.TemplateId.Contains(table.TemplateId)) && ( string.IsNullOrEmpty(table.Code)||x.Code.Contains(table.Code)) && @@ -68,16 +65,16 @@ namespace BLL public static Model.Base_CompanyTemplate GetBase_CompanyTemplateById(string TemplateId) { - return db.Base_CompanyTemplate.FirstOrDefault(x=>x.TemplateId==TemplateId); + return Funs.DB.Base_CompanyTemplate.FirstOrDefault(x=>x.TemplateId==TemplateId); } public static Model.Base_CompanyTemplate GetBase_CompanyTemplateByCode(string Code) { - return db.Base_CompanyTemplate.FirstOrDefault(x => x.Code== Code); + return Funs.DB.Base_CompanyTemplate.FirstOrDefault(x => x.Code== Code); } public static bool IsExitCode(string Code) { bool result = false; - var q= (from x in db.Base_CompanyTemplate where x.Code ==Code select x ).FirstOrDefault(); + var q= (from x in Funs.DB.Base_CompanyTemplate where x.Code ==Code select x ).FirstOrDefault(); if (q!=null) { result = true; @@ -95,22 +92,22 @@ namespace BLL FilePath=newtable.FilePath, Remarks=newtable.Remarks, }; - db.Base_CompanyTemplate.InsertOnSubmit(table); - db.SubmitChanges(); + Funs.DB.Base_CompanyTemplate.InsertOnSubmit(table); + Funs.DB.SubmitChanges(); } public static void AddBulkBase_CompanyTemplate(List newtables) { - db.Base_CompanyTemplate.InsertAllOnSubmit(newtables); - db.SubmitChanges(); + Funs.DB.Base_CompanyTemplate.InsertAllOnSubmit(newtables); + Funs.DB.SubmitChanges(); } public static void UpdateBase_CompanyTemplate(Model.Base_CompanyTemplate newtable) { - Model.Base_CompanyTemplate table = db.Base_CompanyTemplate.FirstOrDefault(x=>x.TemplateId==newtable.TemplateId); + Model.Base_CompanyTemplate table = Funs.DB.Base_CompanyTemplate.FirstOrDefault(x=>x.TemplateId==newtable.TemplateId); if (table != null) { table.TemplateId=newtable.TemplateId; @@ -118,28 +115,28 @@ namespace BLL table.Name=newtable.Name; table.FilePath=newtable.FilePath; table.Remarks=newtable.Remarks; - db.SubmitChanges(); + Funs.DB.SubmitChanges(); } } public static void DeleteBase_CompanyTemplateById (string TemplateId) { - Model.Base_CompanyTemplate table =db.Base_CompanyTemplate.FirstOrDefault(x=>x.TemplateId==TemplateId); + Model.Base_CompanyTemplate table =Funs.DB.Base_CompanyTemplate.FirstOrDefault(x=>x.TemplateId==TemplateId); if (table != null) { - db.Base_CompanyTemplate.DeleteOnSubmit(table); - db.SubmitChanges(); + Funs.DB.Base_CompanyTemplate.DeleteOnSubmit(table); + Funs.DB.SubmitChanges(); } } public static void DeleteALLBase_CompanyTemplate () { - if( db.Base_CompanyTemplate !=null) + if( Funs.DB.Base_CompanyTemplate !=null) { - db.Base_CompanyTemplate.DeleteAllOnSubmit( db.Base_CompanyTemplate); - db.SubmitChanges(); + Funs.DB.Base_CompanyTemplate.DeleteAllOnSubmit( Funs.DB.Base_CompanyTemplate); + Funs.DB.SubmitChanges(); } } public static void InitBase_CompanyTemplateDownList(FineUIPro.DropDownList dropName, bool isShowPlease) diff --git a/SGGL/BLL/BaseInfo/BaseFactoryService.cs b/SGGL/BLL/BaseInfo/BaseFactoryService.cs index eaf7fe17..6cd2328b 100644 --- a/SGGL/BLL/BaseInfo/BaseFactoryService.cs +++ b/SGGL/BLL/BaseInfo/BaseFactoryService.cs @@ -11,9 +11,6 @@ namespace BLL public static class Base_FactoryService { - public static Model.SGGLDB db = Funs.DB; - - #region 获取列表 /// /// 记录数 @@ -25,7 +22,7 @@ namespace BLL } public static List GetBase_FactoryByModle(Model.Base_Factory table) { - var q = from x in db.Base_Factory + var q = from x in Funs.DB.Base_Factory where (string.IsNullOrEmpty(table.FactoryId) || x.FactoryId.Contains(table.FactoryId)) && (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) && @@ -39,7 +36,7 @@ namespace BLL } public static List GetBase_FactoryList() { - var q = (from x in db.Base_Factory orderby x.FactoryCode select x).ToList(); + var q = (from x in Funs.DB.Base_Factory orderby x.FactoryCode select x).ToList(); return q; @@ -74,14 +71,14 @@ namespace BLL public static Model.Base_Factory GetBase_FactoryById(string FactoryId) { - return db.Base_Factory.FirstOrDefault(x => x.FactoryId == FactoryId); + return Funs.DB.Base_Factory.FirstOrDefault(x => x.FactoryId == FactoryId); } public static string GetBase_FactoryNameById(object FactoryId) { string name = string.Empty; if (FactoryId!=null) { - var model = db.Base_Factory.FirstOrDefault(x => x.FactoryId == FactoryId.ToString()); + var model = Funs.DB.Base_Factory.FirstOrDefault(x => x.FactoryId == FactoryId.ToString()); if (model != null) { name = model.FactoryName; @@ -92,7 +89,7 @@ namespace BLL } public static Model.Base_Factory GetBase_FactoryByCode(string FactoryCode) { - return db.Base_Factory.FirstOrDefault(x => x.FactoryCode == FactoryCode); + return Funs.DB.Base_Factory.FirstOrDefault(x => x.FactoryCode == FactoryCode); } public static void AddBase_Factory(Model.Base_Factory newtable) { @@ -106,22 +103,22 @@ namespace BLL Address = newtable.Address, MapCoordinates= newtable.MapCoordinates, }; - db.Base_Factory.InsertOnSubmit(table); - db.SubmitChanges(); + Funs.DB.Base_Factory.InsertOnSubmit(table); + Funs.DB.SubmitChanges(); } public static void AddBulkBase_Factory(List newtables) { - db.Base_Factory.InsertAllOnSubmit(newtables); - db.SubmitChanges(); + Funs.DB.Base_Factory.InsertAllOnSubmit(newtables); + Funs.DB.SubmitChanges(); } public static void UpdateBase_Factory(Model.Base_Factory newtable) { - Model.Base_Factory table = db.Base_Factory.FirstOrDefault(x => x.FactoryId == newtable.FactoryId); + Model.Base_Factory table = Funs.DB.Base_Factory.FirstOrDefault(x => x.FactoryId == newtable.FactoryId); if (table != null) { table.FactoryId = newtable.FactoryId; @@ -130,28 +127,28 @@ namespace BLL table.FactoryName = newtable.FactoryName; table.Address = newtable.Address; table.MapCoordinates = newtable.MapCoordinates; - db.SubmitChanges(); + Funs.DB.SubmitChanges(); } } public static void DeleteBase_FactoryById(string FactoryId) { - Model.Base_Factory table = db.Base_Factory.FirstOrDefault(x => x.FactoryId == FactoryId); + Model.Base_Factory table = Funs.DB.Base_Factory.FirstOrDefault(x => x.FactoryId == FactoryId); if (table != null) { - db.Base_Factory.DeleteOnSubmit(table); - db.SubmitChanges(); + Funs.DB.Base_Factory.DeleteOnSubmit(table); + Funs.DB.SubmitChanges(); } } public static void DeleteALLBase_Factory() { - if (db.Base_Factory != null) + if (Funs.DB.Base_Factory != null) { - db.Base_Factory.DeleteAllOnSubmit(db.Base_Factory); - db.SubmitChanges(); + Funs.DB.Base_Factory.DeleteAllOnSubmit(Funs.DB.Base_Factory); + Funs.DB.SubmitChanges(); } } public static void InitBase_FactoryDownList(FineUIPro.DropDownList dropName, bool isShowPlease) diff --git a/SGGL/BLL/BaseInfo/CNProfessionalService.cs b/SGGL/BLL/BaseInfo/CNProfessionalService.cs index a086f03d..5ba77597 100644 --- a/SGGL/BLL/BaseInfo/CNProfessionalService.cs +++ b/SGGL/BLL/BaseInfo/CNProfessionalService.cs @@ -7,8 +7,6 @@ namespace BLL { public class CNProfessionalService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取实体集合 /// diff --git a/SGGL/BLL/BaseInfo/CQMSTrainObjectService.cs b/SGGL/BLL/BaseInfo/CQMSTrainObjectService.cs index 70a972d6..ab755b93 100644 --- a/SGGL/BLL/BaseInfo/CQMSTrainObjectService.cs +++ b/SGGL/BLL/BaseInfo/CQMSTrainObjectService.cs @@ -8,7 +8,6 @@ namespace BLL { public static class CQMSTrainObjectService { - public static Model.SGGLDB db = Funs.DB; /// /// 根据主键获取培训对象 diff --git a/SGGL/BLL/BaseInfo/CQMSTrainTypeService.cs b/SGGL/BLL/BaseInfo/CQMSTrainTypeService.cs index 947a41d6..bc0cedbb 100644 --- a/SGGL/BLL/BaseInfo/CQMSTrainTypeService.cs +++ b/SGGL/BLL/BaseInfo/CQMSTrainTypeService.cs @@ -8,7 +8,6 @@ namespace BLL /// public static class CQMSTrainTypeService { - public static Model.SGGLDB db = Funs.DB; /// /// 根据主键获取培训类型 diff --git a/SGGL/BLL/BaseInfo/CertificateService.cs b/SGGL/BLL/BaseInfo/CertificateService.cs index 9b2f6113..e7d28b52 100644 --- a/SGGL/BLL/BaseInfo/CertificateService.cs +++ b/SGGL/BLL/BaseInfo/CertificateService.cs @@ -8,8 +8,6 @@ namespace BLL /// public static class CertificateService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据主键获取特岗证书 /// diff --git a/SGGL/BLL/BaseInfo/CheckTemplateService.cs b/SGGL/BLL/BaseInfo/CheckTemplateService.cs index c499c867..9613a5b7 100644 --- a/SGGL/BLL/BaseInfo/CheckTemplateService.cs +++ b/SGGL/BLL/BaseInfo/CheckTemplateService.cs @@ -2,6 +2,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { @@ -10,8 +11,6 @@ namespace BLL /// public static class CheckTemplateService { - public static Model.SGGLDB db = Funs.DB; - #region 获取列表 /// /// 记录数 @@ -25,7 +24,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.ProjectSupervision_CheckTemplate + private static IQueryable getDataLists = from x in Funs.DB.ProjectSupervision_CheckTemplate select x; /// 获取分页列表 diff --git a/SGGL/BLL/BaseInfo/ConstructionTestTypeService.cs b/SGGL/BLL/BaseInfo/ConstructionTestTypeService.cs index 21ec2dba..1ec8ecb1 100644 --- a/SGGL/BLL/BaseInfo/ConstructionTestTypeService.cs +++ b/SGGL/BLL/BaseInfo/ConstructionTestTypeService.cs @@ -8,8 +8,6 @@ namespace BLL /// public static class ConstructionTestTypeService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据主键获取施工试验类型 /// diff --git a/SGGL/BLL/BaseInfo/CostTypeService.cs b/SGGL/BLL/BaseInfo/CostTypeService.cs index e68ae247..649e3ffe 100644 --- a/SGGL/BLL/BaseInfo/CostTypeService.cs +++ b/SGGL/BLL/BaseInfo/CostTypeService.cs @@ -8,8 +8,6 @@ namespace BLL /// public static class CostTypeService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据主键获取费用类型 /// diff --git a/SGGL/BLL/BaseInfo/DesignProfessionalService.cs b/SGGL/BLL/BaseInfo/DesignProfessionalService.cs index cc527fcf..88d661ca 100644 --- a/SGGL/BLL/BaseInfo/DesignProfessionalService.cs +++ b/SGGL/BLL/BaseInfo/DesignProfessionalService.cs @@ -7,7 +7,6 @@ namespace BLL { public class DesignProfessionalService { - public static Model.SGGLDB db = Funs.DB; /// /// 获取实体集合 diff --git a/SGGL/BLL/BaseInfo/EmergencyTypeService.cs b/SGGL/BLL/BaseInfo/EmergencyTypeService.cs index 04f36a99..b22de362 100644 --- a/SGGL/BLL/BaseInfo/EmergencyTypeService.cs +++ b/SGGL/BLL/BaseInfo/EmergencyTypeService.cs @@ -5,7 +5,6 @@ namespace BLL { public static class EmergencyTypeService { - public static Model.SGGLDB db = Funs.DB; /// /// 根据主键获取信息 diff --git a/SGGL/BLL/BaseInfo/HSSEStandardListTypeService.cs b/SGGL/BLL/BaseInfo/HSSEStandardListTypeService.cs index a5aef79d..8ea952a0 100644 --- a/SGGL/BLL/BaseInfo/HSSEStandardListTypeService.cs +++ b/SGGL/BLL/BaseInfo/HSSEStandardListTypeService.cs @@ -5,7 +5,6 @@ namespace BLL { public class HSSEStandardListTypeService { - public static Model.SGGLDB db = Funs.DB; /// /// 获取标准规范类别信息 diff --git a/SGGL/BLL/BaseInfo/LawsRegulationsTypeService.cs b/SGGL/BLL/BaseInfo/LawsRegulationsTypeService.cs index c1f5182b..7c6df67d 100644 --- a/SGGL/BLL/BaseInfo/LawsRegulationsTypeService.cs +++ b/SGGL/BLL/BaseInfo/LawsRegulationsTypeService.cs @@ -8,7 +8,6 @@ namespace BLL /// public static class LawsRegulationsTypeService { - public static Model.SGGLDB db = Funs.DB; /// /// 根据id获取法律法规类型信息 diff --git a/SGGL/BLL/BaseInfo/LicenseTypeService.cs b/SGGL/BLL/BaseInfo/LicenseTypeService.cs index 2ac06bbb..82b71dec 100644 --- a/SGGL/BLL/BaseInfo/LicenseTypeService.cs +++ b/SGGL/BLL/BaseInfo/LicenseTypeService.cs @@ -8,7 +8,6 @@ namespace BLL /// public static class LicenseTypeService { - public static Model.SGGLDB db = Funs.DB; /// /// 根据主键获取许可证类型 diff --git a/SGGL/BLL/BaseInfo/ManageRuleTypeService.cs b/SGGL/BLL/BaseInfo/ManageRuleTypeService.cs index 2b92249a..91fd0a91 100644 --- a/SGGL/BLL/BaseInfo/ManageRuleTypeService.cs +++ b/SGGL/BLL/BaseInfo/ManageRuleTypeService.cs @@ -8,7 +8,6 @@ namespace BLL /// public static class ManageRuleTypeService { - public static Model.SGGLDB db = Funs.DB; /// /// 根据主键获取管理规定分类 diff --git a/SGGL/BLL/BaseInfo/MaterialTypeService.cs b/SGGL/BLL/BaseInfo/MaterialTypeService.cs index adec3ad5..9ad2cb82 100644 --- a/SGGL/BLL/BaseInfo/MaterialTypeService.cs +++ b/SGGL/BLL/BaseInfo/MaterialTypeService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class MaterialTypeService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取材料类型 diff --git a/SGGL/BLL/BaseInfo/NoticeAndSupervisionTypeService.cs b/SGGL/BLL/BaseInfo/NoticeAndSupervisionTypeService.cs index 0e536810..4329bf73 100644 --- a/SGGL/BLL/BaseInfo/NoticeAndSupervisionTypeService.cs +++ b/SGGL/BLL/BaseInfo/NoticeAndSupervisionTypeService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class NoticeAndSupervisionTypeService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取告知和监检类型 diff --git a/SGGL/BLL/BaseInfo/PictureTypeService.cs b/SGGL/BLL/BaseInfo/PictureTypeService.cs index 799091d3..046800af 100644 --- a/SGGL/BLL/BaseInfo/PictureTypeService.cs +++ b/SGGL/BLL/BaseInfo/PictureTypeService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class PictureTypeService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取项目图片分类 diff --git a/SGGL/BLL/BaseInfo/PositionService.cs b/SGGL/BLL/BaseInfo/PositionService.cs index 52b670a5..da5833b6 100644 --- a/SGGL/BLL/BaseInfo/PositionService.cs +++ b/SGGL/BLL/BaseInfo/PositionService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class PositionService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取主键 diff --git a/SGGL/BLL/BaseInfo/PostTitleService.cs b/SGGL/BLL/BaseInfo/PostTitleService.cs index a512d888..1f829351 100644 --- a/SGGL/BLL/BaseInfo/PostTitleService.cs +++ b/SGGL/BLL/BaseInfo/PostTitleService.cs @@ -5,7 +5,7 @@ namespace BLL { public static class PostTitleService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取信息 diff --git a/SGGL/BLL/BaseInfo/PracticeCertificateService.cs b/SGGL/BLL/BaseInfo/PracticeCertificateService.cs index 2a05ed2b..c56c8397 100644 --- a/SGGL/BLL/BaseInfo/PracticeCertificateService.cs +++ b/SGGL/BLL/BaseInfo/PracticeCertificateService.cs @@ -5,7 +5,7 @@ namespace BLL { public static class PracticeCertificateService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取执业资格证书 diff --git a/SGGL/BLL/BaseInfo/ProjectTypeService.cs b/SGGL/BLL/BaseInfo/ProjectTypeService.cs index 992dd008..7d574b9e 100644 --- a/SGGL/BLL/BaseInfo/ProjectTypeService.cs +++ b/SGGL/BLL/BaseInfo/ProjectTypeService.cs @@ -8,7 +8,7 @@ namespace BLL public static class ProjectTypeService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取信息 diff --git a/SGGL/BLL/BaseInfo/PunishTypeService.cs b/SGGL/BLL/BaseInfo/PunishTypeService.cs index c42428c3..eafe9afb 100644 --- a/SGGL/BLL/BaseInfo/PunishTypeService.cs +++ b/SGGL/BLL/BaseInfo/PunishTypeService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class PunishTypeService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取处罚定义 diff --git a/SGGL/BLL/BaseInfo/QualityQuestionTypeService.cs b/SGGL/BLL/BaseInfo/QualityQuestionTypeService.cs index cbbbbc7e..564395f1 100644 --- a/SGGL/BLL/BaseInfo/QualityQuestionTypeService.cs +++ b/SGGL/BLL/BaseInfo/QualityQuestionTypeService.cs @@ -6,7 +6,7 @@ namespace BLL { public class QualityQuestionTypeService { - public static Model.SGGLDB db = Funs.DB; + /// /// 获取实体集合 diff --git a/SGGL/BLL/BaseInfo/RewardTypeService.cs b/SGGL/BLL/BaseInfo/RewardTypeService.cs index 311b8ef2..b6eb4dcb 100644 --- a/SGGL/BLL/BaseInfo/RewardTypeService.cs +++ b/SGGL/BLL/BaseInfo/RewardTypeService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class RewardTypeService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取奖励定义 diff --git a/SGGL/BLL/BaseInfo/RulesRegulationsTypeService.cs b/SGGL/BLL/BaseInfo/RulesRegulationsTypeService.cs index 9412a633..e4e6d42a 100644 --- a/SGGL/BLL/BaseInfo/RulesRegulationsTypeService.cs +++ b/SGGL/BLL/BaseInfo/RulesRegulationsTypeService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class RulesRegulationsTypeService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取规章制度类别 diff --git a/SGGL/BLL/BaseInfo/SafetyMeasuresService.cs b/SGGL/BLL/BaseInfo/SafetyMeasuresService.cs index e9570e4f..8d1321d7 100644 --- a/SGGL/BLL/BaseInfo/SafetyMeasuresService.cs +++ b/SGGL/BLL/BaseInfo/SafetyMeasuresService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class SafetyMeasuresService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取安全措施 @@ -50,8 +50,8 @@ namespace BLL SafetyMeasures = SafetyMeasures.SafetyMeasures, LicenseType = SafetyMeasures.LicenseType }; - db.Base_SafetyMeasures.InsertOnSubmit(newSafetyMeasures); - db.SubmitChanges(); + Funs.DB.Base_SafetyMeasures.InsertOnSubmit(newSafetyMeasures); + Funs.DB.SubmitChanges(); } /// diff --git a/SGGL/BLL/BaseInfo/SolutionTempleteTypeService.cs b/SGGL/BLL/BaseInfo/SolutionTempleteTypeService.cs index d22a9c06..41497afd 100644 --- a/SGGL/BLL/BaseInfo/SolutionTempleteTypeService.cs +++ b/SGGL/BLL/BaseInfo/SolutionTempleteTypeService.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { @@ -8,8 +9,6 @@ namespace BLL /// public static class SolutionTempleteTypeService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据主键获取施工方案模板类型 /// @@ -33,6 +32,7 @@ namespace BLL Remark = solutionTempleteType.Remark, SortIndex = solutionTempleteType.SortIndex }; + var db = Funs.DB; db.Base_SolutionTempleteType.InsertOnSubmit(newSolutionTempleteType); db.SubmitChanges(); } @@ -43,6 +43,7 @@ namespace BLL /// public static void UpdateSolutionTempleteType(Model.Base_SolutionTempleteType solutionTempleteType) { + var db = Funs.DB; Model.Base_SolutionTempleteType newSolutionTempleteType = db.Base_SolutionTempleteType.FirstOrDefault(e => e.SolutionTempleteTypeCode == solutionTempleteType.SolutionTempleteTypeCode); if (newSolutionTempleteType != null) { @@ -59,6 +60,7 @@ namespace BLL /// public static void DeleteSolutionTempleteTypeById(string solutionTempleteTypeCode) { + var db = Funs.DB; var solutionTemplate = db.Base_SolutionTempleteType.FirstOrDefault(e => e.SolutionTempleteTypeCode == solutionTempleteTypeCode); if (solutionTemplate != null) { @@ -73,7 +75,7 @@ namespace BLL /// public static List GetSolutionTempleteType() { - return (from x in db.Base_SolutionTempleteType orderby x.SortIndex select x).ToList(); + return (from x in Funs.DB.Base_SolutionTempleteType orderby x.SortIndex select x).ToList(); } /// /// 获取类别下拉项 diff --git a/SGGL/BLL/BaseInfo/SpecialEquipmentService.cs b/SGGL/BLL/BaseInfo/SpecialEquipmentService.cs index 533e0313..560d5dde 100644 --- a/SGGL/BLL/BaseInfo/SpecialEquipmentService.cs +++ b/SGGL/BLL/BaseInfo/SpecialEquipmentService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class SpecialEquipmentService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取机具设备 diff --git a/SGGL/BLL/BaseInfo/SpecialSchemeTypeService.cs b/SGGL/BLL/BaseInfo/SpecialSchemeTypeService.cs index f49e7cb6..e695fae2 100644 --- a/SGGL/BLL/BaseInfo/SpecialSchemeTypeService.cs +++ b/SGGL/BLL/BaseInfo/SpecialSchemeTypeService.cs @@ -5,7 +5,7 @@ namespace BLL { public static class SpecialSchemeTypeService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取信息 diff --git a/SGGL/BLL/BaseInfo/TrainLevelService.cs b/SGGL/BLL/BaseInfo/TrainLevelService.cs index 8ffafc0f..49e2f92c 100644 --- a/SGGL/BLL/BaseInfo/TrainLevelService.cs +++ b/SGGL/BLL/BaseInfo/TrainLevelService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class TrainLevelService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取主键 diff --git a/SGGL/BLL/BaseInfo/TrainTypeService.cs b/SGGL/BLL/BaseInfo/TrainTypeService.cs index 375f2c12..2bb05af2 100644 --- a/SGGL/BLL/BaseInfo/TrainTypeService.cs +++ b/SGGL/BLL/BaseInfo/TrainTypeService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class TrainTypeService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取培训类型 diff --git a/SGGL/BLL/BaseInfo/UnitTypeService.cs b/SGGL/BLL/BaseInfo/UnitTypeService.cs index 301b111e..8e9c09d3 100644 --- a/SGGL/BLL/BaseInfo/UnitTypeService.cs +++ b/SGGL/BLL/BaseInfo/UnitTypeService.cs @@ -6,7 +6,7 @@ namespace BLL public static class UnitTypeService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取信息 diff --git a/SGGL/BLL/BaseInfo/WorkPostService.cs b/SGGL/BLL/BaseInfo/WorkPostService.cs index 9f1692c3..a5463683 100644 --- a/SGGL/BLL/BaseInfo/WorkPostService.cs +++ b/SGGL/BLL/BaseInfo/WorkPostService.cs @@ -6,7 +6,7 @@ namespace BLL { public static class WorkPostService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取信息 diff --git a/SGGL/BLL/BaseInfo/WorkStageService.cs b/SGGL/BLL/BaseInfo/WorkStageService.cs index ce5f0b47..2f007cd4 100644 --- a/SGGL/BLL/BaseInfo/WorkStageService.cs +++ b/SGGL/BLL/BaseInfo/WorkStageService.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { @@ -8,8 +9,6 @@ namespace BLL /// public static class WorkStageService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据主键获取工作阶段 /// @@ -36,7 +35,7 @@ namespace BLL /// public static List GetWorkStageList() { - return (from x in db.Base_WorkStage orderby x.WorkStageCode select x).ToList(); + return (from x in Funs.DB.Base_WorkStage orderby x.WorkStageCode select x).ToList(); } /// @@ -52,8 +51,9 @@ namespace BLL WorkStageName = workStage.WorkStageName, Remarks = workStage.Remarks }; - db.Base_WorkStage.InsertOnSubmit(newWorkStage); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Base_WorkStage.InsertOnSubmit(newWorkStage); + db1.SubmitChanges(); } /// @@ -62,13 +62,14 @@ namespace BLL /// public static void UpdateWorkStage(Model.Base_WorkStage workStage) { - Model.Base_WorkStage newWorkStage = db.Base_WorkStage.FirstOrDefault(e => e.WorkStageId == workStage.WorkStageId); + var db1 = Funs.DB; + Model.Base_WorkStage newWorkStage = db1.Base_WorkStage.FirstOrDefault(e => e.WorkStageId == workStage.WorkStageId); if (newWorkStage != null) { newWorkStage.WorkStageCode = workStage.WorkStageCode; newWorkStage.WorkStageName = workStage.WorkStageName; newWorkStage.Remarks = workStage.Remarks; - db.SubmitChanges(); + db1.SubmitChanges(); } } @@ -78,11 +79,12 @@ namespace BLL /// public static void DeleteWorkStageById(string workStageId) { - Model.Base_WorkStage workStage = db.Base_WorkStage.FirstOrDefault(e => e.WorkStageId == workStageId); + var db1 = Funs.DB; + Model.Base_WorkStage workStage = db1.Base_WorkStage.FirstOrDefault(e => e.WorkStageId == workStageId); if (workStage != null) { - db.Base_WorkStage.DeleteOnSubmit(workStage); - db.SubmitChanges(); + db1.Base_WorkStage.DeleteOnSubmit(workStage); + db1.SubmitChanges(); } } diff --git a/SGGL/BLL/CQMS/Check/CheckControlApproveService.cs b/SGGL/BLL/CQMS/Check/CheckControlApproveService.cs index 68c6579f..f6369ccd 100644 --- a/SGGL/BLL/CQMS/Check/CheckControlApproveService.cs +++ b/SGGL/BLL/CQMS/Check/CheckControlApproveService.cs @@ -2,12 +2,12 @@ using System.Collections.Generic; using System.Data; using System.Linq; +using Model; namespace BLL { public class CheckControlApproveService { - public static Model.SGGLDB db = Funs.DB; /// /// 获取质量巡检模板列表 /// @@ -16,14 +16,15 @@ namespace BLL /// public static DataTable getListData(string CheckControlCode) { - var res = from x in db.Check_CheckControlApprove + var db1 = Funs.DB; + var res = from x in db1.Check_CheckControlApprove where x.CheckControlCode == CheckControlCode && x.ApproveDate != null && x.ApproveType != "S" orderby x.ApproveDate select new { x.CheckControlApproveId, x.CheckControlCode, - ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + ApproveMan = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), x.ApproveDate, x.IsAgree, x.ApproveIdea, @@ -77,7 +78,7 @@ namespace BLL /// public static Model.Check_CheckControlApprove GetSee(string CheckControlCode, string userId) { - return db.Check_CheckControlApprove.FirstOrDefault(x => x.CheckControlCode == CheckControlCode && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); + return Funs.DB.Check_CheckControlApprove.FirstOrDefault(x => x.CheckControlCode == CheckControlCode && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); } public static void See(string CheckControlCode, string userId) { @@ -98,7 +99,7 @@ namespace BLL /// 一个质量巡检审批实体 public static Model.Check_CheckControlApprove GetCheckControlApproveByCheckControlId(string CheckControlCode) { - return db.Check_CheckControlApprove.FirstOrDefault(x => x.CheckControlCode == CheckControlCode && x.ApproveType != "S" && x.ApproveDate == null); + return Funs.DB.Check_CheckControlApprove.FirstOrDefault(x => x.CheckControlCode == CheckControlCode && x.ApproveType != "S" && x.ApproveDate == null); } /// /// 修改质量巡检审批信息 @@ -163,7 +164,7 @@ namespace BLL /// public static Model.Check_CheckControlApprove GetAudit1(string CheckControlCode) { - return db.Check_CheckControlApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.CheckControlCode == CheckControlCode && x.ApproveType == BLL.Const.CheckControl_Audit1); + return Funs.DB.Check_CheckControlApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.CheckControlCode == CheckControlCode && x.ApproveType == BLL.Const.CheckControl_Audit1); } /// @@ -173,7 +174,7 @@ namespace BLL /// public static Model.Check_CheckControlApprove GetAudit2(string CheckControlCode) { - return db.Check_CheckControlApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.CheckControlCode == CheckControlCode && x.ApproveType == BLL.Const.CheckControl_Audit2); + return Funs.DB.Check_CheckControlApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.CheckControlCode == CheckControlCode && x.ApproveType == BLL.Const.CheckControl_Audit2); } /// @@ -183,7 +184,7 @@ namespace BLL /// public static Model.Check_CheckControlApprove GetAudit3(string CheckControlCode) { - return db.Check_CheckControlApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.CheckControlCode == CheckControlCode && x.ApproveType == BLL.Const.CheckControl_Audit3); + return Funs.DB.Check_CheckControlApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.CheckControlCode == CheckControlCode && x.ApproveType == BLL.Const.CheckControl_Audit3); } /// @@ -193,7 +194,7 @@ namespace BLL /// public static Model.Check_CheckControlApprove GetAudit4(string CheckControlCode) { - return db.Check_CheckControlApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.CheckControlCode == CheckControlCode && x.ApproveType == BLL.Const.CheckControl_Audit4); + return Funs.DB.Check_CheckControlApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.CheckControlCode == CheckControlCode && x.ApproveType == BLL.Const.CheckControl_Audit4); } /// @@ -203,12 +204,12 @@ namespace BLL /// public static Model.Check_CheckControlApprove GetAudit5(string CheckControlCode) { - return db.Check_CheckControlApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.CheckControlCode == CheckControlCode && x.ApproveType == BLL.Const.CheckControl_Audit5); + return Funs.DB.Check_CheckControlApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.CheckControlCode == CheckControlCode && x.ApproveType == BLL.Const.CheckControl_Audit5); } public static Model.Check_CheckControlApprove GetComplie(string CheckControlCode) { - return db.Check_CheckControlApprove.FirstOrDefault(x => x.CheckControlCode == CheckControlCode && x.ApproveType == BLL.Const.CheckControl_Compile); + return Funs.DB.Check_CheckControlApprove.FirstOrDefault(x => x.CheckControlCode == CheckControlCode && x.ApproveType == BLL.Const.CheckControl_Compile); } public static List GetListDataByCodeForApi(string code) { diff --git a/SGGL/BLL/CQMS/Check/CheckControlService.cs b/SGGL/BLL/CQMS/Check/CheckControlService.cs index 41536434..d3758b2d 100644 --- a/SGGL/BLL/CQMS/Check/CheckControlService.cs +++ b/SGGL/BLL/CQMS/Check/CheckControlService.cs @@ -8,7 +8,7 @@ namespace BLL { public class CheckControlService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据质量检查与控制Id删除一个质量检查与控制信息 /// diff --git a/SGGL/BLL/CQMS/Check/CheckEquipmentApproveService.cs b/SGGL/BLL/CQMS/Check/CheckEquipmentApproveService.cs index fb076667..51b2ff95 100644 --- a/SGGL/BLL/CQMS/Check/CheckEquipmentApproveService.cs +++ b/SGGL/BLL/CQMS/Check/CheckEquipmentApproveService.cs @@ -1,13 +1,12 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class CheckEquipmentApproveService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取设计变更模板列表 /// @@ -16,14 +15,15 @@ namespace BLL /// public static IEnumerable getListData(string CheckEquipmentId) { - return from x in db.Check_CheckEquipmentApprove + var db1 = Funs.DB; + return from x in db1.Check_CheckEquipmentApprove where x.CheckEquipmentId == CheckEquipmentId && x.ApproveDate != null orderby x.ApproveDate select new { x.CheckEquipmentApproveId, x.CheckEquipmentId, - ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + ApproveMan = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), x.ApproveDate, x.IsAgree, x.ApproveIdea, @@ -38,7 +38,7 @@ namespace BLL /// 一个设计变更审批实体 public static Model.Check_CheckEquipmentApprove GetCheckEquipmentApproveByCheckEquipmentId(string CheckEquipmentId) { - return db.Check_CheckEquipmentApprove.FirstOrDefault(x => x.CheckEquipmentId == CheckEquipmentId && x.ApproveDate == null); + return Funs.DB.Check_CheckEquipmentApprove.FirstOrDefault(x => x.CheckEquipmentId == CheckEquipmentId && x.ApproveDate == null); } /// @@ -48,17 +48,17 @@ namespace BLL /// 一个设计变更审批实体 public static Model.Check_CheckEquipmentApprove GetCheckEquipmentApproveByApproveId(string approveId) { - return db.Check_CheckEquipmentApprove.FirstOrDefault(x => x.CheckEquipmentApproveId == approveId); + return Funs.DB.Check_CheckEquipmentApprove.FirstOrDefault(x => x.CheckEquipmentApproveId == approveId); } public static Model.Check_CheckEquipmentApprove GetComplie(string CheckEquipmentId) { - return db.Check_CheckEquipmentApprove.FirstOrDefault(x => x.CheckEquipmentId == CheckEquipmentId && x.ApproveType == BLL.Const.CheckEquipment_Compile); + return Funs.DB.Check_CheckEquipmentApprove.FirstOrDefault(x => x.CheckEquipmentId == CheckEquipmentId && x.ApproveType == BLL.Const.CheckEquipment_Compile); } public static Model.Check_CheckEquipmentApprove GetApprove(string CheckEquipmentId) { - return db.Check_CheckEquipmentApprove.FirstOrDefault(x => x.CheckEquipmentId == CheckEquipmentId && x.ApproveType == BLL.Const.CheckEquipment_Approve); + return Funs.DB.Check_CheckEquipmentApprove.FirstOrDefault(x => x.CheckEquipmentId == CheckEquipmentId && x.ApproveType == BLL.Const.CheckEquipment_Approve); } /// @@ -68,7 +68,7 @@ namespace BLL /// 设计变更审批集合 public static List GetCheckEquipmentApprovesByCheckEquipmentId(string CheckEquipmentId) { - return (from x in db.Check_CheckEquipmentApprove where x.CheckEquipmentId == CheckEquipmentId select x).ToList(); + return (from x in Funs.DB.Check_CheckEquipmentApprove where x.CheckEquipmentId == CheckEquipmentId select x).ToList(); } /// @@ -187,14 +187,15 @@ namespace BLL } public static List getListDataByEid(string CheckEquipmentId) { - var q = from x in db.Check_CheckEquipmentApprove + var db1 = Funs.DB; + var q = from x in db1.Check_CheckEquipmentApprove where x.CheckEquipmentId == CheckEquipmentId && x.ApproveDate != null && x.ApproveType != "S" orderby x.ApproveDate select new { x.CheckEquipmentApproveId, x.CheckEquipmentId, - ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + ApproveMan = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), x.ApproveDate, x.IsAgree, x.ApproveIdea, diff --git a/SGGL/BLL/CQMS/Check/CheckEquipmentService.cs b/SGGL/BLL/CQMS/Check/CheckEquipmentService.cs index dfa99a78..8c16d859 100644 --- a/SGGL/BLL/CQMS/Check/CheckEquipmentService.cs +++ b/SGGL/BLL/CQMS/Check/CheckEquipmentService.cs @@ -3,13 +3,12 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Web.UI.WebControls; +using Model; namespace BLL { public class CheckEquipmentService { - public static Model.SGGLDB db = Funs.DB; - /// /// 记录数 /// @@ -22,7 +21,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable qq = from x in db.Check_CheckEquipment orderby x.CompileDate descending select x; + private static IQueryable qq = from x in Funs.DB.Check_CheckEquipment orderby x.CompileDate descending select x; /// /// 获取分页列表 @@ -60,12 +59,13 @@ namespace BLL return new object[] { "" }; } + var db1 = Funs.DB; return from x in q.Skip(startRowIndex).Take(maximumRows) select new { x.CheckEquipmentId, x.ProjectId, - UserUnit = (from y in db.Base_Unit where y.UnitId == x.UserUnitId select y.UnitName).First(), + UserUnit = (from y in db1.Base_Unit where y.UnitId == x.UserUnitId select y.UnitName).First(), x.EquipmentName, x.Format, x.SetAccuracyGrade, @@ -75,7 +75,7 @@ namespace BLL IsIdentification = x.IsIdentification == true ? "有" : "没有", IsCheckCertificate = x.IsCheckCertificate == true ? "有" : "没有", x.AttachUrl, - CompileMan = (from y in db.Person_Persons where y.PersonId == x.CompileMan select y.PersonName).First(), + CompileMan = (from y in db1.Person_Persons where y.PersonId == x.CompileMan select y.PersonName).First(), x.CompileDate, x.State, }; diff --git a/SGGL/BLL/CQMS/Check/CheckMaterialacceptance.cs b/SGGL/BLL/CQMS/Check/CheckMaterialacceptance.cs index bb25fb33..afeb4c7c 100644 --- a/SGGL/BLL/CQMS/Check/CheckMaterialacceptance.cs +++ b/SGGL/BLL/CQMS/Check/CheckMaterialacceptance.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; +using Model; namespace BLL @@ -11,9 +12,6 @@ namespace BLL public static class CheckMaterialacceptanceService { - public static Model.SGGLDB db = Funs.DB; - - #region 获取列表 /// /// 记录数 @@ -25,7 +23,7 @@ namespace BLL } public static List GetCheck_MaterialAcceptanceByModle(Model.Check_MaterialAcceptance table) { - var q = from x in db.Check_MaterialAcceptance + var q = from x in Funs.DB.Check_MaterialAcceptance where (string.IsNullOrEmpty(table.MaterialAcceptanceId) || x.MaterialAcceptanceId.Contains(table.MaterialAcceptanceId)) && (string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) && @@ -73,7 +71,7 @@ namespace BLL public static Model.Check_MaterialAcceptance GetCheck_MaterialAcceptanceById(string MaterialAcceptanceId) { - return db.Check_MaterialAcceptance.FirstOrDefault(x => x.MaterialAcceptanceId == MaterialAcceptanceId); + return Funs.DB.Check_MaterialAcceptance.FirstOrDefault(x => x.MaterialAcceptanceId == MaterialAcceptanceId); } @@ -91,22 +89,23 @@ namespace BLL State = newtable.State, FilePath = newtable.FilePath, }; - db.Check_MaterialAcceptance.InsertOnSubmit(table); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Check_MaterialAcceptance.InsertOnSubmit(table); + db1.SubmitChanges(); } public static void AddBulkCheck_MaterialAcceptance(List newtables) { - - db.Check_MaterialAcceptance.InsertAllOnSubmit(newtables); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Check_MaterialAcceptance.InsertAllOnSubmit(newtables); + db1.SubmitChanges(); } public static void UpdateCheck_MaterialAcceptance(Model.Check_MaterialAcceptance newtable) { - - Model.Check_MaterialAcceptance table = db.Check_MaterialAcceptance.FirstOrDefault(x => x.MaterialAcceptanceId == newtable.MaterialAcceptanceId); + var db1 = Funs.DB; + Model.Check_MaterialAcceptance table = db1.Check_MaterialAcceptance.FirstOrDefault(x => x.MaterialAcceptanceId == newtable.MaterialAcceptanceId); if (table != null) { table.MaterialAcceptanceId = newtable.MaterialAcceptanceId; @@ -117,28 +116,29 @@ namespace BLL table.CompileDate = newtable.CompileDate; table.State = newtable.State; table.FilePath = newtable.FilePath; - db.SubmitChanges(); + db1.SubmitChanges(); } } public static void DeleteCheck_MaterialAcceptanceById(string MaterialAcceptanceId) { - - Model.Check_MaterialAcceptance table = db.Check_MaterialAcceptance.FirstOrDefault(x => x.MaterialAcceptanceId == MaterialAcceptanceId); + var db1 = Funs.DB; + Model.Check_MaterialAcceptance table = db1.Check_MaterialAcceptance.FirstOrDefault(x => x.MaterialAcceptanceId == MaterialAcceptanceId); if (table != null) { - db.Check_MaterialAcceptance.DeleteOnSubmit(table); - db.SubmitChanges(); + db1.Check_MaterialAcceptance.DeleteOnSubmit(table); + db1.SubmitChanges(); } } public static void DeleteALLCheck_MaterialAcceptance() { - if (db.Check_MaterialAcceptance != null) + var db1 = Funs.DB; + if (db1.Check_MaterialAcceptance != null) { - db.Check_MaterialAcceptance.DeleteAllOnSubmit(db.Check_MaterialAcceptance); - db.SubmitChanges(); + db1.Check_MaterialAcceptance.DeleteAllOnSubmit(db1.Check_MaterialAcceptance); + db1.SubmitChanges(); } } diff --git a/SGGL/BLL/CQMS/Check/CheckMonthService.cs b/SGGL/BLL/CQMS/Check/CheckMonthService.cs index 381340c7..f6dbb961 100644 --- a/SGGL/BLL/CQMS/Check/CheckMonthService.cs +++ b/SGGL/BLL/CQMS/Check/CheckMonthService.cs @@ -1,13 +1,12 @@ using System; using System.Collections; using System.Linq; +using Model; namespace BLL { public class CheckMonthService { - public static Model.SGGLDB db = Funs.DB; - /// /// 记录数 /// @@ -20,7 +19,7 @@ namespace BLL /// /// 定义变量 /// - public static IQueryable qq = from x in db.Check_CheckMonth orderby x.Months descending select x; + public static IQueryable qq = from x in Funs.DB.Check_CheckMonth orderby x.Months descending select x; /// /// 获取分页列表 @@ -55,7 +54,7 @@ namespace BLL x.TotalSpotCheckNum, x.TotalCompletedRate, x.OnesOKRate, - CompileMan = (from y in db.Person_Persons where y.PersonId == x.CompileMan select y.PersonName).First(), + CompileMan = (from y in Funs.DB.Person_Persons where y.PersonId == x.CompileMan select y.PersonName).First(), x.CompileDate, Months = Convert.ToDateTime(x.Months).Year.ToString() + "-" + Convert.ToDateTime(x.Months).Month.ToString(), }; diff --git a/SGGL/BLL/CQMS/Check/DesignApproveService.cs b/SGGL/BLL/CQMS/Check/DesignApproveService.cs index 37a2f1af..35d6f909 100644 --- a/SGGL/BLL/CQMS/Check/DesignApproveService.cs +++ b/SGGL/BLL/CQMS/Check/DesignApproveService.cs @@ -1,13 +1,12 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class DesignApproveService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取设计变更模板列表 /// @@ -16,14 +15,15 @@ namespace BLL /// public static IEnumerable getListData(string DesignId) { - return from x in db.Check_DesignApprove + var db1 = Funs.DB; + return from x in db1.Check_DesignApprove where x.DesignId == DesignId && x.ApproveDate != null orderby x.ApproveDate select new { x.DesignApproveId, x.DesignId, - ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + ApproveMan = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), x.ApproveDate, x.IsAgree, x.ApproveIdea, @@ -38,7 +38,7 @@ namespace BLL /// 一个设计变更审批实体 public static Model.Check_DesignApprove GetDesignApproveByDesignId(string DesignId) { - return db.Check_DesignApprove.FirstOrDefault(x => x.DesignId == DesignId && x.ApproveDate == null); + return Funs.DB.Check_DesignApprove.FirstOrDefault(x => x.DesignId == DesignId && x.ApproveDate == null); } /// @@ -48,22 +48,22 @@ namespace BLL /// 一个设计变更审批实体 public static Model.Check_DesignApprove GetDesignApproveByApproveId(string approveId) { - return db.Check_DesignApprove.FirstOrDefault(x => x.DesignApproveId == approveId); + return Funs.DB.Check_DesignApprove.FirstOrDefault(x => x.DesignApproveId == approveId); } public static Model.Check_DesignApprove GetComplie(string DesignId) { - return db.Check_DesignApprove.FirstOrDefault(x => x.DesignId == DesignId && x.ApproveType == BLL.Const.Design_Compile); + return Funs.DB.Check_DesignApprove.FirstOrDefault(x => x.DesignId == DesignId && x.ApproveType == BLL.Const.Design_Compile); } public static Model.Check_DesignApprove GetAuditMan(string DesignId, string state) { - return db.Check_DesignApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.DesignId == DesignId && x.ApproveType == state); + return Funs.DB.Check_DesignApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.DesignId == DesignId && x.ApproveType == state); } public static Model.Check_DesignApprove GetAudit2(string DesignId) { - return db.Check_DesignApprove.FirstOrDefault(x => x.DesignId == DesignId && x.ApproveType == BLL.Const.Design_Audit2); + return Funs.DB.Check_DesignApprove.FirstOrDefault(x => x.DesignId == DesignId && x.ApproveType == BLL.Const.Design_Audit2); } /// @@ -73,7 +73,7 @@ namespace BLL /// 设计变更审批集合 public static List GetDesignApprovesByDesignId(string DesignId) { - return (from x in db.Check_DesignApprove where x.DesignId == DesignId select x).ToList(); + return (from x in Funs.DB.Check_DesignApprove where x.DesignId == DesignId select x).ToList(); } /// diff --git a/SGGL/BLL/CQMS/Check/DesignService.cs b/SGGL/BLL/CQMS/Check/DesignService.cs index 17860564..7d22f318 100644 --- a/SGGL/BLL/CQMS/Check/DesignService.cs +++ b/SGGL/BLL/CQMS/Check/DesignService.cs @@ -4,13 +4,12 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Web.UI.WebControls; +using Model; namespace BLL { public class DesignService { - public static Model.SGGLDB db = Funs.DB; - /// /// 记录数 /// @@ -23,7 +22,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable qq = from x in db.Check_Design orderby x.DesignDate descending select x; + private static IQueryable qq = from x in Funs.DB.Check_Design orderby x.DesignDate descending select x; public static string CovBool(bool? b) diff --git a/SGGL/BLL/CQMS/Check/FileCabinetService.cs b/SGGL/BLL/CQMS/Check/FileCabinetService.cs index c1449c85..fbff4223 100644 --- a/SGGL/BLL/CQMS/Check/FileCabinetService.cs +++ b/SGGL/BLL/CQMS/Check/FileCabinetService.cs @@ -1,11 +1,11 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class FileCabinetService { - public static Model.SGGLDB db = Funs.DB; /// /// 增加信息 /// @@ -23,8 +23,9 @@ namespace BLL CreateManId = addFileCabinet.CreateManId, FileUrl = addFileCabinet.FileUrl }; - db.Project_FileCabinet.InsertOnSubmit(newFileCabinet); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Project_FileCabinet.InsertOnSubmit(newFileCabinet); + db1.SubmitChanges(); } /// /// 记录数 @@ -55,7 +56,7 @@ namespace BLL /// public static Model.Project_FileCabinet getInfo(string fileCabinetId) { - return db.Project_FileCabinet.FirstOrDefault(e => e.FileCabinetId == fileCabinetId); + return Funs.DB.Project_FileCabinet.FirstOrDefault(e => e.FileCabinetId == fileCabinetId); } /// /// 获取重要文件 @@ -104,7 +105,8 @@ namespace BLL /// 实体 public static void UpdateFileCabinet(Model.Project_FileCabinet updateFileCabinet) { - Model.Project_FileCabinet getFileCabinet = db.Project_FileCabinet.FirstOrDefault(e => e.FileCabinetId == updateFileCabinet.FileCabinetId); + var db1 = Funs.DB; + Model.Project_FileCabinet getFileCabinet = db1.Project_FileCabinet.FirstOrDefault(e => e.FileCabinetId == updateFileCabinet.FileCabinetId); if (getFileCabinet != null) { getFileCabinet.FileCode = updateFileCabinet.FileCode; @@ -112,7 +114,7 @@ namespace BLL getFileCabinet.FileDate = updateFileCabinet.FileDate; getFileCabinet.CreateManId = updateFileCabinet.CreateManId; getFileCabinet.FileUrl = updateFileCabinet.FileUrl; - db.SubmitChanges(); + db1.SubmitChanges(); } } diff --git a/SGGL/BLL/CQMS/Check/JointCheckApproveService.cs b/SGGL/BLL/CQMS/Check/JointCheckApproveService.cs index 2ca0a3e0..31f59089 100644 --- a/SGGL/BLL/CQMS/Check/JointCheckApproveService.cs +++ b/SGGL/BLL/CQMS/Check/JointCheckApproveService.cs @@ -2,12 +2,12 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class JointCheckApproveService { - public static Model.SGGLDB db = Funs.DB; /// /// 根据质量共检编号删除对应的所有质量共检审批信息 /// @@ -55,7 +55,7 @@ namespace BLL { x.JointCheckApproveId, x.JointCheckId, - ApproveMan = x.ApproveMan == null ? "" : (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + ApproveMan = x.ApproveMan == null ? "" : (from y in Funs.DB.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), x.ApproveDate, x.IsAgree, x.ApproveIdea, @@ -99,7 +99,7 @@ namespace BLL { x.JointCheckApproveId, x.JointCheckId, - ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + ApproveMan = (from y in Funs.DB.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), x.ApproveDate, x.IsAgree, x.ApproveIdea, @@ -176,7 +176,7 @@ namespace BLL } public static Model.Check_JointCheckApprove GetSee(string JointCheckId, string userId) { - return db.Check_JointCheckApprove.FirstOrDefault(x => x.JointCheckId == JointCheckId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); + return Funs.DB.Check_JointCheckApprove.FirstOrDefault(x => x.JointCheckId == JointCheckId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); } public static void See(string JointCheckId, string userId) { @@ -227,7 +227,7 @@ namespace BLL /// public static Model.Check_JointCheckApprove GetAudit1(string JointCheckId, string jointCheckDetailId) { - return db.Check_JointCheckApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.JointCheckId == JointCheckId && x.ApproveType == BLL.Const.JointCheck_Audit1 && x.JointCheckDetailId == jointCheckDetailId); + return Funs.DB.Check_JointCheckApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.JointCheckId == JointCheckId && x.ApproveType == BLL.Const.JointCheck_Audit1 && x.JointCheckDetailId == jointCheckDetailId); } /// @@ -237,7 +237,7 @@ namespace BLL /// public static Model.Check_JointCheckApprove GetAudit2(string JointCheckId, string jointCheckDetailId) { - return db.Check_JointCheckApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.JointCheckId == JointCheckId && x.ApproveType == BLL.Const.JointCheck_Audit2 && x.JointCheckDetailId == jointCheckDetailId); + return Funs.DB.Check_JointCheckApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.JointCheckId == JointCheckId && x.ApproveType == BLL.Const.JointCheck_Audit2 && x.JointCheckDetailId == jointCheckDetailId); } /// @@ -247,7 +247,7 @@ namespace BLL /// public static Model.Check_JointCheckApprove GetAudit3(string JointCheckId, string jointCheckDetailId) { - return db.Check_JointCheckApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.JointCheckId == JointCheckId && x.ApproveType == BLL.Const.JointCheck_Audit3 && x.JointCheckDetailId == jointCheckDetailId); + return Funs.DB.Check_JointCheckApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.JointCheckId == JointCheckId && x.ApproveType == BLL.Const.JointCheck_Audit3 && x.JointCheckDetailId == jointCheckDetailId); } /// @@ -257,7 +257,7 @@ namespace BLL /// public static Model.Check_JointCheckApprove GetAudit4(string JointCheckId, string jointCheckDetailId) { - return db.Check_JointCheckApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.JointCheckId == JointCheckId && x.ApproveType == BLL.Const.JointCheck_Audit4 && x.JointCheckDetailId == jointCheckDetailId); + return Funs.DB.Check_JointCheckApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.JointCheckId == JointCheckId && x.ApproveType == BLL.Const.JointCheck_Audit4 && x.JointCheckDetailId == jointCheckDetailId); } public static List getListDataByJcidForApi(string JointCheckId, string JointCheckDetailId) { diff --git a/SGGL/BLL/CQMS/Check/MonthDesignService.cs b/SGGL/BLL/CQMS/Check/MonthDesignService.cs index d4f06f68..a5bd5263 100644 --- a/SGGL/BLL/CQMS/Check/MonthDesignService.cs +++ b/SGGL/BLL/CQMS/Check/MonthDesignService.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class MonthDesignService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取月报设计变更情况列表 /// @@ -15,7 +14,7 @@ namespace BLL /// public static List getListData(string CheckMonthId) { - return (from x in db.Check_MonthDesign + return (from x in Funs.DB.Check_MonthDesign where x.CheckMonthId == CheckMonthId select x).ToList(); } diff --git a/SGGL/BLL/CQMS/Check/MonthNDTCheckService.cs b/SGGL/BLL/CQMS/Check/MonthNDTCheckService.cs index 76fbfbc3..1615e2d2 100644 --- a/SGGL/BLL/CQMS/Check/MonthNDTCheckService.cs +++ b/SGGL/BLL/CQMS/Check/MonthNDTCheckService.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class MonthNDTCheckService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取月报无损检测情况模板列表 /// @@ -15,7 +14,7 @@ namespace BLL /// public static List getListData(string CheckMonthId) { - return (from x in db.Check_MonthNDTCheck + return (from x in Funs.DB.Check_MonthNDTCheck where x.CheckMonthId == CheckMonthId select x).ToList(); } diff --git a/SGGL/BLL/CQMS/Check/MonthRectifyService.cs b/SGGL/BLL/CQMS/Check/MonthRectifyService.cs index 2f864356..e81f3ce0 100644 --- a/SGGL/BLL/CQMS/Check/MonthRectifyService.cs +++ b/SGGL/BLL/CQMS/Check/MonthRectifyService.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class MonthRectifyService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取月报质量巡检情况模板列表 /// @@ -15,7 +14,7 @@ namespace BLL /// public static List getListData(string CheckMonthId) { - return (from x in db.Check_MonthRectify + return (from x in Funs.DB.Check_MonthRectify where x.CheckMonthId == CheckMonthId select x).ToList(); } diff --git a/SGGL/BLL/CQMS/Check/MonthSpotCheckDetailService.cs b/SGGL/BLL/CQMS/Check/MonthSpotCheckDetailService.cs index 56354ffd..3584049e 100644 --- a/SGGL/BLL/CQMS/Check/MonthSpotCheckDetailService.cs +++ b/SGGL/BLL/CQMS/Check/MonthSpotCheckDetailService.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class MonthSpotCheckDetailService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取月报质量验收情况模板列表 /// @@ -15,7 +14,7 @@ namespace BLL /// public static List getListData(string CheckMonthId) { - return (from x in db.Check_MonthSpotCheckDetail + return (from x in Funs.DB.Check_MonthSpotCheckDetail where x.CheckMonthId == CheckMonthId select x).ToList(); } diff --git a/SGGL/BLL/CQMS/Check/MonthWelderService.cs b/SGGL/BLL/CQMS/Check/MonthWelderService.cs index 60a35bb4..18822aea 100644 --- a/SGGL/BLL/CQMS/Check/MonthWelderService.cs +++ b/SGGL/BLL/CQMS/Check/MonthWelderService.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class MonthWelderService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取月报焊工资格评定情况模板列表 /// @@ -15,7 +14,7 @@ namespace BLL /// public static List getListData(string CheckMonthId) { - return (from x in db.Check_MonthWelder + return (from x in Funs.DB.Check_MonthWelder where x.CheckMonthId == CheckMonthId select x).ToList(); } diff --git a/SGGL/BLL/CQMS/Check/SpecialEquipmentDetailService.cs b/SGGL/BLL/CQMS/Check/SpecialEquipmentDetailService.cs index 58dd205c..561ca451 100644 --- a/SGGL/BLL/CQMS/Check/SpecialEquipmentDetailService.cs +++ b/SGGL/BLL/CQMS/Check/SpecialEquipmentDetailService.cs @@ -1,13 +1,12 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class SpecialEquipmentDetailService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取月报特种设备信息模板列表 /// @@ -16,7 +15,7 @@ namespace BLL /// public static IEnumerable getListData(string CheckMonthId) { - return from x in db.Check_SpecialEquipmentDetail + return from x in Funs.DB.Check_SpecialEquipmentDetail where x.CheckMonthId == CheckMonthId select new { diff --git a/SGGL/BLL/CQMS/Check/SpotCheckApproveService.cs b/SGGL/BLL/CQMS/Check/SpotCheckApproveService.cs index fb667464..5ab817cf 100644 --- a/SGGL/BLL/CQMS/Check/SpotCheckApproveService.cs +++ b/SGGL/BLL/CQMS/Check/SpotCheckApproveService.cs @@ -2,13 +2,12 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class SpotCheckApproveService { - public static Model.SGGLDB db = Funs.DB; - public static Model.Check_SpotCheckApprove GetSpotApproveBySpotCheckDetailId(string spotCheckDetailId) { return (from x in Funs.DB.Check_SpotCheckApprove where x.SpotCheckDetailId == spotCheckDetailId && x.ApproveType != "S" && x.Sign == "2" && x.ApproveDate == null select x).FirstOrDefault(); @@ -34,14 +33,15 @@ namespace BLL /// public static IEnumerable getListData(string SpotCheckCode) { - return from x in db.Check_SpotCheckApprove + var db1 = Funs.DB; + return from x in db1.Check_SpotCheckApprove where x.SpotCheckCode == SpotCheckCode && x.ApproveDate != null && x.ApproveType != "S" && x.Sign == "1" orderby x.ApproveDate select new { x.SpotCheckApproveId, x.SpotCheckCode, - ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + ApproveMan = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), x.ApproveDate, x.IsAgree, x.ApproveIdea, @@ -57,14 +57,15 @@ namespace BLL /// public static IEnumerable getList(string SpotCheckCode) { - return from x in db.Check_SpotCheckApprove + var db1 = Funs.DB; + return from x in db1.Check_SpotCheckApprove where x.SpotCheckCode == SpotCheckCode && x.ApproveDate != null && x.ApproveType != "S" && x.Sign == "2" orderby x.ApproveDate select new { x.SpotCheckApproveId, x.SpotCheckCode, - ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + ApproveMan = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), x.ApproveDate, x.IsAgree, x.ApproveIdea, @@ -89,12 +90,12 @@ namespace BLL /// 一个实体验收审批实体 public static Model.Check_SpotCheckApprove GetSpotCheckApproveByApproveId(string approveId) { - return db.Check_SpotCheckApprove.FirstOrDefault(x => x.SpotCheckApproveId == approveId); + return Funs.DB.Check_SpotCheckApprove.FirstOrDefault(x => x.SpotCheckApproveId == approveId); } public static Model.Check_SpotCheckApprove GetComplie(string SpotCheckCode) { - return db.Check_SpotCheckApprove.FirstOrDefault(x => x.SpotCheckCode == SpotCheckCode && x.ApproveType == BLL.Const.SpotCheck_Compile); + return Funs.DB.Check_SpotCheckApprove.FirstOrDefault(x => x.SpotCheckCode == SpotCheckCode && x.ApproveType == BLL.Const.SpotCheck_Compile); } public static Model.Check_SpotCheckApprove GetComplieForApi(string SpotCheckCode) { @@ -106,7 +107,7 @@ namespace BLL public static Model.Check_SpotCheckApprove GetSee(string SpotCheckCode, string userId) { - return db.Check_SpotCheckApprove.FirstOrDefault(x => x.SpotCheckCode == SpotCheckCode && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); + return Funs.DB.Check_SpotCheckApprove.FirstOrDefault(x => x.SpotCheckCode == SpotCheckCode && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); } public static void See(string SpotCheckCode, string userId) { @@ -122,12 +123,12 @@ namespace BLL } public static Model.Check_SpotCheckApprove GetAudit2(string SpotCheckCode) { - return db.Check_SpotCheckApprove.FirstOrDefault(x => x.SpotCheckCode == SpotCheckCode && x.ApproveType == BLL.Const.SpotCheck_Audit2); + return Funs.DB.Check_SpotCheckApprove.FirstOrDefault(x => x.SpotCheckCode == SpotCheckCode && x.ApproveType == BLL.Const.SpotCheck_Audit2); } public static Model.Check_SpotCheckApprove GetReCompile(string SpotCheckCode) { - return db.Check_SpotCheckApprove.FirstOrDefault(x => x.SpotCheckCode == SpotCheckCode && x.ApproveType == BLL.Const.SpotCheck_ReCompile); + return Funs.DB.Check_SpotCheckApprove.FirstOrDefault(x => x.SpotCheckCode == SpotCheckCode && x.ApproveType == BLL.Const.SpotCheck_ReCompile); } /// @@ -137,7 +138,7 @@ namespace BLL /// 实体验收审批集合 public static List GetSpotCheckApprovesBySpotCheckCode(string SpotCheckCode) { - return (from x in db.Check_SpotCheckApprove where x.SpotCheckCode == SpotCheckCode select x).ToList(); + return (from x in Funs.DB.Check_SpotCheckApprove where x.SpotCheckCode == SpotCheckCode select x).ToList(); } /// @@ -233,14 +234,15 @@ namespace BLL } public static List getListDataBySpotCheckCodeForApi(string SpotCheckCode) { - var q = from x in db.Check_SpotCheckApprove + var db1 = Funs.DB; + var q = from x in db1.Check_SpotCheckApprove where x.SpotCheckCode == SpotCheckCode && x.ApproveDate != null && x.ApproveType != "S" && x.Sign == "1" orderby x.ApproveDate select new { x.SpotCheckApproveId, x.SpotCheckCode, - ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + ApproveMan = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), x.ApproveDate, x.IsAgree, x.ApproveIdea, diff --git a/SGGL/BLL/CQMS/Check/SpotCheckDetailService.cs b/SGGL/BLL/CQMS/Check/SpotCheckDetailService.cs index bd3ebc94..983994d5 100644 --- a/SGGL/BLL/CQMS/Check/SpotCheckDetailService.cs +++ b/SGGL/BLL/CQMS/Check/SpotCheckDetailService.cs @@ -2,13 +2,12 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class SpotCheckDetailService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取实体验收记录明细 /// @@ -17,7 +16,7 @@ namespace BLL /// public static IEnumerable getListData(string SpotCheckCode) { - return from x in db.Check_SpotCheckDetail + return from x in Funs.DB.Check_SpotCheckDetail where x.SpotCheckCode == SpotCheckCode select new { diff --git a/SGGL/BLL/CQMS/Check/SpotCheckService.cs b/SGGL/BLL/CQMS/Check/SpotCheckService.cs index 5f5ef8b7..544018c8 100644 --- a/SGGL/BLL/CQMS/Check/SpotCheckService.cs +++ b/SGGL/BLL/CQMS/Check/SpotCheckService.cs @@ -8,7 +8,7 @@ namespace BLL { public class SpotCheckService { - public static Model.SGGLDB db = Funs.DB; + /// /// 添加实体验收记录 diff --git a/SGGL/BLL/CQMS/Check/TechnicalContactListApproveService.cs b/SGGL/BLL/CQMS/Check/TechnicalContactListApproveService.cs index 99335ef6..9bc1fdc0 100644 --- a/SGGL/BLL/CQMS/Check/TechnicalContactListApproveService.cs +++ b/SGGL/BLL/CQMS/Check/TechnicalContactListApproveService.cs @@ -2,15 +2,15 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class TechnicalContactListApproveService { - public static Model.SGGLDB db = Funs.DB; public static Model.Check_TechnicalContactListApprove GetSee(string TechnicalContactListId, string userId) { - return db.Check_TechnicalContactListApprove.FirstOrDefault(x => x.TechnicalContactListId == TechnicalContactListId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); + return Funs.DB.Check_TechnicalContactListApprove.FirstOrDefault(x => x.TechnicalContactListId == TechnicalContactListId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); } public static void See(string TechnicalContactListId, string userId) { @@ -56,7 +56,7 @@ namespace BLL /// public static Model.Check_TechnicalContactListApprove GetApprove(string TechnicalContactListId) { - return db.Check_TechnicalContactListApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.TechnicalContactListId == TechnicalContactListId && x.ApproveType == BLL.Const.TechnicalContactList_Audit1); + return Funs.DB.Check_TechnicalContactListApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.TechnicalContactListId == TechnicalContactListId && x.ApproveType == BLL.Const.TechnicalContactList_Audit1); } /// @@ -125,7 +125,7 @@ namespace BLL /// 一个工程联络单审批实体 public static Model.Check_TechnicalContactListApprove GetTechnicalContactListApproveByTechnicalContactListId(string TechnicalContactListId) { - return db.Check_TechnicalContactListApprove.FirstOrDefault(x => x.TechnicalContactListId == TechnicalContactListId && x.ApproveDate == null && x.ApproveType != "S"); + return Funs.DB.Check_TechnicalContactListApprove.FirstOrDefault(x => x.TechnicalContactListId == TechnicalContactListId && x.ApproveDate == null && x.ApproveType != "S"); } /// /// 根据工程联络单审批编号获取一个工程联络单审批信息 @@ -134,7 +134,7 @@ namespace BLL /// 一个工程联络单审批实体 public static Model.Check_TechnicalContactListApprove GetTechnicalContactListApproveByApproveId(string approveId) { - return db.Check_TechnicalContactListApprove.FirstOrDefault(x => x.TechnicalContactListApproveId == approveId); + return Funs.DB.Check_TechnicalContactListApprove.FirstOrDefault(x => x.TechnicalContactListApproveId == approveId); } public static Model.Check_TechnicalContactListApprove GetTechnicalContactListApproveByApproveIdForApi(string approveId) { @@ -145,7 +145,7 @@ namespace BLL } public static Model.Check_TechnicalContactListApprove GetComplie(string TechnicalContactListId) { - return db.Check_TechnicalContactListApprove.FirstOrDefault(x => x.TechnicalContactListId == TechnicalContactListId && x.ApproveType == BLL.Const.TechnicalContactList_Compile); + return Funs.DB.Check_TechnicalContactListApprove.FirstOrDefault(x => x.TechnicalContactListId == TechnicalContactListId && x.ApproveType == BLL.Const.TechnicalContactList_Compile); } /// @@ -155,7 +155,7 @@ namespace BLL /// public static Model.Check_TechnicalContactListApprove GetApprove2(string TechnicalContactListId) { - return db.Check_TechnicalContactListApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.TechnicalContactListId == TechnicalContactListId && x.ApproveType == BLL.Const.TechnicalContactList_Audit3); + return Funs.DB.Check_TechnicalContactListApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.TechnicalContactListId == TechnicalContactListId && x.ApproveType == BLL.Const.TechnicalContactList_Audit3); } /// @@ -165,7 +165,7 @@ namespace BLL /// public static Model.Check_TechnicalContactListApprove GetApprove3(string TechnicalContactListId) { - return db.Check_TechnicalContactListApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.TechnicalContactListId == TechnicalContactListId && (x.ApproveType == BLL.Const.TechnicalContactList_Audit2 || x.ApproveType == BLL.Const.TechnicalContactList_Audit2H)); + return Funs.DB.Check_TechnicalContactListApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.TechnicalContactListId == TechnicalContactListId && (x.ApproveType == BLL.Const.TechnicalContactList_Audit2 || x.ApproveType == BLL.Const.TechnicalContactList_Audit2H)); } /// @@ -175,7 +175,7 @@ namespace BLL /// public static Model.Check_TechnicalContactListApprove GetApprove5(string TechnicalContactListId) { - return db.Check_TechnicalContactListApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.TechnicalContactListId == TechnicalContactListId && (x.ApproveType == BLL.Const.TechnicalContactList_Audit4 || x.ApproveType == BLL.Const.TechnicalContactList_Audit4R)); + return Funs.DB.Check_TechnicalContactListApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.TechnicalContactListId == TechnicalContactListId && (x.ApproveType == BLL.Const.TechnicalContactList_Audit4 || x.ApproveType == BLL.Const.TechnicalContactList_Audit4R)); } /// @@ -185,7 +185,7 @@ namespace BLL /// public static Model.Check_TechnicalContactListApprove GetApprove4(string TechnicalContactListId) { - return db.Check_TechnicalContactListApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.TechnicalContactListId == TechnicalContactListId && x.ApproveType == BLL.Const.TechnicalContactList_Audit6); + return Funs.DB.Check_TechnicalContactListApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.TechnicalContactListId == TechnicalContactListId && x.ApproveType == BLL.Const.TechnicalContactList_Audit6); } public static List GetListDataByIdForApi(string TechnicalContactListId) { diff --git a/SGGL/BLL/CQMS/Check/TechnicalContactListService.cs b/SGGL/BLL/CQMS/Check/TechnicalContactListService.cs index cbb35ce0..e650593b 100644 --- a/SGGL/BLL/CQMS/Check/TechnicalContactListService.cs +++ b/SGGL/BLL/CQMS/Check/TechnicalContactListService.cs @@ -4,13 +4,12 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Web.UI.WebControls; +using Model; namespace BLL { public class TechnicalContactListService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据工程联络单信息Id删除一个工程联络单信息信息 /// @@ -401,7 +400,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable qq = from x in db.Check_TechnicalContactList orderby x.CompileDate descending select x; + private static IQueryable qq = from x in Funs.DB.Check_TechnicalContactList orderby x.CompileDate descending select x; /// /// 获取分页列表 diff --git a/SGGL/BLL/CQMS/Material/CQMS_InspectionApproveService.cs b/SGGL/BLL/CQMS/Material/CQMS_InspectionApproveService.cs index a2bd5c12..086c41f6 100644 --- a/SGGL/BLL/CQMS/Material/CQMS_InspectionApproveService.cs +++ b/SGGL/BLL/CQMS/Material/CQMS_InspectionApproveService.cs @@ -2,12 +2,12 @@ using System.Collections.Generic; using System.Data; using System.Linq; +using Model; namespace BLL { public class CQMS_InspectionApproveService { - public static Model.SGGLDB db = Funs.DB; /// /// 获取报验管理模板列表 /// @@ -16,14 +16,15 @@ namespace BLL /// public static DataTable getListData(string InspectionId) { - var res = from x in db.Material_InspectionApprove + var db1 = Funs.DB; + var res = from x in db1.Material_InspectionApprove where x.InspectionId == InspectionId && x.ApproveDate != null && x.ApproveType != "S" orderby x.ApproveDate select new { x.InspectionApproveId, x.InspectionId, - ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + ApproveMan = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), x.ApproveDate, x.IsAgree, x.ApproveIdea, @@ -77,7 +78,7 @@ namespace BLL /// public static Model.Material_InspectionApprove GetSee(string InspectionId, string userId) { - return db.Material_InspectionApprove.FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); + return Funs.DB.Material_InspectionApprove.FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); } public static void See(string InspectionId, string userId) { @@ -98,11 +99,11 @@ namespace BLL /// 一个报验管理审批实体 public static Model.Material_InspectionApprove GetInspectionApproveByInspectionId(string InspectionId) { - return db.Material_InspectionApprove.FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType != "S" && x.ApproveDate == null); + return Funs.DB.Material_InspectionApprove.FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType != "S" && x.ApproveDate == null); } public static Model.Material_InspectionApprove GetAuditMan(string InspectionId, string state) { - return db.Material_InspectionApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType == state); + return Funs.DB.Material_InspectionApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType == state); } /// /// 修改报验管理审批信息 @@ -148,7 +149,7 @@ namespace BLL /// public static Model.Material_InspectionApprove GetAudit1(string InspectionId) { - return db.Material_InspectionApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType == BLL.Const.Inspection_Audit1); + return Funs.DB.Material_InspectionApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType == BLL.Const.Inspection_Audit1); } /// @@ -158,12 +159,12 @@ namespace BLL /// public static Model.Material_InspectionApprove GetAudit2(string InspectionId) { - return db.Material_InspectionApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType == BLL.Const.Inspection_Audit2); + return Funs.DB.Material_InspectionApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType == BLL.Const.Inspection_Audit2); } public static Model.Material_InspectionApprove GetComplie(string InspectionId) { - return db.Material_InspectionApprove.FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType == BLL.Const.Inspection_Compile); + return Funs.DB.Material_InspectionApprove.FirstOrDefault(x => x.InspectionId == InspectionId && x.ApproveType == BLL.Const.Inspection_Compile); } } } diff --git a/SGGL/BLL/CQMS/Meeting/CQMS_MeetingApproveService.cs b/SGGL/BLL/CQMS/Meeting/CQMS_MeetingApproveService.cs index 34ce2b01..73f74f84 100644 --- a/SGGL/BLL/CQMS/Meeting/CQMS_MeetingApproveService.cs +++ b/SGGL/BLL/CQMS/Meeting/CQMS_MeetingApproveService.cs @@ -2,12 +2,12 @@ using System.Collections.Generic; using System.Data; using System.Linq; +using Model; namespace BLL { public class CQMS_MeetingApproveService { - public static Model.SGGLDB db = Funs.DB; /// /// 获取质量会议模板列表 /// @@ -16,14 +16,15 @@ namespace BLL /// public static DataTable getListData(string MeetingId) { - var res = from x in db.Meeting_CQMSMeetingApprove + var db1 = Funs.DB; + var res = from x in db1.Meeting_CQMSMeetingApprove where x.MeetingId == MeetingId && x.ApproveDate != null && x.ApproveType != "S" orderby x.ApproveDate select new { x.MeetingApproveId, x.MeetingId, - ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + ApproveMan = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), x.ApproveDate, x.IsAgree, x.ApproveIdea, @@ -77,7 +78,7 @@ namespace BLL /// public static Model.Meeting_CQMSMeetingApprove GetSee(string MeetingId, string userId) { - return db.Meeting_CQMSMeetingApprove.FirstOrDefault(x => x.MeetingId == MeetingId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); + return Funs.DB.Meeting_CQMSMeetingApprove.FirstOrDefault(x => x.MeetingId == MeetingId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); } public static void See(string MeetingId, string userId) { @@ -110,11 +111,11 @@ namespace BLL /// 一个质量会议审批实体 public static Model.Meeting_CQMSMeetingApprove GetCQMSMeetingApproveByMeetingId(string MeetingId) { - return db.Meeting_CQMSMeetingApprove.FirstOrDefault(x => x.MeetingId == MeetingId && x.ApproveType != "S" && x.ApproveDate == null); + return Funs.DB.Meeting_CQMSMeetingApprove.FirstOrDefault(x => x.MeetingId == MeetingId && x.ApproveType != "S" && x.ApproveDate == null); } public static Model.Meeting_CQMSMeetingApprove GetAuditMan(string MeetingId, string state) { - return db.Meeting_CQMSMeetingApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.MeetingId == MeetingId && x.ApproveType == state); + return Funs.DB.Meeting_CQMSMeetingApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.MeetingId == MeetingId && x.ApproveType == state); } /// /// 修改质量会议审批信息 @@ -160,12 +161,12 @@ namespace BLL /// public static Model.Meeting_CQMSMeetingApprove GetAudit(string MeetingId) { - return db.Meeting_CQMSMeetingApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.MeetingId == MeetingId && x.ApproveType == BLL.Const.CQMSMeeting_Audit); + return Funs.DB.Meeting_CQMSMeetingApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.MeetingId == MeetingId && x.ApproveType == BLL.Const.CQMSMeeting_Audit); } public static Model.Meeting_CQMSMeetingApprove GetComplie(string MeetingId) { - return db.Meeting_CQMSMeetingApprove.FirstOrDefault(x => x.MeetingId == MeetingId && x.ApproveType == BLL.Const.CQMSMeeting_Compile); + return Funs.DB.Meeting_CQMSMeetingApprove.FirstOrDefault(x => x.MeetingId == MeetingId && x.ApproveType == BLL.Const.CQMSMeeting_Compile); } public static List GetListDataByIdForApi(string id) diff --git a/SGGL/BLL/CQMS/Meeting/CQMS_MeetingService.cs b/SGGL/BLL/CQMS/Meeting/CQMS_MeetingService.cs index 707d080d..1b122356 100644 --- a/SGGL/BLL/CQMS/Meeting/CQMS_MeetingService.cs +++ b/SGGL/BLL/CQMS/Meeting/CQMS_MeetingService.cs @@ -10,7 +10,7 @@ namespace BLL /// public static class CQMS_MeetingService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取质量会议 diff --git a/SGGL/BLL/CQMS/PersonManage/CQMS_TestPlanDetailService.cs b/SGGL/BLL/CQMS/PersonManage/CQMS_TestPlanDetailService.cs index f488bb01..1970f3e6 100644 --- a/SGGL/BLL/CQMS/PersonManage/CQMS_TestPlanDetailService.cs +++ b/SGGL/BLL/CQMS/PersonManage/CQMS_TestPlanDetailService.cs @@ -4,13 +4,12 @@ using System.Linq; using System.Text; using System.Threading.Tasks; using System.Collections; +using Model; namespace BLL { public class CQMS_TestPlanDetailService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取焊工考试计划明细列表 /// @@ -19,8 +18,9 @@ namespace BLL /// public static IEnumerable getListData(string TestPlanId) { - return from x in db.Welder_TestPlanDetail - join z in db.Welder_TestPlan on x.TestPlanId equals z.TestPlanId + var db1 = Funs.DB; + return from x in db1.Welder_TestPlanDetail + join z in db1.Welder_TestPlan on x.TestPlanId equals z.TestPlanId where x.TestPlanId == TestPlanId select new { @@ -32,11 +32,11 @@ namespace BLL x.IsAppearanceOK, IsAppearanceOKStr = x.IsAppearanceOK == null ? "" : (x.IsAppearanceOK == true ? "是" : "否"), x.CheckMan, - CheckManStr = (from y in db.SitePerson_Person where y.ProjectId == z.ProjectId && y.PersonId == x.CheckMan select y.PersonName).First(), + CheckManStr = (from y in db1.SitePerson_Person where y.ProjectId == z.ProjectId && y.PersonId == x.CheckMan select y.PersonName).First(), x.NDTResult, NDTResultStr = x.NDTResult == null ? "" : (x.NDTResult == true ? "合格" : "不合格"), x.CheckUnit, - CheckUnitStr = (from y in db.Base_Unit where y.UnitId == x.CheckUnit select y.UnitName).First(), + CheckUnitStr = (from y in db1.Base_Unit where y.UnitId == x.CheckUnit select y.UnitName).First(), x.State, StateStr = x.State == null ? "" : (x.State == true ? "合格" : "不合格"), }; @@ -50,7 +50,7 @@ namespace BLL /// public static List getPersonIdList(string TestPlanId) { - return (from x in db.Welder_TestPlanDetail + return (from x in Funs.DB.Welder_TestPlanDetail where x.TestPlanId == TestPlanId select x.PersonId).ToList(); } diff --git a/SGGL/BLL/CQMS/Plan/CQMS_MainPlanApproveService.cs b/SGGL/BLL/CQMS/Plan/CQMS_MainPlanApproveService.cs index a27b4b2f..4648a809 100644 --- a/SGGL/BLL/CQMS/Plan/CQMS_MainPlanApproveService.cs +++ b/SGGL/BLL/CQMS/Plan/CQMS_MainPlanApproveService.cs @@ -2,12 +2,12 @@ using System.Collections.Generic; using System.Data; using System.Linq; +using Model; namespace BLL { public class CQMS_MainPlanApproveService { - public static Model.SGGLDB db = Funs.DB; /// /// 获取总包施工计划模板列表 /// @@ -16,14 +16,15 @@ namespace BLL /// public static DataTable getListData(string MainPlanId) { - var res = from x in db.Plan_MainPlanApprove + var db1 = Funs.DB; + var res = from x in db1.Plan_MainPlanApprove where x.MainPlanId == MainPlanId && x.ApproveDate != null && x.ApproveType != "S" orderby x.ApproveDate select new { x.MainPlanApproveId, x.MainPlanId, - ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + ApproveMan = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), x.ApproveDate, x.IsAgree, x.ApproveIdea, @@ -77,7 +78,7 @@ namespace BLL /// public static Model.Plan_MainPlanApprove GetSee(string MainPlanId, string userId) { - return db.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); + return Funs.DB.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); } public static void See(string MainPlanId, string userId) { @@ -98,7 +99,7 @@ namespace BLL /// 一个总包施工计划审批实体 public static Model.Plan_MainPlanApprove GetMainPlanApproveByMainPlanId(string MainPlanId) { - return db.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType != "S" && x.ApproveDate == null); + return Funs.DB.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType != "S" && x.ApproveDate == null); } /// @@ -108,12 +109,12 @@ namespace BLL /// 总包施工计划审批集合 public static List GetMainPlanApprovesByMainPlanId(string MainPlanId) { - return (from x in db.Plan_MainPlanApprove where x.MainPlanId == MainPlanId && x.ApproveType != "S" && x.ApproveDate == null select x).ToList(); + return (from x in Funs.DB.Plan_MainPlanApprove where x.MainPlanId == MainPlanId && x.ApproveType != "S" && x.ApproveDate == null select x).ToList(); } public static Model.Plan_MainPlanApprove GetAuditMan(string MainPlanId, string state) { - return db.Plan_MainPlanApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType == state); + return Funs.DB.Plan_MainPlanApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType == state); } public static string GetHandleManName(string MainPlanId) { @@ -169,7 +170,7 @@ namespace BLL /// public static Model.Plan_MainPlanApprove GetAudit1(string MainPlanId) { - return db.Plan_MainPlanApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType == BLL.Const.MainPlan_Audit1); + return Funs.DB.Plan_MainPlanApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType == BLL.Const.MainPlan_Audit1); } /// @@ -200,7 +201,7 @@ namespace BLL /// public static Model.Plan_MainPlanApprove GetAudit3(string MainPlanId, string userId) { - return db.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveMan == userId && x.ApproveDate == null); + return Funs.DB.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveMan == userId && x.ApproveDate == null); } /// @@ -210,12 +211,12 @@ namespace BLL /// public static List GetAudit3PersonIds(string MainPlanId) { - return (from x in db.Plan_MainPlanApprove where x.MainPlanId == MainPlanId && x.ApproveType == BLL.Const.MainPlan_Audit3 select x.ApproveMan).ToList(); + return (from x in Funs.DB.Plan_MainPlanApprove where x.MainPlanId == MainPlanId && x.ApproveType == BLL.Const.MainPlan_Audit3 select x.ApproveMan).ToList(); } public static Model.Plan_MainPlanApprove GetComplie(string MainPlanId) { - return db.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType == BLL.Const.MainPlan_Compile); + return Funs.DB.Plan_MainPlanApprove.FirstOrDefault(x => x.MainPlanId == MainPlanId && x.ApproveType == BLL.Const.MainPlan_Compile); } public static List getApproveListDataByIdForApi(string MainPlanId) diff --git a/SGGL/BLL/CQMS/RewardAndPunish/RewardAndPunishApproveService.cs b/SGGL/BLL/CQMS/RewardAndPunish/RewardAndPunishApproveService.cs index b0e9ddb4..4c5338be 100644 --- a/SGGL/BLL/CQMS/RewardAndPunish/RewardAndPunishApproveService.cs +++ b/SGGL/BLL/CQMS/RewardAndPunish/RewardAndPunishApproveService.cs @@ -2,12 +2,12 @@ using System.Collections.Generic; using System.Data; using System.Linq; +using Model; namespace BLL { public class RewardAndPunishApproveService { - public static Model.SGGLDB db = Funs.DB; /// /// 获取质量奖罚模板列表 /// @@ -16,14 +16,15 @@ namespace BLL /// public static DataTable getListData(string RewardAndPunishId) { - var res = from x in db.RewardAndPunish_RewardAndPunishApprove + var db1 = Funs.DB; + var res = from x in db1.RewardAndPunish_RewardAndPunishApprove where x.RewardAndPunishId == RewardAndPunishId && x.ApproveDate != null && x.ApproveType != "S" orderby x.ApproveDate select new { x.RewardAndPunishApproveId, x.RewardAndPunishId, - ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + ApproveMan = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), x.ApproveDate, x.IsAgree, x.ApproveIdea, @@ -77,7 +78,7 @@ namespace BLL /// public static Model.RewardAndPunish_RewardAndPunishApprove GetSee(string RewardAndPunishId, string userId) { - return db.RewardAndPunish_RewardAndPunishApprove.FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); + return Funs.DB.RewardAndPunish_RewardAndPunishApprove.FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); } public static void See(string RewardAndPunishId, string userId) { @@ -98,11 +99,11 @@ namespace BLL /// 一个质量奖罚审批实体 public static Model.RewardAndPunish_RewardAndPunishApprove GetRewardAndPunishApproveByRewardAndPunishId(string RewardAndPunishId) { - return db.RewardAndPunish_RewardAndPunishApprove.FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType != "S" && x.ApproveDate == null); + return Funs.DB.RewardAndPunish_RewardAndPunishApprove.FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType != "S" && x.ApproveDate == null); } public static Model.RewardAndPunish_RewardAndPunishApprove GetAuditMan(string RewardAndPunishId, string state) { - return db.RewardAndPunish_RewardAndPunishApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType == state); + return Funs.DB.RewardAndPunish_RewardAndPunishApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType == state); } /// /// 修改质量奖罚审批信息 @@ -193,12 +194,12 @@ namespace BLL /// public static Model.RewardAndPunish_RewardAndPunishApprove GetAudit1(string RewardAndPunishId) { - return db.RewardAndPunish_RewardAndPunishApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType == BLL.Const.RewardAndPunish_Audit1); + return Funs.DB.RewardAndPunish_RewardAndPunishApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType == BLL.Const.RewardAndPunish_Audit1); } public static Model.RewardAndPunish_RewardAndPunishApprove GetComplie(string RewardAndPunishId) { - return db.RewardAndPunish_RewardAndPunishApprove.FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType == BLL.Const.RewardAndPunish_Compile); + return Funs.DB.RewardAndPunish_RewardAndPunishApprove.FirstOrDefault(x => x.RewardAndPunishId == RewardAndPunishId && x.ApproveType == BLL.Const.RewardAndPunish_Compile); } public static string GetHandleManName(string RewardAndPunishId) diff --git a/SGGL/BLL/CQMS/RewardAndPunish/RewardAndPunishService.cs b/SGGL/BLL/CQMS/RewardAndPunish/RewardAndPunishService.cs index d0f847df..a305ca85 100644 --- a/SGGL/BLL/CQMS/RewardAndPunish/RewardAndPunishService.cs +++ b/SGGL/BLL/CQMS/RewardAndPunish/RewardAndPunishService.cs @@ -10,7 +10,7 @@ namespace BLL /// public static class RewardAndPunishService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取质量奖罚 diff --git a/SGGL/BLL/CQMS/Unqualified/WorkContactApproveService.cs b/SGGL/BLL/CQMS/Unqualified/WorkContactApproveService.cs index d1b9be7d..a98472e3 100644 --- a/SGGL/BLL/CQMS/Unqualified/WorkContactApproveService.cs +++ b/SGGL/BLL/CQMS/Unqualified/WorkContactApproveService.cs @@ -2,32 +2,32 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class WorkContactApproveService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取分页列表 /// /// public static IEnumerable getListData(string workContactId) { - return from x in db.Unqualified_WorkContactApprove + var db1 = Funs.DB; + return from x in db1.Unqualified_WorkContactApprove where x.WorkContactId == workContactId && x.ApproveDate != null && x.ApproveType != "S" orderby x.ApproveDate select new { x.WorkContactApproveId, x.WorkContactId, - ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + ApproveMan = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), x.ApproveDate, x.ApproveIdea, x.IsAgree, x.ApproveType, - UserName = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + UserName = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), IsAgreeName = x.IsAgree == true ? "同意" : "不同意" }; } @@ -90,7 +90,7 @@ namespace BLL } public static Model.Unqualified_WorkContactApprove GetSee(string WorkContactId, string userId) { - return db.Unqualified_WorkContactApprove.FirstOrDefault(x => x.WorkContactId == WorkContactId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); + return Funs.DB.Unqualified_WorkContactApprove.FirstOrDefault(x => x.WorkContactId == WorkContactId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); } public static void See(string WorkContactId, string userId) { @@ -111,7 +111,7 @@ namespace BLL /// 一个工作联系单审批实体 public static Model.Unqualified_WorkContactApprove GetWorkContactApproveByWorkContactId(string noticeId) { - return db.Unqualified_WorkContactApprove.FirstOrDefault(x => x.WorkContactId == noticeId && x.ApproveDate == null && x.ApproveType != "S"); + return Funs.DB.Unqualified_WorkContactApprove.FirstOrDefault(x => x.WorkContactId == noticeId && x.ApproveDate == null && x.ApproveType != "S"); } /// /// 修改工作联系单审批信息 @@ -138,7 +138,7 @@ namespace BLL /// public static Model.Unqualified_WorkContactApprove GetAudit1(string workContactId) { - return db.Unqualified_WorkContactApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.WorkContactId == workContactId && x.ApproveType == BLL.Const.WorkContact_Audit1); + return Funs.DB.Unqualified_WorkContactApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.WorkContactId == workContactId && x.ApproveType == BLL.Const.WorkContact_Audit1); } /// @@ -148,7 +148,7 @@ namespace BLL /// public static Model.Unqualified_WorkContactApprove GetAudit2(string workContactId) { - return db.Unqualified_WorkContactApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.WorkContactId == workContactId && (x.ApproveType == BLL.Const.WorkContact_Audit2 || x.ApproveType == BLL.Const.WorkContact_Audit2R)); + return Funs.DB.Unqualified_WorkContactApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.WorkContactId == workContactId && (x.ApproveType == BLL.Const.WorkContact_Audit2 || x.ApproveType == BLL.Const.WorkContact_Audit2R)); } /// @@ -158,7 +158,7 @@ namespace BLL /// public static Model.Unqualified_WorkContactApprove GetAudit3(string workContactId) { - return db.Unqualified_WorkContactApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.WorkContactId == workContactId && x.ApproveType == BLL.Const.WorkContact_Audit3); + return Funs.DB.Unqualified_WorkContactApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.WorkContactId == workContactId && x.ApproveType == BLL.Const.WorkContact_Audit3); } /// @@ -168,12 +168,12 @@ namespace BLL /// public static Model.Unqualified_WorkContactApprove GetAudit4(string workContactId) { - return db.Unqualified_WorkContactApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.WorkContactId == workContactId && (x.ApproveType == BLL.Const.WorkContact_Audit4 || x.ApproveType == BLL.Const.WorkContact_Audit1R)); + return Funs.DB.Unqualified_WorkContactApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.WorkContactId == workContactId && (x.ApproveType == BLL.Const.WorkContact_Audit4 || x.ApproveType == BLL.Const.WorkContact_Audit1R)); } public static Model.Unqualified_WorkContactApprove GetComplie(string workContactId) { - return db.Unqualified_WorkContactApprove.FirstOrDefault(x => x.WorkContactId == workContactId && x.ApproveType == BLL.Const.WorkContact_Compile); + return Funs.DB.Unqualified_WorkContactApprove.FirstOrDefault(x => x.WorkContactId == workContactId && x.ApproveType == BLL.Const.WorkContact_Compile); } public static Model.Unqualified_WorkContactApprove GetWorkContactApproveById(string WorkContactApproveId) { diff --git a/SGGL/BLL/Common/AttachFileService.cs b/SGGL/BLL/Common/AttachFileService.cs index 874dd72d..e38782ca 100644 --- a/SGGL/BLL/Common/AttachFileService.cs +++ b/SGGL/BLL/Common/AttachFileService.cs @@ -8,8 +8,6 @@ namespace BLL { public static class AttachFileService { - public static Model.SGGLDB db = Funs.DB; - /// /// 添加附件存储信息 /// @@ -24,8 +22,9 @@ namespace BLL newAttachFile.AttachUrl = attachFile.AttachUrl; newAttachFile.MenuId = attachFile.MenuId; - db.AttachFile.InsertOnSubmit(newAttachFile); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.AttachFile.InsertOnSubmit(newAttachFile); + db1.SubmitChanges(); } /// @@ -34,12 +33,13 @@ namespace BLL /// public static void updateAttachFile(Model.AttachFile attachFile) { - Model.AttachFile newAttachFile = db.AttachFile.FirstOrDefault(x => x.AttachFileId == attachFile.AttachFileId); + var db1 = Funs.DB; + Model.AttachFile newAttachFile = db1.AttachFile.FirstOrDefault(x => x.AttachFileId == attachFile.AttachFileId); newAttachFile.ToKeyId = attachFile.ToKeyId; newAttachFile.AttachSource = attachFile.AttachSource; newAttachFile.AttachUrl = attachFile.AttachUrl; newAttachFile.MenuId = attachFile.MenuId; - db.SubmitChanges(); + db1.SubmitChanges(); } @@ -49,12 +49,13 @@ namespace BLL /// public static void DeleteAttachFile(string rootPath, string toKeyId, string menuId) { - Model.AttachFile att = db.AttachFile.FirstOrDefault(e => e.ToKeyId == toKeyId && e.MenuId == menuId); + var db1 = Funs.DB; + Model.AttachFile att = db1.AttachFile.FirstOrDefault(e => e.ToKeyId == toKeyId && e.MenuId == menuId); if (att != null) { BLL.UploadFileService.DeleteFile(rootPath, att.AttachUrl); - db.AttachFile.DeleteOnSubmit(att); - db.SubmitChanges(); + db1.AttachFile.DeleteOnSubmit(att); + db1.SubmitChanges(); } } diff --git a/SGGL/BLL/Common/ProjectDataFlowSetService.cs b/SGGL/BLL/Common/ProjectDataFlowSetService.cs index 0fa8dcba..10e39813 100644 --- a/SGGL/BLL/Common/ProjectDataFlowSetService.cs +++ b/SGGL/BLL/Common/ProjectDataFlowSetService.cs @@ -1,4 +1,6 @@ -namespace BLL +using Model; + +namespace BLL { using System; using System.Collections; @@ -9,7 +11,6 @@ /// public static class ProjectDataFlowSetService { - public static Model.SGGLDB db = Funs.DB; /// /// 记录数 /// @@ -27,7 +28,7 @@ /// public static IEnumerable getListData(string dataId, int startRowIndex, int maximumRows) { - IQueryable q = from x in db.View_ProjectData_FlowOperate + IQueryable q = from x in Funs.DB.View_ProjectData_FlowOperate where x.DataId == dataId && x.IsClosed == true orderby x.SortIndex descending select x; @@ -289,7 +290,7 @@ /// 主表主键Id public static bool IsExitOperate(string menuId, string dataId) { - return (from x in db.ProjectData_FlowOperate + return (from x in Funs.DB.ProjectData_FlowOperate where x.MenuId == menuId && x.DataId == dataId select x).Count() > 0; } @@ -311,7 +312,7 @@ /// public static void CloseFlowOperate(string menuId, string dataId, string opinion) { - var updateUnFlowOperate = db.ProjectData_FlowOperate.FirstOrDefault(x => x.MenuId == menuId && x.DataId == dataId && (x.IsClosed == false || !x.IsClosed.HasValue)); + var updateUnFlowOperate = Funs.DB.ProjectData_FlowOperate.FirstOrDefault(x => x.MenuId == menuId && x.DataId == dataId && (x.IsClosed == false || !x.IsClosed.HasValue)); if (updateUnFlowOperate != null) { updateUnFlowOperate.OperaterTime = DateTime.Now; diff --git a/SGGL/BLL/Common/WeatherService.cs b/SGGL/BLL/Common/WeatherService.cs index 576047e0..cc194d10 100644 --- a/SGGL/BLL/Common/WeatherService.cs +++ b/SGGL/BLL/Common/WeatherService.cs @@ -9,7 +9,7 @@ namespace BLL /// public class WeatherService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取事故类型 diff --git a/SGGL/BLL/DigData/CQMSDataCollectService.cs b/SGGL/BLL/DigData/CQMSDataCollectService.cs index a079ce4e..f9d1d57a 100644 --- a/SGGL/BLL/DigData/CQMSDataCollectService.cs +++ b/SGGL/BLL/DigData/CQMSDataCollectService.cs @@ -8,8 +8,6 @@ namespace BLL /// public static class CQMSDataCollectService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据主键获取项目质量数据汇总 /// @@ -172,8 +170,9 @@ namespace BLL ProjectId = project.ProjectId, }; - db.DigData_CQMSDataCollectSubmission.InsertOnSubmit(newSubmission); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.DigData_CQMSDataCollectSubmission.InsertOnSubmit(newSubmission); + db1.SubmitChanges(); } #endregion } diff --git a/SGGL/BLL/DigData/CQMSDataDWService .cs b/SGGL/BLL/DigData/CQMSDataDWService .cs index 074789db..394a110a 100644 --- a/SGGL/BLL/DigData/CQMSDataDWService .cs +++ b/SGGL/BLL/DigData/CQMSDataDWService .cs @@ -2,6 +2,7 @@ using System; using System.Collections; using System.Linq; +using Model; namespace BLL { @@ -10,8 +11,6 @@ namespace BLL /// public static class CQMSDataDWService { - public static Model.SGGLDB db = Funs.DB; - #region 质量数据仓库 /// /// 记录数 @@ -25,7 +24,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.Base_Project + private static IQueryable getDataLists = from x in Funs.DB.Base_Project where x.ProjectState == Const.ProjectState_1 select x; diff --git a/SGGL/BLL/DigData/HSEDataCollectService.cs b/SGGL/BLL/DigData/HSEDataCollectService.cs index b7523ad5..af2ee5ee 100644 --- a/SGGL/BLL/DigData/HSEDataCollectService.cs +++ b/SGGL/BLL/DigData/HSEDataCollectService.cs @@ -8,8 +8,6 @@ namespace BLL /// public static class HSEDataCollectService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据主键获取项目HSE数据汇总 /// @@ -172,8 +170,9 @@ namespace BLL ProjectId = project.ProjectId, }; - db.DigData_HSEDataCollectSubmission.InsertOnSubmit(newSubmission); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.DigData_HSEDataCollectSubmission.InsertOnSubmit(newSubmission); + db1.SubmitChanges(); } #endregion } diff --git a/SGGL/BLL/DigData/HSEDataDWService.cs b/SGGL/BLL/DigData/HSEDataDWService.cs index 0e5d0ebf..0803eba6 100644 --- a/SGGL/BLL/DigData/HSEDataDWService.cs +++ b/SGGL/BLL/DigData/HSEDataDWService.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using System.Linq; +using Model; namespace BLL { @@ -10,8 +11,6 @@ namespace BLL /// public static class HSEDataDWService { - public static Model.SGGLDB db = Funs.DB; - #region 安全数据仓库 /// /// 记录数 @@ -25,7 +24,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.Base_Project + private static IQueryable getDataLists = from x in Funs.DB.Base_Project where x.ProjectState == Const.ProjectState_1 select x; @@ -51,15 +50,16 @@ namespace BLL return null; } getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + var db1 = Funs.DB; return from x in getDataList select new { x.ProjectId, x.ProjectName, x.ProjectCode, - Count1=db.SitePerson_Person.Where(p=>p.ProjectId == x.ProjectId && p.States == Const.ProjectPersonStates_1).Count(), //人员数量 + Count1=db1.SitePerson_Person.Where(p=>p.ProjectId == x.ProjectId && p.States == Const.ProjectPersonStates_1).Count(), //人员数量 Count2 = getProjecctSafeHours(x.ProjectId), //安全人工时 - Count3 =db.EduTrain_TrainRecord.Where(p => p.ProjectId == x.ProjectId && p.States == BLL.Const.State_2).Count(), //安全培训次数 + Count3 =db1.EduTrain_TrainRecord.Where(p => p.ProjectId == x.ProjectId && p.States == BLL.Const.State_2).Count(), //安全培训次数 ProblemRate = getProblemRate(x.ProjectId), //安全巡检整改率 }; } diff --git a/SGGL/BLL/DigData/HTGLDataDWService.cs b/SGGL/BLL/DigData/HTGLDataDWService.cs index 592f7e2a..72324a87 100644 --- a/SGGL/BLL/DigData/HTGLDataDWService.cs +++ b/SGGL/BLL/DigData/HTGLDataDWService.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using System.Linq; +using Model; namespace BLL { @@ -10,8 +11,6 @@ namespace BLL /// public static class HTGLDataDWService { - public static Model.SGGLDB db = Funs.DB; - #region 合同管理数据仓库 /// /// 记录数 @@ -25,7 +24,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.Base_Project + private static IQueryable getDataLists = from x in Funs.DB.Base_Project select x; /// diff --git a/SGGL/BLL/DigData/JDGLDataDWService.cs b/SGGL/BLL/DigData/JDGLDataDWService.cs index c993cc47..9fae9a90 100644 --- a/SGGL/BLL/DigData/JDGLDataDWService.cs +++ b/SGGL/BLL/DigData/JDGLDataDWService.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using System.Linq; +using Model; namespace BLL { @@ -10,8 +11,6 @@ namespace BLL /// public static class JDGLDataDWService { - public static Model.SGGLDB db = Funs.DB; - #region 进度数据仓库 /// /// 记录数 @@ -25,7 +24,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.Base_Project + private static IQueryable getDataLists = from x in Funs.DB.Base_Project select x; /// diff --git a/SGGL/BLL/DigData/ProblemAnalysisService.cs b/SGGL/BLL/DigData/ProblemAnalysisService.cs index 34f38f81..83367bf0 100644 --- a/SGGL/BLL/DigData/ProblemAnalysisService.cs +++ b/SGGL/BLL/DigData/ProblemAnalysisService.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { @@ -9,8 +10,6 @@ namespace BLL /// public static class ProblemAnalysisService { - public static Model.SGGLDB db = Funs.DB; - #region AnalysisColumn /// /// 统计列 @@ -56,7 +55,7 @@ namespace BLL /// /// 安全巡检 /// - public static IQueryable getHazardRegisterLists = from x in db.HSSE_Hazard_HazardRegister + public static IQueryable getHazardRegisterLists = from x in Funs.DB.HSSE_Hazard_HazardRegister where x.States != Const.State_4 && x.ProjectId != Const.Project_TestProjectId && x.ProjectId != null select x; /// @@ -163,7 +162,7 @@ namespace BLL } else { - var getTypes = from x in db.HSSE_Hazard_HazardRegisterTypes + var getTypes = from x in Funs.DB.HSSE_Hazard_HazardRegisterTypes where x.HazardRegisterType == type orderby x.TypeCode select x; @@ -252,7 +251,7 @@ namespace BLL /// /// 隐患整改单 /// - public static IQueryable getRectifyNoticesLists = from x in db.Check_RectifyNotices + public static IQueryable getRectifyNoticesLists = from x in Funs.DB.Check_RectifyNotices where x.States != Const.State_0 && x.States != null && x.ProjectId != Const.Project_TestProjectId && x.ProjectId != null select x; /// @@ -409,13 +408,13 @@ namespace BLL /// /// 教育培训 /// - public static IQueryable getTrainRecordLists = from x in db.EduTrain_TrainRecord + public static IQueryable getTrainRecordLists = from x in Funs.DB.EduTrain_TrainRecord where x.ProjectId != Const.Project_TestProjectId && x.ProjectId != null select x; /// /// 教育培训明细 /// - public static IQueryable getTrainRecordDetailLists = from x in db.EduTrain_TrainRecordDetail + public static IQueryable getTrainRecordDetailLists = from x in Funs.DB.EduTrain_TrainRecordDetail select x; /// /// 教育培训统计 diff --git a/SGGL/BLL/DigData/ProjectWBSAnalysisService.cs b/SGGL/BLL/DigData/ProjectWBSAnalysisService.cs index 44b0b565..0f2411fb 100644 --- a/SGGL/BLL/DigData/ProjectWBSAnalysisService.cs +++ b/SGGL/BLL/DigData/ProjectWBSAnalysisService.cs @@ -5,6 +5,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Web.Util; +using Model; namespace BLL { @@ -13,8 +14,6 @@ namespace BLL /// public static class ProjectWBSAnalysisService { - public static Model.SGGLDB db = Funs.DB; - #region WBS分析 /// /// 记录数 @@ -28,7 +27,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.WBS_WorkPackage + private static IQueryable getDataLists = from x in Funs.DB.WBS_WorkPackage where x.IsApprove == true select x; @@ -64,9 +63,10 @@ namespace BLL } else { + var db1 = Funs.DB; if (workPackageId != "1" && workPackageId != "2") { - var getUnitWork = db.WBS_UnitWork.FirstOrDefault(x => x.ProjectId == projectId && x.UnitWorkId == workPackageId); + var getUnitWork = db1.WBS_UnitWork.FirstOrDefault(x => x.ProjectId == projectId && x.UnitWorkId == workPackageId); if (getUnitWork != null) { getDataList = getDataList.Where(x => x.UnitWorkId == workPackageId && x.SuperWorkPack == null); @@ -82,7 +82,7 @@ namespace BLL } else { - var getUnitWork = from x in db.WBS_UnitWork + var getUnitWork = from x in db1.WBS_UnitWork where x.ProjectId == projectId && x.SuperUnitWork == null && x.ProjectType == workPackageId select x; List listWork = new List(); diff --git a/SGGL/BLL/DigData/WBSAnalysisService.cs b/SGGL/BLL/DigData/WBSAnalysisService.cs index 9a4b5123..219290ec 100644 --- a/SGGL/BLL/DigData/WBSAnalysisService.cs +++ b/SGGL/BLL/DigData/WBSAnalysisService.cs @@ -5,6 +5,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { @@ -13,8 +14,6 @@ namespace BLL /// public static class WBSAnalysisService { - public static Model.SGGLDB db = Funs.DB; - #region WBS分析 /// /// 记录数 @@ -28,7 +27,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.WBS_WorkPackageInit + private static IQueryable getDataLists = from x in Funs.DB.WBS_WorkPackageInit select x; /// diff --git a/SGGL/BLL/Doc/DocService.cs b/SGGL/BLL/Doc/DocService.cs index b05b5ba7..37a3b0f3 100644 --- a/SGGL/BLL/Doc/DocService.cs +++ b/SGGL/BLL/Doc/DocService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class DocService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取帮助文档 diff --git a/SGGL/BLL/HJGL/DataImport/HJGL_DesignBasisDataImport.cs b/SGGL/BLL/HJGL/DataImport/HJGL_DesignBasisDataImport.cs index f1979a70..f29a9430 100644 --- a/SGGL/BLL/HJGL/DataImport/HJGL_DesignBasisDataImport.cs +++ b/SGGL/BLL/HJGL/DataImport/HJGL_DesignBasisDataImport.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; +using Model; namespace BLL @@ -11,8 +12,6 @@ namespace BLL public static class HJGL_DesignBasisDataImportService { - public static Model.SGGLDB db = Funs.DB; - #region 获取列表 /// /// 记录数 @@ -30,7 +29,7 @@ namespace BLL /// public static IEnumerable getListData(string name, Grid Grid1) { - IQueryable q1 = from x in db.HJGL_DesignBasisDataImport select x; + IQueryable q1 = from x in Funs.DB.HJGL_DesignBasisDataImport select x; if (!string.IsNullOrEmpty(name)) { q1 = q1.Where(e => e.DesignBasisDataImportId.Contains(name)); @@ -64,11 +63,11 @@ namespace BLL public static Model.HJGL_DesignBasisDataImport GetHJGL_DesignBasisDataImportById(string DesignBasisDataImportId) { - return db.HJGL_DesignBasisDataImport.FirstOrDefault(x => x.DesignBasisDataImportId == DesignBasisDataImportId); + return Funs.DB.HJGL_DesignBasisDataImport.FirstOrDefault(x => x.DesignBasisDataImportId == DesignBasisDataImportId); } public static List GetDataByUnitWorkIdAndVersion(string unitworkid,decimal version,string dataclassification) { - var q = db.HJGL_DesignBasisDataImport.Where(e => e.UnitWorkId == unitworkid && e.Version == version&& e.DataClassification==dataclassification).OrderBy(e => e.CreateDate).ToList(); + var q = Funs.DB.HJGL_DesignBasisDataImport.Where(e => e.UnitWorkId == unitworkid && e.Version == version&& e.DataClassification==dataclassification).OrderBy(e => e.CreateDate).ToList(); return q; @@ -105,8 +104,9 @@ namespace BLL CreateMan = newtable.CreateMan, CreateDate = newtable.CreateDate, }; - db.HJGL_DesignBasisDataImport.InsertOnSubmit(table); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.HJGL_DesignBasisDataImport.InsertOnSubmit(table); + db1.SubmitChanges(); } public static List GetListVersionByUnitWorkId(string UnitWorkId,string dataclassification) { @@ -154,8 +154,8 @@ namespace BLL public static void UpdateHJGL_DesignBasisDataImport(Model.HJGL_DesignBasisDataImport newtable) { - - Model.HJGL_DesignBasisDataImport table = db.HJGL_DesignBasisDataImport.FirstOrDefault(x => x.DesignBasisDataImportId == newtable.DesignBasisDataImportId); + var db1 = Funs.DB; + Model.HJGL_DesignBasisDataImport table = db1.HJGL_DesignBasisDataImport.FirstOrDefault(x => x.DesignBasisDataImportId == newtable.DesignBasisDataImportId); if (table != null) { table.DesignBasisDataImportId = newtable.DesignBasisDataImportId; @@ -172,18 +172,18 @@ namespace BLL table.DataClassification = newtable.DataClassification; table.CreateMan = newtable.CreateMan; table.CreateDate = newtable.CreateDate; - db.SubmitChanges(); + db1.SubmitChanges(); } } public static void DeleteHJGL_DesignBasisDataImportById(string DesignBasisDataImportId) { - - Model.HJGL_DesignBasisDataImport table = db.HJGL_DesignBasisDataImport.FirstOrDefault(x => x.DesignBasisDataImportId == DesignBasisDataImportId); + var db1 = Funs.DB; + Model.HJGL_DesignBasisDataImport table = db1.HJGL_DesignBasisDataImport.FirstOrDefault(x => x.DesignBasisDataImportId == DesignBasisDataImportId); if (table != null) { - db.HJGL_DesignBasisDataImport.DeleteOnSubmit(table); - db.SubmitChanges(); + db1.HJGL_DesignBasisDataImport.DeleteOnSubmit(table); + db1.SubmitChanges(); } } diff --git a/SGGL/BLL/HJGL/DataImport/HJGL_DesignBasisDataImportVerSionLog.cs b/SGGL/BLL/HJGL/DataImport/HJGL_DesignBasisDataImportVerSionLog.cs index b7cb7de5..fa959a7a 100644 --- a/SGGL/BLL/HJGL/DataImport/HJGL_DesignBasisDataImportVerSionLog.cs +++ b/SGGL/BLL/HJGL/DataImport/HJGL_DesignBasisDataImportVerSionLog.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; +using Model; namespace BLL @@ -11,17 +12,14 @@ namespace BLL public static class HJGL_DesignBasisDataImportVerSionLogService { - public static Model.SGGLDB db = Funs.DB; - - public static Model.HJGL_DesignBasisDataImportVerSionLog GetHJGL_DesignBasisDataImportVerSionLogById(string DesignBasisDataImportVerSionLogId) { - return db.HJGL_DesignBasisDataImportVerSionLog.FirstOrDefault(x => x.DesignBasisDataImportVerSionLogId == DesignBasisDataImportVerSionLogId); + return Funs.DB.HJGL_DesignBasisDataImportVerSionLog.FirstOrDefault(x => x.DesignBasisDataImportVerSionLogId == DesignBasisDataImportVerSionLogId); } public static Model.HJGL_DesignBasisDataImportVerSionLog GetHJGL_DesignBasisDataImportVerSionLogByunitworkId(string unitworkId,string DataClassification) { - var q = db.HJGL_DesignBasisDataImportVerSionLog.FirstOrDefault(x => x.UnitWorkId == unitworkId&&x.DataClassification== DataClassification); + var q = Funs.DB.HJGL_DesignBasisDataImportVerSionLog.FirstOrDefault(x => x.UnitWorkId == unitworkId&&x.DataClassification== DataClassification); return q; } @@ -36,15 +34,16 @@ namespace BLL Version = newtable.Version, DataClassification = newtable.DataClassification, }; - db.HJGL_DesignBasisDataImportVerSionLog.InsertOnSubmit(table); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.HJGL_DesignBasisDataImportVerSionLog.InsertOnSubmit(table); + db1.SubmitChanges(); } public static void UpdateHJGL_DesignBasisDataImportVerSionLog(Model.HJGL_DesignBasisDataImportVerSionLog newtable) { - - Model.HJGL_DesignBasisDataImportVerSionLog table = db.HJGL_DesignBasisDataImportVerSionLog.FirstOrDefault(x => x.DesignBasisDataImportVerSionLogId == newtable.DesignBasisDataImportVerSionLogId); + var db1 = Funs.DB; + Model.HJGL_DesignBasisDataImportVerSionLog table = db1.HJGL_DesignBasisDataImportVerSionLog.FirstOrDefault(x => x.DesignBasisDataImportVerSionLogId == newtable.DesignBasisDataImportVerSionLogId); if (table != null) { table.DesignBasisDataImportVerSionLogId = newtable.DesignBasisDataImportVerSionLogId; @@ -52,7 +51,7 @@ namespace BLL table.UnitWorkId = newtable.UnitWorkId; table.Version = newtable.Version; table.DataClassification=newtable.DataClassification; - db.SubmitChanges(); + db1.SubmitChanges(); } } @@ -61,10 +60,11 @@ namespace BLL public static void UpdateVersion(string projectId,string unitworkId,decimal version,string DataClassification) { var q = GetHJGL_DesignBasisDataImportVerSionLogByunitworkId(unitworkId,DataClassification); + var db1 = Funs.DB; if (q!=null) { q.Version = version; - db.SubmitChanges(); + db1.SubmitChanges(); } else @@ -77,8 +77,8 @@ namespace BLL Version = version, DataClassification= DataClassification }; - db.HJGL_DesignBasisDataImportVerSionLog.InsertOnSubmit(table); - db.SubmitChanges(); + db1.HJGL_DesignBasisDataImportVerSionLog.InsertOnSubmit(table); + db1.SubmitChanges(); } @@ -86,12 +86,12 @@ namespace BLL } public static void DeleteHJGL_DesignBasisDataImportVerSionLogById(string DesignBasisDataImportVerSionLogId) { - - Model.HJGL_DesignBasisDataImportVerSionLog table = db.HJGL_DesignBasisDataImportVerSionLog.FirstOrDefault(x => x.DesignBasisDataImportVerSionLogId == DesignBasisDataImportVerSionLogId); + var db1 = Funs.DB; + Model.HJGL_DesignBasisDataImportVerSionLog table = db1.HJGL_DesignBasisDataImportVerSionLog.FirstOrDefault(x => x.DesignBasisDataImportVerSionLogId == DesignBasisDataImportVerSionLogId); if (table != null) { - db.HJGL_DesignBasisDataImportVerSionLog.DeleteOnSubmit(table); - db.SubmitChanges(); + db1.HJGL_DesignBasisDataImportVerSionLog.DeleteOnSubmit(table); + db1.SubmitChanges(); } } diff --git a/SGGL/BLL/HJGL/PreDesign/PackagingManageService .cs b/SGGL/BLL/HJGL/PreDesign/PackagingManageService .cs index a15714f9..9e8d18c3 100644 --- a/SGGL/BLL/HJGL/PreDesign/PackagingManageService .cs +++ b/SGGL/BLL/HJGL/PreDesign/PackagingManageService .cs @@ -35,7 +35,7 @@ namespace BLL } - public static Model.SGGLDB db = Funs.DB; + /// /// 未到场 /// @@ -73,9 +73,10 @@ namespace BLL /// public static IEnumerable getListData(string name, Grid Grid1) { - IQueryable q1 = (from x in db.HJGL_PackagingManage - join y in db.HJGL_Pipeline_Component on x.PipelineComponentId equals y.PipelineComponentId - join z in db.HJGL_Pipeline on y.PipelineId equals z.PipelineId + var db1 = Funs.DB; + IQueryable q1 = (from x in db1.HJGL_PackagingManage + join y in db1.HJGL_Pipeline_Component on x.PipelineComponentId equals y.PipelineComponentId + join z in db1.HJGL_Pipeline on y.PipelineId equals z.PipelineId select x ); if (!string.IsNullOrEmpty(name)) @@ -234,15 +235,16 @@ namespace BLL ReceiveMan = newtable.ReceiveMan, TrainNumber = newtable.TrainNumber }; - db.HJGL_PackagingManage.InsertOnSubmit(table); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.HJGL_PackagingManage.InsertOnSubmit(table); + db1.SubmitChanges(); } public static void UpdateHJGL_PackagingManage(Model.HJGL_PackagingManage newtable) { - - Model.HJGL_PackagingManage table = db.HJGL_PackagingManage.FirstOrDefault(x => x.PackagingManageId == newtable.PackagingManageId); + var db1 = Funs.DB; + Model.HJGL_PackagingManage table = db1.HJGL_PackagingManage.FirstOrDefault(x => x.PackagingManageId == newtable.PackagingManageId); if (table != null) { table.PackagingManageId = newtable.PackagingManageId; @@ -257,18 +259,18 @@ namespace BLL table.ReceiveMan = newtable.ReceiveMan; table.ReceiveDate = newtable.ReceiveDate; table.TrainNumber = newtable.TrainNumber; - db.SubmitChanges(); + db1.SubmitChanges(); } } public static void DeleteHJGL_PackagingManageById(string PackagingManageId) { - - Model.HJGL_PackagingManage table = db.HJGL_PackagingManage.FirstOrDefault(x => x.PackagingManageId == PackagingManageId); + var db1 = Funs.DB; + Model.HJGL_PackagingManage table = db1.HJGL_PackagingManage.FirstOrDefault(x => x.PackagingManageId == PackagingManageId); if (table != null) { - db.HJGL_PackagingManage.DeleteOnSubmit(table); - db.SubmitChanges(); + db1.HJGL_PackagingManage.DeleteOnSubmit(table); + db1.SubmitChanges(); } } diff --git a/SGGL/BLL/HJGL/TestPackage/TestPackageApproveService.cs b/SGGL/BLL/HJGL/TestPackage/TestPackageApproveService.cs index 4e1ca690..d053e15c 100644 --- a/SGGL/BLL/HJGL/TestPackage/TestPackageApproveService.cs +++ b/SGGL/BLL/HJGL/TestPackage/TestPackageApproveService.cs @@ -1,14 +1,14 @@ using System.Data; using System.Linq; +using Model; namespace BLL { public class TestPackageApproveService { - public static Model.SGGLDB db = Funs.DB; public static Model.PTP_TestPackageApprove GetTestPackageApproveById(string ItemEndCheckListId) { - return db.PTP_TestPackageApprove.FirstOrDefault(x => x.ItemEndCheckListId == ItemEndCheckListId && x.ApproveDate == null); + return Funs.DB.PTP_TestPackageApprove.FirstOrDefault(x => x.ItemEndCheckListId == ItemEndCheckListId && x.ApproveDate == null); } /// /// 修改尾项检查审批信息 diff --git a/SGGL/BLL/HJGL/WeldingManage/HJGL_ComponentJointService.cs b/SGGL/BLL/HJGL/WeldingManage/HJGL_ComponentJointService.cs index bb1997c3..fc6da622 100644 --- a/SGGL/BLL/HJGL/WeldingManage/HJGL_ComponentJointService.cs +++ b/SGGL/BLL/HJGL/WeldingManage/HJGL_ComponentJointService.cs @@ -11,7 +11,7 @@ namespace BLL public static class HJGL_PipelineComponentjointService { - public static Model.SGGLDB db = Funs.DB; + #region 获取列表 @@ -25,7 +25,7 @@ namespace BLL } public static List GetHJGL_Pipeline_ComponentJointByModle(Model.HJGL_Pipeline_ComponentJoint table) { - var q = from x in db.HJGL_Pipeline_ComponentJoint + var q = from x in Funs.DB.HJGL_Pipeline_ComponentJoint where (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && (string.IsNullOrEmpty(table.PipelineComponentId) || x.PipelineComponentId.Contains(table.PipelineComponentId)) && @@ -69,11 +69,11 @@ namespace BLL public static Model.HJGL_Pipeline_ComponentJoint GetHJGL_Pipeline_ComponentJointById(string Id) { - return db.HJGL_Pipeline_ComponentJoint.FirstOrDefault(x => x.Id == Id); + return Funs.DB.HJGL_Pipeline_ComponentJoint.FirstOrDefault(x => x.Id == Id); } public static Model.HJGL_Pipeline_ComponentJoint GetHJGL_Pipeline_ComponentJointByWeldJointId(string WeldJointId) { - return db.HJGL_Pipeline_ComponentJoint.FirstOrDefault(x => x.WeldJointId == WeldJointId); + return Funs.DB.HJGL_Pipeline_ComponentJoint.FirstOrDefault(x => x.WeldJointId == WeldJointId); } public static void AddHJGL_Pipeline_ComponentJoint(Model.HJGL_Pipeline_ComponentJoint newtable) @@ -88,22 +88,22 @@ namespace BLL WeldJointCode = newtable.WeldJointCode, State = newtable.State, }; - db.HJGL_Pipeline_ComponentJoint.InsertOnSubmit(table); - db.SubmitChanges(); + Funs.DB.HJGL_Pipeline_ComponentJoint.InsertOnSubmit(table); + Funs.DB.SubmitChanges(); } public static void AddBulkHJGL_Pipeline_ComponentJoint(List newtables) { - db.HJGL_Pipeline_ComponentJoint.InsertAllOnSubmit(newtables); - db.SubmitChanges(); + Funs.DB.HJGL_Pipeline_ComponentJoint.InsertAllOnSubmit(newtables); + Funs.DB.SubmitChanges(); } public static void UpdateHJGL_Pipeline_ComponentJoint(Model.HJGL_Pipeline_ComponentJoint newtable) { - Model.HJGL_Pipeline_ComponentJoint table = db.HJGL_Pipeline_ComponentJoint.FirstOrDefault(x => x.Id == newtable.Id); + Model.HJGL_Pipeline_ComponentJoint table = Funs.DB.HJGL_Pipeline_ComponentJoint.FirstOrDefault(x => x.Id == newtable.Id); if (table != null) { table.Id = newtable.Id; @@ -112,7 +112,7 @@ namespace BLL table.WeldJointId = newtable.WeldJointId; table.WeldJointCode = newtable.WeldJointCode; table.State = newtable.State; - db.SubmitChanges(); + Funs.DB.SubmitChanges(); } } @@ -123,18 +123,18 @@ namespace BLL public static void UpdateStateByWeldJointId(string WeldJointId,DateTime TaskDate) { - Model.HJGL_Pipeline_ComponentJoint table = db.HJGL_Pipeline_ComponentJoint.FirstOrDefault(x => x.WeldJointId == WeldJointId); + Model.HJGL_Pipeline_ComponentJoint table = Funs.DB.HJGL_Pipeline_ComponentJoint.FirstOrDefault(x => x.WeldJointId == WeldJointId); if (table != null) { table.State =1; - db.SubmitChanges(); + Funs.DB.SubmitChanges(); GetProductionByPipelineComponentId(table.PipelineComponentId, TaskDate); } } public static void GetProductionByPipelineComponentId(string PipelineComponentId, DateTime TaskDate) { - var q = db.HJGL_Pipeline_ComponentJoint.Where(x => x.PipelineComponentId == PipelineComponentId).ToList(); + var q = Funs.DB.HJGL_Pipeline_ComponentJoint.Where(x => x.PipelineComponentId == PipelineComponentId).ToList(); if (q.Count!=0) { var NotProductionNum = (from x in q where x.State == 0 select x).Count(); //未生产数量 @@ -161,31 +161,31 @@ namespace BLL public static void DeleteHJGL_Pipeline_ComponentJointById(string Id) { - Model.HJGL_Pipeline_ComponentJoint table = db.HJGL_Pipeline_ComponentJoint.FirstOrDefault(x => x.Id == Id); + Model.HJGL_Pipeline_ComponentJoint table = Funs.DB.HJGL_Pipeline_ComponentJoint.FirstOrDefault(x => x.Id == Id); if (table != null) { - db.HJGL_Pipeline_ComponentJoint.DeleteOnSubmit(table); - db.SubmitChanges(); + Funs.DB.HJGL_Pipeline_ComponentJoint.DeleteOnSubmit(table); + Funs.DB.SubmitChanges(); } } public static void DeleteHJGL_Pipeline_ComponentJointByPipelineComponentId(string PipelineComponentId) { - var table = db.HJGL_Pipeline_ComponentJoint.Where(x => x.PipelineComponentId == PipelineComponentId); + var table = Funs.DB.HJGL_Pipeline_ComponentJoint.Where(x => x.PipelineComponentId == PipelineComponentId); if (table != null) { - db.HJGL_Pipeline_ComponentJoint.DeleteAllOnSubmit(table); - db.SubmitChanges(); + Funs.DB.HJGL_Pipeline_ComponentJoint.DeleteAllOnSubmit(table); + Funs.DB.SubmitChanges(); } } public static void DeleteALLHJGL_Pipeline_ComponentJoint() { - if (db.HJGL_Pipeline_ComponentJoint != null) + if (Funs.DB.HJGL_Pipeline_ComponentJoint != null) { - db.HJGL_Pipeline_ComponentJoint.DeleteAllOnSubmit(db.HJGL_Pipeline_ComponentJoint); - db.SubmitChanges(); + Funs.DB.HJGL_Pipeline_ComponentJoint.DeleteAllOnSubmit(Funs.DB.HJGL_Pipeline_ComponentJoint); + Funs.DB.SubmitChanges(); } } diff --git a/SGGL/BLL/HSSE/Accident/AccidentHandleService.cs b/SGGL/BLL/HSSE/Accident/AccidentHandleService.cs index 87ccbd5b..380f2d1c 100644 --- a/SGGL/BLL/HSSE/Accident/AccidentHandleService.cs +++ b/SGGL/BLL/HSSE/Accident/AccidentHandleService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class AccidentHandleService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取HSSE事故(含未遂)处理 diff --git a/SGGL/BLL/HSSE/Accident/AccidentPersonRecordService.cs b/SGGL/BLL/HSSE/Accident/AccidentPersonRecordService.cs index 06cdf486..50e1e080 100644 --- a/SGGL/BLL/HSSE/Accident/AccidentPersonRecordService.cs +++ b/SGGL/BLL/HSSE/Accident/AccidentPersonRecordService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class AccidentPersonRecordService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取HSSE事故(对人员)记录 diff --git a/SGGL/BLL/HSSE/Accident/AccidentReportOtherService.cs b/SGGL/BLL/HSSE/Accident/AccidentReportOtherService.cs index 048e8dc5..97d3b7c9 100644 --- a/SGGL/BLL/HSSE/Accident/AccidentReportOtherService.cs +++ b/SGGL/BLL/HSSE/Accident/AccidentReportOtherService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class AccidentReportOtherService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取事故调查处理报告 diff --git a/SGGL/BLL/HSSE/Accident/AccidentReportService.cs b/SGGL/BLL/HSSE/Accident/AccidentReportService.cs index d76e271a..cfb8a4a9 100644 --- a/SGGL/BLL/HSSE/Accident/AccidentReportService.cs +++ b/SGGL/BLL/HSSE/Accident/AccidentReportService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class AccidentReportService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取事故调查报告 diff --git a/SGGL/BLL/HSSE/Accident/NoFourLetoffService.cs b/SGGL/BLL/HSSE/Accident/NoFourLetoffService.cs index 1d608c2c..c8b25545 100644 --- a/SGGL/BLL/HSSE/Accident/NoFourLetoffService.cs +++ b/SGGL/BLL/HSSE/Accident/NoFourLetoffService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class NoFourLetoffService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取四不放过 diff --git a/SGGL/BLL/HSSE/Check/Check_CheckColligationDetailService.cs b/SGGL/BLL/HSSE/Check/Check_CheckColligationDetailService.cs index 39d750fc..5f7a8a1f 100644 --- a/SGGL/BLL/HSSE/Check/Check_CheckColligationDetailService.cs +++ b/SGGL/BLL/HSSE/Check/Check_CheckColligationDetailService.cs @@ -8,7 +8,7 @@ namespace BLL /// public class Check_CheckColligationDetailService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据综合检查id获取所有相关明细信息 diff --git a/SGGL/BLL/HSSE/Check/Check_CheckSpecialDetailService.cs b/SGGL/BLL/HSSE/Check/Check_CheckSpecialDetailService.cs index 89159771..04556b37 100644 --- a/SGGL/BLL/HSSE/Check/Check_CheckSpecialDetailService.cs +++ b/SGGL/BLL/HSSE/Check/Check_CheckSpecialDetailService.cs @@ -8,7 +8,7 @@ namespace BLL /// public class Check_CheckSpecialDetailService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据专项检查id获取所有相关明细信息 diff --git a/SGGL/BLL/HSSE/Check/Check_CheckSpecialService.cs b/SGGL/BLL/HSSE/Check/Check_CheckSpecialService.cs index c8563043..73d4e40b 100644 --- a/SGGL/BLL/HSSE/Check/Check_CheckSpecialService.cs +++ b/SGGL/BLL/HSSE/Check/Check_CheckSpecialService.cs @@ -4,6 +4,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { @@ -12,8 +13,6 @@ namespace BLL /// public static class Check_CheckSpecialService { - public static Model.SGGLDB db = Funs.DB; - #region 获取专项检查列表信息 /// /// 记录数 @@ -27,7 +26,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.Check_CheckSpecial + private static IQueryable getDataLists = from x in Funs.DB.Check_CheckSpecial select x; /// @@ -90,7 +89,7 @@ namespace BLL x.CheckSpecialId, x.CheckTime, x.CheckSpecialCode, - CheckItemName =db.Technique_CheckItemSet .First(y=>y.CheckItemSetId ==x. CheckItemSetId).CheckItemName, + CheckItemName =Funs.DB.Technique_CheckItemSet .First(y=>y.CheckItemSetId ==x. CheckItemSetId).CheckItemName, CheckTypeName = x.CheckType == "1" ? "联合检查" : "专项检查", StatesName = x.States == "2" ? "已完成" : (x.States == "1" ? "待整改" : "待提交"), }; diff --git a/SGGL/BLL/HSSE/Check/Check_ProjectLeaderCheckService.cs b/SGGL/BLL/HSSE/Check/Check_ProjectLeaderCheckService.cs index 00b98cce..f761e310 100644 --- a/SGGL/BLL/HSSE/Check/Check_ProjectLeaderCheckService.cs +++ b/SGGL/BLL/HSSE/Check/Check_ProjectLeaderCheckService.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Web.UI.WebControls; +using Model; namespace BLL { @@ -12,8 +13,6 @@ namespace BLL /// public static class Check_ProjectLeaderCheckService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据主键获取领导带班检查 /// @@ -37,7 +36,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.Check_ProjectLeaderCheck + private static IQueryable getDataLists = from x in Funs.DB.Check_ProjectLeaderCheck select x; /// @@ -75,15 +74,16 @@ namespace BLL return null; } getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + var db1 = Funs.DB; return from x in getDataList - join y in db.Base_Project on x.ProjectId equals y.ProjectId + join y in db1.Base_Project on x.ProjectId equals y.ProjectId into ps from y in ps.DefaultIfEmpty() select new { x.ProjectLeaderCheckId, x.ProjectId, - db.Base_Project.First(u => u.ProjectId == x.ProjectId).ProjectName, + db1.Base_Project.First(u => u.ProjectId == x.ProjectId).ProjectName, x.CheckCode, x.UnitIds, x.LeaderIds, diff --git a/SGGL/BLL/HSSE/Check/IncentiveNoticeService.cs b/SGGL/BLL/HSSE/Check/IncentiveNoticeService.cs index f1ccfada..c2ee3e19 100644 --- a/SGGL/BLL/HSSE/Check/IncentiveNoticeService.cs +++ b/SGGL/BLL/HSSE/Check/IncentiveNoticeService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class IncentiveNoticeService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取奖励通知单 diff --git a/SGGL/BLL/HSSE/Check/PunishNoticeService.cs b/SGGL/BLL/HSSE/Check/PunishNoticeService.cs index c0cdd1c0..e990caa9 100644 --- a/SGGL/BLL/HSSE/Check/PunishNoticeService.cs +++ b/SGGL/BLL/HSSE/Check/PunishNoticeService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class PunishNoticeService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取处罚通知单 diff --git a/SGGL/BLL/HSSE/CostGoods/CostManageItemService.cs b/SGGL/BLL/HSSE/CostGoods/CostManageItemService.cs index 63151d75..e3d24cd0 100644 --- a/SGGL/BLL/HSSE/CostGoods/CostManageItemService.cs +++ b/SGGL/BLL/HSSE/CostGoods/CostManageItemService.cs @@ -10,7 +10,7 @@ namespace BLL /// public static class CostManageItemService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键删除费用管理明细 diff --git a/SGGL/BLL/HSSE/CostGoods/CostManageService.cs b/SGGL/BLL/HSSE/CostGoods/CostManageService.cs index c44075ea..f8921e18 100644 --- a/SGGL/BLL/HSSE/CostGoods/CostManageService.cs +++ b/SGGL/BLL/HSSE/CostGoods/CostManageService.cs @@ -11,7 +11,7 @@ namespace BLL /// public static class CostManageService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取安全费用管理 diff --git a/SGGL/BLL/HSSE/CostGoods/CostSmallDetailItemService.cs b/SGGL/BLL/HSSE/CostGoods/CostSmallDetailItemService.cs index 09fdbd81..37fdb646 100644 --- a/SGGL/BLL/HSSE/CostGoods/CostSmallDetailItemService.cs +++ b/SGGL/BLL/HSSE/CostGoods/CostSmallDetailItemService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class CostSmallDetailItemService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取安全费用投入登记明细 diff --git a/SGGL/BLL/HSSE/CostGoods/CostSmallDetailService.cs b/SGGL/BLL/HSSE/CostGoods/CostSmallDetailService.cs index 49e7d317..3e00df41 100644 --- a/SGGL/BLL/HSSE/CostGoods/CostSmallDetailService.cs +++ b/SGGL/BLL/HSSE/CostGoods/CostSmallDetailService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class CostSmallDetailService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取安全费用投入登记 diff --git a/SGGL/BLL/HSSE/CostGoods/ExpenseService.cs b/SGGL/BLL/HSSE/CostGoods/ExpenseService.cs index 08f22e67..decd801a 100644 --- a/SGGL/BLL/HSSE/CostGoods/ExpenseService.cs +++ b/SGGL/BLL/HSSE/CostGoods/ExpenseService.cs @@ -9,8 +9,6 @@ namespace BLL /// public static class ExpenseService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据主键获取措施费用使用计划 /// @@ -171,8 +169,9 @@ namespace BLL Year = Year, }; - db.CostGoods_Expense.InsertOnSubmit(newExpense); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.CostGoods_Expense.InsertOnSubmit(newExpense); + db1.SubmitChanges(); } } } diff --git a/SGGL/BLL/HSSE/EduTrain/AccidentCaseItemService.cs b/SGGL/BLL/HSSE/EduTrain/AccidentCaseItemService.cs index 134d4986..a73d23c9 100644 --- a/SGGL/BLL/HSSE/EduTrain/AccidentCaseItemService.cs +++ b/SGGL/BLL/HSSE/EduTrain/AccidentCaseItemService.cs @@ -5,7 +5,7 @@ namespace BLL { public class AccidentCaseItemService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据常见事故案例明细Id获取事故案例明细 diff --git a/SGGL/BLL/HSSE/EduTrain/AccidentCaseService.cs b/SGGL/BLL/HSSE/EduTrain/AccidentCaseService.cs index 22204979..81f83935 100644 --- a/SGGL/BLL/HSSE/EduTrain/AccidentCaseService.cs +++ b/SGGL/BLL/HSSE/EduTrain/AccidentCaseService.cs @@ -5,7 +5,7 @@ namespace BLL { public class AccidentCaseService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取事故伤害及预防 diff --git a/SGGL/BLL/HSSE/EduTrain/CompanyTrainingItemService.cs b/SGGL/BLL/HSSE/EduTrain/CompanyTrainingItemService.cs index c19b150c..5b282b88 100644 --- a/SGGL/BLL/HSSE/EduTrain/CompanyTrainingItemService.cs +++ b/SGGL/BLL/HSSE/EduTrain/CompanyTrainingItemService.cs @@ -1,4 +1,5 @@ using System.Linq; +using Model; namespace BLL { @@ -7,8 +8,6 @@ namespace BLL /// public class CompanyTrainingItemService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据主键获取公司培训明细信息 /// @@ -16,7 +15,7 @@ namespace BLL /// public static Model.Training_CompanyTrainingItem GetCompanyTrainingItemById(string companyTrainingItemId) { - return db.Training_CompanyTrainingItem.FirstOrDefault(e => e.CompanyTrainingItemId == companyTrainingItemId); + return Funs.DB.Training_CompanyTrainingItem.FirstOrDefault(e => e.CompanyTrainingItemId == companyTrainingItemId); } /// @@ -33,8 +32,9 @@ namespace BLL newCompanyTrainingItem.AttachUrl = companyTrainingItem.AttachUrl; newCompanyTrainingItem.CompileMan = companyTrainingItem.CompileMan; newCompanyTrainingItem.CompileDate = companyTrainingItem.CompileDate; - db.Training_CompanyTrainingItem.InsertOnSubmit(newCompanyTrainingItem); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Training_CompanyTrainingItem.InsertOnSubmit(newCompanyTrainingItem); + db1.SubmitChanges(); } /// @@ -43,7 +43,8 @@ namespace BLL /// public static void UpdateCompanyTrainingItem(Model.Training_CompanyTrainingItem companyTrainingItem) { - Model.Training_CompanyTrainingItem newCompanyTrainingItem = db.Training_CompanyTrainingItem.FirstOrDefault(e => e.CompanyTrainingItemId == companyTrainingItem.CompanyTrainingItemId); + var db1 = Funs.DB; + Model.Training_CompanyTrainingItem newCompanyTrainingItem = db1.Training_CompanyTrainingItem.FirstOrDefault(e => e.CompanyTrainingItemId == companyTrainingItem.CompanyTrainingItemId); if (newCompanyTrainingItem != null) { newCompanyTrainingItem.CompanyTrainingItemCode = companyTrainingItem.CompanyTrainingItemCode; @@ -51,7 +52,7 @@ namespace BLL newCompanyTrainingItem.AttachUrl = companyTrainingItem.AttachUrl; newCompanyTrainingItem.CompileMan = companyTrainingItem.CompileMan; newCompanyTrainingItem.CompileDate = companyTrainingItem.CompileDate; - db.SubmitChanges(); + db1.SubmitChanges(); } } @@ -61,11 +62,12 @@ namespace BLL /// public static void DeleteCompanyTrainingItemById(string companyTrainItemId) { - Model.Training_CompanyTrainingItem companyTrainingItem = db.Training_CompanyTrainingItem.FirstOrDefault(e => e.CompanyTrainingItemId == companyTrainItemId); + var db1 = Funs.DB; + Model.Training_CompanyTrainingItem companyTrainingItem = db1.Training_CompanyTrainingItem.FirstOrDefault(e => e.CompanyTrainingItemId == companyTrainItemId); if (companyTrainingItem != null) { - db.Training_CompanyTrainingItem.DeleteOnSubmit(companyTrainingItem); - db.SubmitChanges(); + db1.Training_CompanyTrainingItem.DeleteOnSubmit(companyTrainingItem); + db1.SubmitChanges(); } } } diff --git a/SGGL/BLL/HSSE/EduTrain/CompanyTrainingService.cs b/SGGL/BLL/HSSE/EduTrain/CompanyTrainingService.cs index aa0b9f4d..a472317e 100644 --- a/SGGL/BLL/HSSE/EduTrain/CompanyTrainingService.cs +++ b/SGGL/BLL/HSSE/EduTrain/CompanyTrainingService.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { @@ -8,8 +9,6 @@ namespace BLL /// public class CompanyTrainingService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据主键获取公司培训 /// @@ -17,7 +16,7 @@ namespace BLL /// public static Model.Training_CompanyTraining GetCompanyTrainingById(string companyTrainingId) { - return db.Training_CompanyTraining.FirstOrDefault(e => e.CompanyTrainingId == companyTrainingId); + return Funs.DB.Training_CompanyTraining.FirstOrDefault(e => e.CompanyTrainingId == companyTrainingId); } /// @@ -32,8 +31,9 @@ namespace BLL newCompanyTraining.CompanyTrainingName = companyTraining.CompanyTrainingName; newCompanyTraining.SupCompanyTrainingId = companyTraining.SupCompanyTrainingId; newCompanyTraining.IsEndLever = companyTraining.IsEndLever; - db.Training_CompanyTraining.InsertOnSubmit(newCompanyTraining); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Training_CompanyTraining.InsertOnSubmit(newCompanyTraining); + db1.SubmitChanges(); } /// @@ -42,14 +42,15 @@ namespace BLL /// public static void UpdateCompanyTraining(Model.Training_CompanyTraining companyTraining) { - Model.Training_CompanyTraining newCompanyTraining = db.Training_CompanyTraining.FirstOrDefault(e => e.CompanyTrainingId == companyTraining.CompanyTrainingId); + var db1 = Funs.DB; + Model.Training_CompanyTraining newCompanyTraining = db1.Training_CompanyTraining.FirstOrDefault(e => e.CompanyTrainingId == companyTraining.CompanyTrainingId); if (newCompanyTraining != null) { newCompanyTraining.CompanyTrainingCode = companyTraining.CompanyTrainingCode; newCompanyTraining.CompanyTrainingName = companyTraining.CompanyTrainingName; newCompanyTraining.SupCompanyTrainingId = companyTraining.SupCompanyTrainingId; newCompanyTraining.IsEndLever = companyTraining.IsEndLever; - db.SubmitChanges(); + db1.SubmitChanges(); } } @@ -59,11 +60,12 @@ namespace BLL /// public static void DeleteCompanyTraining(string companyTrainingId) { - Model.Training_CompanyTraining companyTraining = db.Training_CompanyTraining.FirstOrDefault(e => e.CompanyTrainingId == companyTrainingId); + var db1 = Funs.DB; + Model.Training_CompanyTraining companyTraining = db1.Training_CompanyTraining.FirstOrDefault(e => e.CompanyTrainingId == companyTrainingId); if (companyTraining != null) { - db.Training_CompanyTraining.DeleteOnSubmit(companyTraining); - db.SubmitChanges(); + db1.Training_CompanyTraining.DeleteOnSubmit(companyTraining); + db1.SubmitChanges(); } } diff --git a/SGGL/BLL/HSSE/EduTrain/EduTrain_TrainRecordDetailService.cs b/SGGL/BLL/HSSE/EduTrain/EduTrain_TrainRecordDetailService.cs index 46e55b3d..da11a58e 100644 --- a/SGGL/BLL/HSSE/EduTrain/EduTrain_TrainRecordDetailService.cs +++ b/SGGL/BLL/HSSE/EduTrain/EduTrain_TrainRecordDetailService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class EduTrain_TrainRecordDetailService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据教育培训主键获取所有的教育培训明细信息 diff --git a/SGGL/BLL/HSSE/EduTrain/EduTrain_TrainRecordService.cs b/SGGL/BLL/HSSE/EduTrain/EduTrain_TrainRecordService.cs index cc7a3036..4f3f02ce 100644 --- a/SGGL/BLL/HSSE/EduTrain/EduTrain_TrainRecordService.cs +++ b/SGGL/BLL/HSSE/EduTrain/EduTrain_TrainRecordService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class EduTrain_TrainRecordService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据教育培训主键获取教育培训信息 diff --git a/SGGL/BLL/HSSE/EduTrain/EduTrain_TrainTestService.cs b/SGGL/BLL/HSSE/EduTrain/EduTrain_TrainTestService.cs index bd057046..e58fd1e3 100644 --- a/SGGL/BLL/HSSE/EduTrain/EduTrain_TrainTestService.cs +++ b/SGGL/BLL/HSSE/EduTrain/EduTrain_TrainTestService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class EduTrain_TrainTestService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据教育培训主键获取所有的教育培训明细信息 diff --git a/SGGL/BLL/HSSE/EduTrain/TestPlanService.cs b/SGGL/BLL/HSSE/EduTrain/TestPlanService.cs index 9a4e0b80..e951a993 100644 --- a/SGGL/BLL/HSSE/EduTrain/TestPlanService.cs +++ b/SGGL/BLL/HSSE/EduTrain/TestPlanService.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { @@ -8,8 +9,6 @@ namespace BLL /// public static class TestPlanService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据主键获取培训计划 /// @@ -53,8 +52,9 @@ namespace BLL States = testPlan.States }; - db.Training_TestPlan.InsertOnSubmit(newTestPlan); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Training_TestPlan.InsertOnSubmit(newTestPlan); + db1.SubmitChanges(); } /// @@ -63,7 +63,8 @@ namespace BLL /// public static void UpdateTestPlan(Model.Training_TestPlan TestPlan) { - Model.Training_TestPlan newTestPlan = db.Training_TestPlan.FirstOrDefault(e => e.TestPlanId == TestPlan.TestPlanId); + var db1 = Funs.DB; + Model.Training_TestPlan newTestPlan = db1.Training_TestPlan.FirstOrDefault(e => e.TestPlanId == TestPlan.TestPlanId); if (newTestPlan != null) { newTestPlan.PlanCode = TestPlan.PlanCode; @@ -83,7 +84,7 @@ namespace BLL newTestPlan.WorkPostIds = TestPlan.WorkPostIds; newTestPlan.WorkPostNames = TestPlan.WorkPostNames; newTestPlan.States = TestPlan.States; - db.SubmitChanges(); + db1.SubmitChanges(); } } @@ -138,7 +139,7 @@ namespace BLL /// public static List GetTestPlanList() { - return (from x in db.Training_TestPlan orderby x.PlanCode select x).ToList(); + return (from x in Funs.DB.Training_TestPlan orderby x.PlanCode select x).ToList(); } /// diff --git a/SGGL/BLL/HSSE/EduTrain/TestRecordItemService.cs b/SGGL/BLL/HSSE/EduTrain/TestRecordItemService.cs index 0f11f2d4..8f396171 100644 --- a/SGGL/BLL/HSSE/EduTrain/TestRecordItemService.cs +++ b/SGGL/BLL/HSSE/EduTrain/TestRecordItemService.cs @@ -7,8 +7,6 @@ namespace BLL /// public static class TestRecordItemService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据考试记录Id获取明细信息 /// @@ -25,11 +23,12 @@ namespace BLL /// public static void DeleteTestRecordItemmByTestRecordItemId(string testRecordItemId) { - var testRecordItem = db.Training_TestRecordItem.FirstOrDefault(x => x.TestRecordItemId == testRecordItemId); + var db1 = Funs.DB; + var testRecordItem = db1.Training_TestRecordItem.FirstOrDefault(x => x.TestRecordItemId == testRecordItemId); if (testRecordItem != null) { - db.Training_TestRecordItem.DeleteOnSubmit(testRecordItem); - db.SubmitChanges(); + db1.Training_TestRecordItem.DeleteOnSubmit(testRecordItem); + db1.SubmitChanges(); } } } diff --git a/SGGL/BLL/HSSE/EduTrain/TestRecordService.cs b/SGGL/BLL/HSSE/EduTrain/TestRecordService.cs index 3651d324..32f7241d 100644 --- a/SGGL/BLL/HSSE/EduTrain/TestRecordService.cs +++ b/SGGL/BLL/HSSE/EduTrain/TestRecordService.cs @@ -2,6 +2,7 @@ using System; using System.Collections; using System.Linq; +using Model; namespace BLL { @@ -10,8 +11,6 @@ namespace BLL /// public static class TestRecordService { - public static Model.SGGLDB db = Funs.DB; - #region 获取列表数据 /// /// 记录数 @@ -25,7 +24,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.Training_TestRecord + private static IQueryable getDataLists = from x in Funs.DB.Training_TestRecord where x.TestStartTime.HasValue select x; @@ -44,16 +43,17 @@ namespace BLL return null; } getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + var db1 = Funs.DB; return from x in getDataList - join y in db.Training_TestPlan on x.TestPlanId equals y.TestPlanId - join z in db.Training_Plan on y.PlanId equals z.PlanId into g + join y in db1.Training_TestPlan on x.TestPlanId equals y.TestPlanId + join z in db1.Training_Plan on y.PlanId equals z.PlanId into g from z in g.DefaultIfEmpty() select new { x.TestRecordId, x.TestPlanId, x.ProjectId, - db.Base_Project.First(p => p.ProjectId == x.ProjectId).ProjectName, + db1.Base_Project.First(p => p.ProjectId == x.ProjectId).ProjectName, y.PlanName, y.PlanCode, y.TestPalce, @@ -62,7 +62,7 @@ namespace BLL x.TestEndTime, x.TestScores, z.TrainTypeId, - db.Base_TrainType.First(u=>u.TrainTypeId == z.TrainTypeId).TrainTypeName, + db1.Base_TrainType.First(u=>u.TrainTypeId == z.TrainTypeId).TrainTypeName, z.TrainStartDate, }; } diff --git a/SGGL/BLL/HSSE/EduTrain/TestTrainingItemService.cs b/SGGL/BLL/HSSE/EduTrain/TestTrainingItemService.cs index dd5b0fe2..55aa4fef 100644 --- a/SGGL/BLL/HSSE/EduTrain/TestTrainingItemService.cs +++ b/SGGL/BLL/HSSE/EduTrain/TestTrainingItemService.cs @@ -5,7 +5,7 @@ namespace BLL { public static class TestTrainingItemService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取信息 diff --git a/SGGL/BLL/HSSE/EduTrain/TestTrainingService.cs b/SGGL/BLL/HSSE/EduTrain/TestTrainingService.cs index be66d2e7..8a9f4ce4 100644 --- a/SGGL/BLL/HSSE/EduTrain/TestTrainingService.cs +++ b/SGGL/BLL/HSSE/EduTrain/TestTrainingService.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public static class TestTrainingService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据主键获取信息 /// @@ -86,7 +85,7 @@ namespace BLL /// public static List GetTestTrainingList() { - return (from x in db.Training_TestTraining orderby x.TrainingCode select x).ToList(); + return (from x in Funs.DB.Training_TestTraining orderby x.TrainingCode select x).ToList(); } /// @@ -95,7 +94,7 @@ namespace BLL /// public static List GetEndTestTrainingList() { - return (from x in db.Training_TestTraining + return (from x in Funs.DB.Training_TestTraining where x.IsEndLever == true orderby x.TrainingCode select x).ToList(); diff --git a/SGGL/BLL/HSSE/EduTrain/TrainTestDBItemService.cs b/SGGL/BLL/HSSE/EduTrain/TrainTestDBItemService.cs index 994d3b0e..65370871 100644 --- a/SGGL/BLL/HSSE/EduTrain/TrainTestDBItemService.cs +++ b/SGGL/BLL/HSSE/EduTrain/TrainTestDBItemService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class TrainTestDBItemService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键删除安全试题库明细信息 diff --git a/SGGL/BLL/HSSE/EduTrain/TrainTestDBService.cs b/SGGL/BLL/HSSE/EduTrain/TrainTestDBService.cs index 1d07cfa8..6c9225d9 100644 --- a/SGGL/BLL/HSSE/EduTrain/TrainTestDBService.cs +++ b/SGGL/BLL/HSSE/EduTrain/TrainTestDBService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class TrainTestDBService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取安全试题库信息 diff --git a/SGGL/BLL/HSSE/EduTrain/TrainingItemService.cs b/SGGL/BLL/HSSE/EduTrain/TrainingItemService.cs index 33088e68..faabeb05 100644 --- a/SGGL/BLL/HSSE/EduTrain/TrainingItemService.cs +++ b/SGGL/BLL/HSSE/EduTrain/TrainingItemService.cs @@ -5,7 +5,7 @@ namespace BLL { public class TrainingItemService { - public static Model.SGGLDB db = Funs.DB; + /// /// diff --git a/SGGL/BLL/HSSE/EduTrain/TrainingPlanItemService.cs b/SGGL/BLL/HSSE/EduTrain/TrainingPlanItemService.cs index edc42587..819b3a53 100644 --- a/SGGL/BLL/HSSE/EduTrain/TrainingPlanItemService.cs +++ b/SGGL/BLL/HSSE/EduTrain/TrainingPlanItemService.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { @@ -8,8 +9,6 @@ namespace BLL /// public static class TrainingPlanItemService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据培训计划明细表Id获取所有相关明细信息 /// @@ -17,7 +16,7 @@ namespace BLL /// public static List GetPlanItemByPlanId(string planId) { - return (from x in db.Training_PlanItem where x.PlanId == planId select x).ToList(); + return (from x in Funs.DB.Training_PlanItem where x.PlanId == planId select x).ToList(); } /// @@ -32,8 +31,9 @@ namespace BLL PlanId = planItem.PlanId, TrainingEduId = planItem.TrainingEduId }; - db.Training_PlanItem.InsertOnSubmit(newPlanItem); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Training_PlanItem.InsertOnSubmit(newPlanItem); + db1.SubmitChanges(); } /// @@ -42,11 +42,12 @@ namespace BLL /// public static void DeletePlanItemById(string planItemId) { - var planItem = db.Training_PlanItem.FirstOrDefault(e => e.PlanItemId == planItemId); + var db1 = Funs.DB; + var planItem = db1.Training_PlanItem.FirstOrDefault(e => e.PlanItemId == planItemId); if (planItem != null) { - db.Training_PlanItem.DeleteOnSubmit(planItem); - db.SubmitChanges(); + db1.Training_PlanItem.DeleteOnSubmit(planItem); + db1.SubmitChanges(); } } diff --git a/SGGL/BLL/HSSE/EduTrain/TrainingPlanService.cs b/SGGL/BLL/HSSE/EduTrain/TrainingPlanService.cs index ce9def51..88fe6465 100644 --- a/SGGL/BLL/HSSE/EduTrain/TrainingPlanService.cs +++ b/SGGL/BLL/HSSE/EduTrain/TrainingPlanService.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { @@ -8,8 +9,6 @@ namespace BLL /// public static class TrainingPlanService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据主键获取培训计划 /// @@ -36,8 +35,9 @@ namespace BLL WorkPostId = plan.WorkPostId, States = plan.States }; - db.Training_Plan.InsertOnSubmit(newPlan); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Training_Plan.InsertOnSubmit(newPlan); + db1.SubmitChanges(); } /// @@ -80,7 +80,7 @@ namespace BLL /// public static List GetPlanList() { - return (from x in db.Training_Plan orderby x.PlanCode select x).ToList(); + return (from x in Funs.DB.Training_Plan orderby x.PlanCode select x).ToList(); } } } diff --git a/SGGL/BLL/HSSE/EduTrain/TrainingService.cs b/SGGL/BLL/HSSE/EduTrain/TrainingService.cs index d0697a58..805236b3 100644 --- a/SGGL/BLL/HSSE/EduTrain/TrainingService.cs +++ b/SGGL/BLL/HSSE/EduTrain/TrainingService.cs @@ -5,7 +5,7 @@ namespace BLL { public class TrainingService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据上级Id查询所有教育培训主键列的值 diff --git a/SGGL/BLL/HSSE/EduTrain/TrainingTaskService.cs b/SGGL/BLL/HSSE/EduTrain/TrainingTaskService.cs index a86b9378..25854680 100644 --- a/SGGL/BLL/HSSE/EduTrain/TrainingTaskService.cs +++ b/SGGL/BLL/HSSE/EduTrain/TrainingTaskService.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { @@ -8,8 +9,6 @@ namespace BLL /// public static class TrainingTaskService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据主键获取培训任务 /// @@ -17,7 +16,7 @@ namespace BLL /// public static Model.Training_Task GetTaskById(string taskId) { - return db.Training_Task.FirstOrDefault(e => e.TaskId == taskId); + return Funs.DB.Training_Task.FirstOrDefault(e => e.TaskId == taskId); } /// @@ -44,8 +43,9 @@ namespace BLL TaskDate = task.TaskDate, States = task.States }; - db.Training_Task.InsertOnSubmit(newTask); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Training_Task.InsertOnSubmit(newTask); + db1.SubmitChanges(); } /// @@ -71,11 +71,12 @@ namespace BLL /// public static void DeleteTaskById(string taskId) { - Model.Training_Task task = db.Training_Task.FirstOrDefault(e => e.TaskId == taskId); + var db1 = Funs.DB; + Model.Training_Task task = db1.Training_Task.FirstOrDefault(e => e.TaskId == taskId); if (task != null) { - db.Training_Task.DeleteOnSubmit(task); - db.SubmitChanges(); + db1.Training_Task.DeleteOnSubmit(task); + db1.SubmitChanges(); } } diff --git a/SGGL/BLL/HSSE/Emergency/DrillRecordListService.cs b/SGGL/BLL/HSSE/Emergency/DrillRecordListService.cs index 0a7950b8..75566100 100644 --- a/SGGL/BLL/HSSE/Emergency/DrillRecordListService.cs +++ b/SGGL/BLL/HSSE/Emergency/DrillRecordListService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class DrillRecordListService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取应急演练 diff --git a/SGGL/BLL/HSSE/Emergency/EmergencyListService.cs b/SGGL/BLL/HSSE/Emergency/EmergencyListService.cs index 4612e2fe..eb4db2ba 100644 --- a/SGGL/BLL/HSSE/Emergency/EmergencyListService.cs +++ b/SGGL/BLL/HSSE/Emergency/EmergencyListService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class EmergencyListService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取应急预案管理 diff --git a/SGGL/BLL/HSSE/Emergency/EmergencySupplyService.cs b/SGGL/BLL/HSSE/Emergency/EmergencySupplyService.cs index 66a6ab87..53f31961 100644 --- a/SGGL/BLL/HSSE/Emergency/EmergencySupplyService.cs +++ b/SGGL/BLL/HSSE/Emergency/EmergencySupplyService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class EmergencySupplyService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取应急物资管理 diff --git a/SGGL/BLL/HSSE/Emergency/EmergencyTeamAndTrainService.cs b/SGGL/BLL/HSSE/Emergency/EmergencyTeamAndTrainService.cs index d3365d6c..6528d9a4 100644 --- a/SGGL/BLL/HSSE/Emergency/EmergencyTeamAndTrainService.cs +++ b/SGGL/BLL/HSSE/Emergency/EmergencyTeamAndTrainService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class EmergencyTeamAndTrainService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取应急队伍/培训 diff --git a/SGGL/BLL/HSSE/Environmental/EIAReportService.cs b/SGGL/BLL/HSSE/Environmental/EIAReportService.cs index 8a6a0dca..78f2a1ea 100644 --- a/SGGL/BLL/HSSE/Environmental/EIAReportService.cs +++ b/SGGL/BLL/HSSE/Environmental/EIAReportService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class EIAReportService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取环评报告 diff --git a/SGGL/BLL/HSSE/Environmental/EnvironmentalCheckService.cs b/SGGL/BLL/HSSE/Environmental/EnvironmentalCheckService.cs index bbfdfc2c..77107202 100644 --- a/SGGL/BLL/HSSE/Environmental/EnvironmentalCheckService.cs +++ b/SGGL/BLL/HSSE/Environmental/EnvironmentalCheckService.cs @@ -12,8 +12,6 @@ namespace BLL /// public static class EnvironmentalCheckService { - public static Model.SGGLDB db = Funs.DB; - #region 推送环境监测数据 /// @@ -22,7 +20,8 @@ namespace BLL /// public static ReturnData PushEnvironmentalCheckData() { - var items = (from x in db.EnvironmentalCheck where x.IsPushed == false select x).ToList(); + var db1 = Funs.DB; + var items = (from x in db1.EnvironmentalCheck where x.IsPushed == false select x).ToList(); Model.ReturnData responeData = new Model.ReturnData(); if (items.Count() > 0) { @@ -35,11 +34,11 @@ namespace BLL {//推送成功后,修改数据状态 foreach (var item in items) { - Model.EnvironmentalCheck envModel = db.EnvironmentalCheck.FirstOrDefault(e => e.Id == item.Id); + Model.EnvironmentalCheck envModel = db1.EnvironmentalCheck.FirstOrDefault(e => e.Id == item.Id); if (envModel != null) { envModel.IsPushed = true; - db.SubmitChanges(); + db1.SubmitChanges(); } } } diff --git a/SGGL/BLL/HSSE/Environmental/EnvironmentalEmergencyPlanService.cs b/SGGL/BLL/HSSE/Environmental/EnvironmentalEmergencyPlanService.cs index 86a177d5..a86705a2 100644 --- a/SGGL/BLL/HSSE/Environmental/EnvironmentalEmergencyPlanService.cs +++ b/SGGL/BLL/HSSE/Environmental/EnvironmentalEmergencyPlanService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class EnvironmentalEmergencyPlanService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取环境事件应急预案 diff --git a/SGGL/BLL/HSSE/Environmental/EnvironmentalMonitoringService.cs b/SGGL/BLL/HSSE/Environmental/EnvironmentalMonitoringService.cs index a674cac6..c73f949e 100644 --- a/SGGL/BLL/HSSE/Environmental/EnvironmentalMonitoringService.cs +++ b/SGGL/BLL/HSSE/Environmental/EnvironmentalMonitoringService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class EnvironmentalMonitoringService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取环境监测数据 diff --git a/SGGL/BLL/HSSE/Environmental/UnexpectedEnvironmentalService.cs b/SGGL/BLL/HSSE/Environmental/UnexpectedEnvironmentalService.cs index 3e758263..52be605b 100644 --- a/SGGL/BLL/HSSE/Environmental/UnexpectedEnvironmentalService.cs +++ b/SGGL/BLL/HSSE/Environmental/UnexpectedEnvironmentalService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class UnexpectedEnvironmentalService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取突发环境事件 diff --git a/SGGL/BLL/HSSE/HSSESystem/HSSEMainDutyService.cs b/SGGL/BLL/HSSE/HSSESystem/HSSEMainDutyService.cs index 9b83c2cb..7aa276de 100644 --- a/SGGL/BLL/HSSE/HSSESystem/HSSEMainDutyService.cs +++ b/SGGL/BLL/HSSE/HSSESystem/HSSEMainDutyService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class HSSEMainDutyService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取安全主体责任 diff --git a/SGGL/BLL/HSSE/HSSESystem/ServerSafetyInstitutionService.cs b/SGGL/BLL/HSSE/HSSESystem/ServerSafetyInstitutionService.cs index 41c495c0..65f1d729 100644 --- a/SGGL/BLL/HSSE/HSSESystem/ServerSafetyInstitutionService.cs +++ b/SGGL/BLL/HSSE/HSSESystem/ServerSafetyInstitutionService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class ServerSafetyInstitutionService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取安全制度 diff --git a/SGGL/BLL/HSSE/Hazard/ConstructionRiskApproveService.cs b/SGGL/BLL/HSSE/Hazard/ConstructionRiskApproveService.cs index 8618441d..a9bfb873 100644 --- a/SGGL/BLL/HSSE/Hazard/ConstructionRiskApproveService.cs +++ b/SGGL/BLL/HSSE/Hazard/ConstructionRiskApproveService.cs @@ -2,12 +2,12 @@ using System.Collections.Generic; using System.Data; using System.Linq; +using Model; namespace BLL { public class ConstructionRiskApproveService { - public static Model.SGGLDB db = Funs.DB; /// /// 获取风险管控模板列表 /// @@ -16,14 +16,15 @@ namespace BLL /// public static DataTable getListData(string ConstructionRiskId) { - var res = from x in db.HSSE_ConstructionRiskApprove + var db1 = Funs.DB; + var res = from x in db1.HSSE_ConstructionRiskApprove where x.ConstructionRiskId == ConstructionRiskId && x.ApproveDate != null && x.ApproveType != "S" orderby x.ApproveDate select new { x.ConstructionRiskApproveId, x.ConstructionRiskId, - ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + ApproveMan = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), x.ApproveDate, x.IsAgree, x.ApproveIdea, @@ -76,7 +77,7 @@ namespace BLL /// public static Model.HSSE_ConstructionRiskApprove GetSee(string ConstructionRiskId, string userId) { - return db.HSSE_ConstructionRiskApprove.FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); + return Funs.DB.HSSE_ConstructionRiskApprove.FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == "S" && x.ApproveMan == userId && x.ApproveDate == null); } public static void See(string ConstructionRiskId, string userId) { @@ -97,7 +98,7 @@ namespace BLL /// 一个风险管控审批实体 public static Model.HSSE_ConstructionRiskApprove GetConstructionRiskApproveByConstructionRiskId(string ConstructionRiskId) { - return db.HSSE_ConstructionRiskApprove.FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType != "S" && x.ApproveDate == null); + return Funs.DB.HSSE_ConstructionRiskApprove.FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType != "S" && x.ApproveDate == null); } /// /// 修改风险管控审批信息 @@ -162,7 +163,7 @@ namespace BLL /// public static Model.HSSE_ConstructionRiskApprove GetAudit1(string ConstructionRiskId) { - return db.HSSE_ConstructionRiskApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == BLL.Const.ConstructionRisk_Audit1); + return Funs.DB.HSSE_ConstructionRiskApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == BLL.Const.ConstructionRisk_Audit1); } /// @@ -172,7 +173,7 @@ namespace BLL /// public static Model.HSSE_ConstructionRiskApprove GetAudit2(string ConstructionRiskId) { - return db.HSSE_ConstructionRiskApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == BLL.Const.ConstructionRisk_Audit2); + return Funs.DB.HSSE_ConstructionRiskApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == BLL.Const.ConstructionRisk_Audit2); } /// @@ -182,12 +183,12 @@ namespace BLL /// public static Model.HSSE_ConstructionRiskApprove GetAudit3(string ConstructionRiskId) { - return db.HSSE_ConstructionRiskApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == BLL.Const.ConstructionRisk_Audit3); + return Funs.DB.HSSE_ConstructionRiskApprove.OrderByDescending(x => x.ApproveDate).FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == BLL.Const.ConstructionRisk_Audit3); } public static Model.HSSE_ConstructionRiskApprove GetComplie(string ConstructionRiskId) { - return db.HSSE_ConstructionRiskApprove.FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == BLL.Const.ConstructionRisk_Compile); + return Funs.DB.HSSE_ConstructionRiskApprove.FirstOrDefault(x => x.ConstructionRiskId == ConstructionRiskId && x.ApproveType == BLL.Const.ConstructionRisk_Compile); } public static List GetListDataByCodeForApi(string code) { diff --git a/SGGL/BLL/HSSE/Hazard/ConstructionRiskCheckService.cs b/SGGL/BLL/HSSE/Hazard/ConstructionRiskCheckService.cs index f01e4792..2c60aa8a 100644 --- a/SGGL/BLL/HSSE/Hazard/ConstructionRiskCheckService.cs +++ b/SGGL/BLL/HSSE/Hazard/ConstructionRiskCheckService.cs @@ -7,7 +7,7 @@ namespace BLL { public static class ConstructionRiskCheckService { - public static Model.SGGLDB db = Funs.DB; + /// /// 要求主键获取危险清单信息 diff --git a/SGGL/BLL/HSSE/Hazard/ConstructionRiskListService.cs b/SGGL/BLL/HSSE/Hazard/ConstructionRiskListService.cs index f3e37884..307cfa36 100644 --- a/SGGL/BLL/HSSE/Hazard/ConstructionRiskListService.cs +++ b/SGGL/BLL/HSSE/Hazard/ConstructionRiskListService.cs @@ -8,7 +8,7 @@ namespace BLL { public static class ConstructionRiskListService { - public static Model.SGGLDB db = Funs.DB; + /// /// 要求主键获取危险清单信息 diff --git a/SGGL/BLL/HSSE/Hazard/Hazard_EnvironmentalRiskItemService.cs b/SGGL/BLL/HSSE/Hazard/Hazard_EnvironmentalRiskItemService.cs index 54cba9b5..5948096e 100644 --- a/SGGL/BLL/HSSE/Hazard/Hazard_EnvironmentalRiskItemService.cs +++ b/SGGL/BLL/HSSE/Hazard/Hazard_EnvironmentalRiskItemService.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public static class Hazard_EnvironmentalRiskItemService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据危险源明细表id得到明细信息 /// @@ -136,7 +135,7 @@ namespace BLL /// public static List GetEnvironmentalRiskItemByEnvironmentalId(string environmentalId) { - return (from x in db.Hazard_EnvironmentalRiskItem where x.EnvironmentalId == environmentalId select x).ToList(); + return (from x in Funs.DB.Hazard_EnvironmentalRiskItem where x.EnvironmentalId == environmentalId select x).ToList(); } } } diff --git a/SGGL/BLL/HSSE/Hazard/Hazard_EnvironmentalRiskListService.cs b/SGGL/BLL/HSSE/Hazard/Hazard_EnvironmentalRiskListService.cs index e0e0b17e..0b8c6878 100644 --- a/SGGL/BLL/HSSE/Hazard/Hazard_EnvironmentalRiskListService.cs +++ b/SGGL/BLL/HSSE/Hazard/Hazard_EnvironmentalRiskListService.cs @@ -5,7 +5,7 @@ namespace BLL { public static class Hazard_EnvironmentalRiskListService { - public static Model.SGGLDB db = Funs.DB; + /// /// 要求主键获取危险清单信息 diff --git a/SGGL/BLL/HSSE/Hazard/Hazard_HazardListService.cs b/SGGL/BLL/HSSE/Hazard/Hazard_HazardListService.cs index d75da0c1..b8fe0d50 100644 --- a/SGGL/BLL/HSSE/Hazard/Hazard_HazardListService.cs +++ b/SGGL/BLL/HSSE/Hazard/Hazard_HazardListService.cs @@ -1,12 +1,11 @@ using System; using System.Linq; +using Model; namespace BLL { public static class Hazard_HazardListService { - public static Model.SGGLDB db = Funs.DB; - /// /// 要求主键获取危险清单信息 /// @@ -23,7 +22,7 @@ namespace BLL /// 危险清单的数量 public static int GetHazardListCountByVersionNoIsNull(string projectId) { - return (from x in db.Hazard_HazardList where x.VersionNo == null && x.ProjectId == projectId select x).Count(); + return (from x in Funs.DB.Hazard_HazardList where x.VersionNo == null && x.ProjectId == projectId select x).Count(); } /// diff --git a/SGGL/BLL/HSSE/Hazard/Hazard_HazardSelectedItemService.cs b/SGGL/BLL/HSSE/Hazard/Hazard_HazardSelectedItemService.cs index c7747ae3..67d0d1ab 100644 --- a/SGGL/BLL/HSSE/Hazard/Hazard_HazardSelectedItemService.cs +++ b/SGGL/BLL/HSSE/Hazard/Hazard_HazardSelectedItemService.cs @@ -1,13 +1,12 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public static class Hazard_HazardSelectedItemService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据危险源类别编号查询危险源类别 /// @@ -15,7 +14,7 @@ namespace BLL /// public static IEnumerable getHazardSelectedItemByHazardListTypeId(string hazardListTypeId, string hazardListId) { - return from x in db.Hazard_HazardSelectedItem + return from x in Funs.DB.Hazard_HazardSelectedItem where x.HazardListTypeId == hazardListTypeId && x.HazardListId == hazardListId select new { @@ -48,7 +47,7 @@ namespace BLL /// public static IEnumerable getHazardSelectedItemByHazardListTypeId(string hazardListTypeId, string hazardListId, string workStage) { - return from x in db.Hazard_HazardSelectedItem + return from x in Funs.DB.Hazard_HazardSelectedItem where x.HazardListTypeId == hazardListTypeId && x.HazardListId == hazardListId && x.WorkStage == workStage select new { @@ -80,7 +79,7 @@ namespace BLL /// 危险因素明细集合 public static List GetHazardSelectedItemByHazardListTypeIdAndHazardListId(string hazardListTypeId, string hazardListId) { - return (from x in db.Hazard_HazardSelectedItem where x.HazardListTypeId == hazardListTypeId && x.HazardListId == hazardListId select x).ToList(); + return (from x in Funs.DB.Hazard_HazardSelectedItem where x.HazardListTypeId == hazardListTypeId && x.HazardListId == hazardListId select x).ToList(); } /// @@ -89,7 +88,7 @@ namespace BLL /// 危险因素明细集合 public static List GetPromptTimeIsNotNullHazardSelectedItemByHazardListTypeIdAndHazardListId(string hazardListTypeId, string hazardListId) { - return (from x in db.Hazard_HazardSelectedItem where x.HazardListTypeId == hazardListTypeId && x.HazardListId == hazardListId && x.PromptTime != null select x).ToList(); + return (from x in Funs.DB.Hazard_HazardSelectedItem where x.HazardListTypeId == hazardListTypeId && x.HazardListId == hazardListId && x.PromptTime != null select x).ToList(); } /// @@ -99,7 +98,7 @@ namespace BLL /// 一个危险源辨识与评价清单审批实体 public static Model.Hazard_HazardSelectedItem GetHazardSelectedItemByHazardId(string hazardId, string hazardListId, string workStage) { - return db.Hazard_HazardSelectedItem.FirstOrDefault(x => x.HazardId == hazardId && x.HazardListId == hazardListId && x.WorkStage == workStage); + return Funs.DB.Hazard_HazardSelectedItem.FirstOrDefault(x => x.HazardId == hazardId && x.HazardListId == hazardListId && x.WorkStage == workStage); } /// @@ -109,7 +108,7 @@ namespace BLL /// 一个危险源辨识与评价清单审批实体 public static Model.Hazard_HazardSelectedItem GetHazardSelectedItemByHazardId(string hazardId) { - return db.Hazard_HazardSelectedItem.FirstOrDefault(x => x.HazardId == hazardId); + return Funs.DB.Hazard_HazardSelectedItem.FirstOrDefault(x => x.HazardId == hazardId); } /// @@ -142,7 +141,7 @@ namespace BLL /// public static List GetHazardSelectedItemBySortAndListIdAndWorkStage(string hazardListTypeId, string hazardListId, string workStage) { - return (from x in db.Hazard_HazardSelectedItem where x.HazardListTypeId == hazardListTypeId && x.HazardListId == hazardListId && x.WorkStage == workStage select x).ToList(); + return (from x in Funs.DB.Hazard_HazardSelectedItem where x.HazardListTypeId == hazardListTypeId && x.HazardListId == hazardListId && x.WorkStage == workStage select x).ToList(); } /// diff --git a/SGGL/BLL/HSSE/HiddenInspection/HSSE_Hazard_HazardRegisterService.cs b/SGGL/BLL/HSSE/HiddenInspection/HSSE_Hazard_HazardRegisterService.cs index 8bfa89c3..32af3ecb 100644 --- a/SGGL/BLL/HSSE/HiddenInspection/HSSE_Hazard_HazardRegisterService.cs +++ b/SGGL/BLL/HSSE/HiddenInspection/HSSE_Hazard_HazardRegisterService.cs @@ -3,13 +3,12 @@ using System; using System.Collections; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public static class HSSE_Hazard_HazardRegisterService { - public static Model.SGGLDB db = Funs.DB; - #region 获取安全巡检列表信息 /// /// 记录数 @@ -23,7 +22,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.View_Hazard_HazardRegisterList + private static IQueryable getDataLists = from x in Funs.DB.View_Hazard_HazardRegisterList where x.ProblemTypes == "1" select x; diff --git a/SGGL/BLL/HSSE/InApproveManager/EquipmentInItemService.cs b/SGGL/BLL/HSSE/InApproveManager/EquipmentInItemService.cs index ee38199d..c8c0a992 100644 --- a/SGGL/BLL/HSSE/InApproveManager/EquipmentInItemService.cs +++ b/SGGL/BLL/HSSE/InApproveManager/EquipmentInItemService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class EquipmentInItemService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取特种设备机具入场报批明细信息 diff --git a/SGGL/BLL/HSSE/InApproveManager/EquipmentInService.cs b/SGGL/BLL/HSSE/InApproveManager/EquipmentInService.cs index 5411b4c5..dad87495 100644 --- a/SGGL/BLL/HSSE/InApproveManager/EquipmentInService.cs +++ b/SGGL/BLL/HSSE/InApproveManager/EquipmentInService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class EquipmentInService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取特种设备机具入场报批 diff --git a/SGGL/BLL/HSSE/InApproveManager/EquipmentOutItemService.cs b/SGGL/BLL/HSSE/InApproveManager/EquipmentOutItemService.cs index aeeac878..6bbcf503 100644 --- a/SGGL/BLL/HSSE/InApproveManager/EquipmentOutItemService.cs +++ b/SGGL/BLL/HSSE/InApproveManager/EquipmentOutItemService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class EquipmentOutItemService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取特种设备机具出场报批明细 diff --git a/SGGL/BLL/HSSE/InApproveManager/EquipmentOutService.cs b/SGGL/BLL/HSSE/InApproveManager/EquipmentOutService.cs index 2cadbd5c..385ccc8c 100644 --- a/SGGL/BLL/HSSE/InApproveManager/EquipmentOutService.cs +++ b/SGGL/BLL/HSSE/InApproveManager/EquipmentOutService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class EquipmentOutService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取特种设备机具出场报批 diff --git a/SGGL/BLL/HSSE/InApproveManager/EquipmentQualityInItemService.cs b/SGGL/BLL/HSSE/InApproveManager/EquipmentQualityInItemService.cs index 4c501438..da08b1d7 100644 --- a/SGGL/BLL/HSSE/InApproveManager/EquipmentQualityInItemService.cs +++ b/SGGL/BLL/HSSE/InApproveManager/EquipmentQualityInItemService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class EquipmentQualityInItemService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主表ID获取明细信息 diff --git a/SGGL/BLL/HSSE/InApproveManager/EquipmentQualityInService.cs b/SGGL/BLL/HSSE/InApproveManager/EquipmentQualityInService.cs index b36bd0f6..2d2d145e 100644 --- a/SGGL/BLL/HSSE/InApproveManager/EquipmentQualityInService.cs +++ b/SGGL/BLL/HSSE/InApproveManager/EquipmentQualityInService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class EquipmentQualityInService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取特种设备审批 diff --git a/SGGL/BLL/HSSE/InApproveManager/GeneralEquipmentInItemService.cs b/SGGL/BLL/HSSE/InApproveManager/GeneralEquipmentInItemService.cs index 49209006..09d03ff7 100644 --- a/SGGL/BLL/HSSE/InApproveManager/GeneralEquipmentInItemService.cs +++ b/SGGL/BLL/HSSE/InApproveManager/GeneralEquipmentInItemService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class GeneralEquipmentInItemService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取一般设备机具入场报批明细信息 diff --git a/SGGL/BLL/HSSE/InApproveManager/GeneralEquipmentInService.cs b/SGGL/BLL/HSSE/InApproveManager/GeneralEquipmentInService.cs index 9a9eef79..a99a0ca8 100644 --- a/SGGL/BLL/HSSE/InApproveManager/GeneralEquipmentInService.cs +++ b/SGGL/BLL/HSSE/InApproveManager/GeneralEquipmentInService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class GeneralEquipmentInService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取一般设备机具入场报批 diff --git a/SGGL/BLL/HSSE/InApproveManager/GeneralEquipmentOutItemService.cs b/SGGL/BLL/HSSE/InApproveManager/GeneralEquipmentOutItemService.cs index 42a5d4c1..635605d0 100644 --- a/SGGL/BLL/HSSE/InApproveManager/GeneralEquipmentOutItemService.cs +++ b/SGGL/BLL/HSSE/InApproveManager/GeneralEquipmentOutItemService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class GeneralEquipmentOutItemService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取一般设备机具出场报批 diff --git a/SGGL/BLL/HSSE/InApproveManager/GeneralEquipmentOutService.cs b/SGGL/BLL/HSSE/InApproveManager/GeneralEquipmentOutService.cs index 3328aba7..e70b2a82 100644 --- a/SGGL/BLL/HSSE/InApproveManager/GeneralEquipmentOutService.cs +++ b/SGGL/BLL/HSSE/InApproveManager/GeneralEquipmentOutService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class GeneralEquipmentOutService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取一般设备机具出场报批 diff --git a/SGGL/BLL/HSSE/InformationProject/ConstructionStandardIdentifyService.cs b/SGGL/BLL/HSSE/InformationProject/ConstructionStandardIdentifyService.cs index 05928346..1d33dc2e 100644 --- a/SGGL/BLL/HSSE/InformationProject/ConstructionStandardIdentifyService.cs +++ b/SGGL/BLL/HSSE/InformationProject/ConstructionStandardIdentifyService.cs @@ -4,7 +4,7 @@ namespace BLL { public static class ConstructionStandardIdentifyService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据标准规范辨识主键获取一个标准规范辨识信息 diff --git a/SGGL/BLL/HSSE/InformationProject/ConstructionStandardSelectedItemService.cs b/SGGL/BLL/HSSE/InformationProject/ConstructionStandardSelectedItemService.cs index 18f3fe06..8a82fb21 100644 --- a/SGGL/BLL/HSSE/InformationProject/ConstructionStandardSelectedItemService.cs +++ b/SGGL/BLL/HSSE/InformationProject/ConstructionStandardSelectedItemService.cs @@ -5,7 +5,7 @@ namespace BLL { public static class ConstructionStandardSelectedItemService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据标准规范辨识Id获取对应所有标准规范项信息 diff --git a/SGGL/BLL/HSSE/InformationProject/ProjectAccidentCauseReportItemService.cs b/SGGL/BLL/HSSE/InformationProject/ProjectAccidentCauseReportItemService.cs index 4ebb10a0..78387217 100644 --- a/SGGL/BLL/HSSE/InformationProject/ProjectAccidentCauseReportItemService.cs +++ b/SGGL/BLL/HSSE/InformationProject/ProjectAccidentCauseReportItemService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class ProjectAccidentCauseReportItemService { - public static Model.SGGLDB db = Funs.DB; + /// /// 职工伤亡事故原因分析报表明细表 diff --git a/SGGL/BLL/HSSE/InformationProject/ProjectAccidentCauseReportService.cs b/SGGL/BLL/HSSE/InformationProject/ProjectAccidentCauseReportService.cs index 0f007822..3473868c 100644 --- a/SGGL/BLL/HSSE/InformationProject/ProjectAccidentCauseReportService.cs +++ b/SGGL/BLL/HSSE/InformationProject/ProjectAccidentCauseReportService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class ProjectAccidentCauseReportService { - public static Model.SGGLDB db = Funs.DB; + /// /// 职工伤亡事故原因分析报表 diff --git a/SGGL/BLL/HSSE/InformationProject/ProjectDrillConductedQuarterlyReportItemService.cs b/SGGL/BLL/HSSE/InformationProject/ProjectDrillConductedQuarterlyReportItemService.cs index 7846ae4e..71baae6b 100644 --- a/SGGL/BLL/HSSE/InformationProject/ProjectDrillConductedQuarterlyReportItemService.cs +++ b/SGGL/BLL/HSSE/InformationProject/ProjectDrillConductedQuarterlyReportItemService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class ProjectDrillConductedQuarterlyReportItemService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取应急演练开展情况季报表明细信息 diff --git a/SGGL/BLL/HSSE/InformationProject/ProjectDrillConductedQuarterlyReportService.cs b/SGGL/BLL/HSSE/InformationProject/ProjectDrillConductedQuarterlyReportService.cs index 9c98de37..f57abf45 100644 --- a/SGGL/BLL/HSSE/InformationProject/ProjectDrillConductedQuarterlyReportService.cs +++ b/SGGL/BLL/HSSE/InformationProject/ProjectDrillConductedQuarterlyReportService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class ProjectDrillConductedQuarterlyReportService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取应急演练开展情况季报表 diff --git a/SGGL/BLL/HSSE/InformationProject/ProjectDrillPlanHalfYearReportItemService.cs b/SGGL/BLL/HSSE/InformationProject/ProjectDrillPlanHalfYearReportItemService.cs index 0a6c475c..68218e45 100644 --- a/SGGL/BLL/HSSE/InformationProject/ProjectDrillPlanHalfYearReportItemService.cs +++ b/SGGL/BLL/HSSE/InformationProject/ProjectDrillPlanHalfYearReportItemService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class ProjectDrillPlanHalfYearReportItemService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取应急演练工作计划半年报明细信息 diff --git a/SGGL/BLL/HSSE/InformationProject/ProjectDrillPlanHalfYearReportService.cs b/SGGL/BLL/HSSE/InformationProject/ProjectDrillPlanHalfYearReportService.cs index 3ca939e2..93d1a600 100644 --- a/SGGL/BLL/HSSE/InformationProject/ProjectDrillPlanHalfYearReportService.cs +++ b/SGGL/BLL/HSSE/InformationProject/ProjectDrillPlanHalfYearReportService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class ProjectDrillPlanHalfYearReportService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取应急演练工作计划半年报 diff --git a/SGGL/BLL/HSSE/InformationProject/ProjectMillionsMonthlyReportService.cs b/SGGL/BLL/HSSE/InformationProject/ProjectMillionsMonthlyReportService.cs index 71110758..41338257 100644 --- a/SGGL/BLL/HSSE/InformationProject/ProjectMillionsMonthlyReportService.cs +++ b/SGGL/BLL/HSSE/InformationProject/ProjectMillionsMonthlyReportService.cs @@ -10,7 +10,7 @@ namespace BLL /// public static class ProjectMillionsMonthlyReportService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取企业安全数据统计月报 diff --git a/SGGL/BLL/HSSE/InformationProject/ProjectSafetyQuarterlyReportService.cs b/SGGL/BLL/HSSE/InformationProject/ProjectSafetyQuarterlyReportService.cs index d0cabf8a..e5b3aa01 100644 --- a/SGGL/BLL/HSSE/InformationProject/ProjectSafetyQuarterlyReportService.cs +++ b/SGGL/BLL/HSSE/InformationProject/ProjectSafetyQuarterlyReportService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class ProjectSafetyQuarterlyReportService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取安全生产数据季报 diff --git a/SGGL/BLL/HSSE/Law/HSSEStandardsListService.cs b/SGGL/BLL/HSSE/Law/HSSEStandardsListService.cs index b31be567..170217a0 100644 --- a/SGGL/BLL/HSSE/Law/HSSEStandardsListService.cs +++ b/SGGL/BLL/HSSE/Law/HSSEStandardsListService.cs @@ -5,7 +5,7 @@ namespace BLL { public class HSSEStandardsListService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据id查询标准规范信息 diff --git a/SGGL/BLL/HSSE/Law/LawRegulationListService.cs b/SGGL/BLL/HSSE/Law/LawRegulationListService.cs index d517995d..0aa8f499 100644 --- a/SGGL/BLL/HSSE/Law/LawRegulationListService.cs +++ b/SGGL/BLL/HSSE/Law/LawRegulationListService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class LawRegulationListService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取法律法规 diff --git a/SGGL/BLL/HSSE/Law/ManageRuleService.cs b/SGGL/BLL/HSSE/Law/ManageRuleService.cs index 0e7e758c..a6a46877 100644 --- a/SGGL/BLL/HSSE/Law/ManageRuleService.cs +++ b/SGGL/BLL/HSSE/Law/ManageRuleService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class ManageRuleService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取管理规定 diff --git a/SGGL/BLL/HSSE/Law/RulesRegulationsService.cs b/SGGL/BLL/HSSE/Law/RulesRegulationsService.cs index 7febe7ad..9b594406 100644 --- a/SGGL/BLL/HSSE/Law/RulesRegulationsService.cs +++ b/SGGL/BLL/HSSE/Law/RulesRegulationsService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class RulesRegulationsService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取生产规章制度 diff --git a/SGGL/BLL/HSSE/License/HSETechnicalService.cs b/SGGL/BLL/HSSE/License/HSETechnicalService.cs index f02a36e5..527239db 100644 --- a/SGGL/BLL/HSSE/License/HSETechnicalService.cs +++ b/SGGL/BLL/HSSE/License/HSETechnicalService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class HSETechnicalService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取安全技术交底 diff --git a/SGGL/BLL/HSSE/License/LicenseManagerService.cs b/SGGL/BLL/HSSE/License/LicenseManagerService.cs index 08a67cb6..76baa24d 100644 --- a/SGGL/BLL/HSSE/License/LicenseManagerService.cs +++ b/SGGL/BLL/HSSE/License/LicenseManagerService.cs @@ -14,8 +14,6 @@ namespace BLL /// public static class LicenseManagerService { - public static Model.SGGLDB db = Funs.DB; - #region 获取安全巡检列表信息 /// /// 记录数 @@ -29,7 +27,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.License_LicenseManager + private static IQueryable getDataLists = from x in Funs.DB.License_LicenseManager select x; /// @@ -85,13 +83,14 @@ namespace BLL return null; } getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + var db1 = Funs.DB; return from x in getDataList select new { x.LicenseManagerId, x.LicenseManagerCode, - LicenseTypeName = db.Base_LicenseType.First(t => t.LicenseTypeId == x.LicenseTypeId).LicenseTypeName, - UnitName = db.Base_Unit.First(u => u.UnitId == x.UnitId).UnitName, + LicenseTypeName = db1.Base_LicenseType.First(t => t.LicenseTypeId == x.LicenseTypeId).LicenseTypeName, + UnitName = db1.Base_Unit.First(u => u.UnitId == x.UnitId).UnitName, WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId), x.CompileDate, x.StartDate, diff --git a/SGGL/BLL/HSSE/License/LicensePublicService.cs b/SGGL/BLL/HSSE/License/LicensePublicService.cs index 5d839342..f9a0a3c5 100644 --- a/SGGL/BLL/HSSE/License/LicensePublicService.cs +++ b/SGGL/BLL/HSSE/License/LicensePublicService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class LicensePublicService { - public static Model.SGGLDB db = Funs.DB; + /// /// 状态下拉框 /// diff --git a/SGGL/BLL/HSSE/Manager/CompletionReportService.cs b/SGGL/BLL/HSSE/Manager/CompletionReportService.cs index cc1c1f1c..d4e574da 100644 --- a/SGGL/BLL/HSSE/Manager/CompletionReportService.cs +++ b/SGGL/BLL/HSSE/Manager/CompletionReportService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class CompletionReportService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取完工报告 diff --git a/SGGL/BLL/HSSE/Meeting/AttendMeetingService.cs b/SGGL/BLL/HSSE/Meeting/AttendMeetingService.cs index 36b4dd97..f5937a83 100644 --- a/SGGL/BLL/HSSE/Meeting/AttendMeetingService.cs +++ b/SGGL/BLL/HSSE/Meeting/AttendMeetingService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class AttendMeetingService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取其他会议记录 diff --git a/SGGL/BLL/HSSE/Meeting/ClassMeetingService.cs b/SGGL/BLL/HSSE/Meeting/ClassMeetingService.cs index c206948f..5fe301bf 100644 --- a/SGGL/BLL/HSSE/Meeting/ClassMeetingService.cs +++ b/SGGL/BLL/HSSE/Meeting/ClassMeetingService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class ClassMeetingService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取班前会 diff --git a/SGGL/BLL/HSSE/Meeting/MonthMeetingService.cs b/SGGL/BLL/HSSE/Meeting/MonthMeetingService.cs index 2b74e3cb..40c39444 100644 --- a/SGGL/BLL/HSSE/Meeting/MonthMeetingService.cs +++ b/SGGL/BLL/HSSE/Meeting/MonthMeetingService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class MonthMeetingService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取安全月例会 diff --git a/SGGL/BLL/HSSE/Meeting/SafetyLeaderGroupMeetingService.cs b/SGGL/BLL/HSSE/Meeting/SafetyLeaderGroupMeetingService.cs index 3f6e11c7..071fabf9 100644 --- a/SGGL/BLL/HSSE/Meeting/SafetyLeaderGroupMeetingService.cs +++ b/SGGL/BLL/HSSE/Meeting/SafetyLeaderGroupMeetingService.cs @@ -11,7 +11,7 @@ namespace BLL /// public static class SafetyLeaderGroupMeetingService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取安全领导小组会议 diff --git a/SGGL/BLL/HSSE/Meeting/SpecialMeetingService.cs b/SGGL/BLL/HSSE/Meeting/SpecialMeetingService.cs index 0673d8cc..44955ca8 100644 --- a/SGGL/BLL/HSSE/Meeting/SpecialMeetingService.cs +++ b/SGGL/BLL/HSSE/Meeting/SpecialMeetingService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class SpecialMeetingService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取专题例会 diff --git a/SGGL/BLL/HSSE/Meeting/WeekMeetingService.cs b/SGGL/BLL/HSSE/Meeting/WeekMeetingService.cs index 4b5b3111..a4d3b1c0 100644 --- a/SGGL/BLL/HSSE/Meeting/WeekMeetingService.cs +++ b/SGGL/BLL/HSSE/Meeting/WeekMeetingService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class WeekMeetingService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取周例会 diff --git a/SGGL/BLL/HSSE/OccupationHealth/HazardDetectionService.cs b/SGGL/BLL/HSSE/OccupationHealth/HazardDetectionService.cs index 69e6dd01..3a7a1159 100644 --- a/SGGL/BLL/HSSE/OccupationHealth/HazardDetectionService.cs +++ b/SGGL/BLL/HSSE/OccupationHealth/HazardDetectionService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class HazardDetectionService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取危害检测 diff --git a/SGGL/BLL/HSSE/OccupationHealth/OccupationalDiseaseAccidentService.cs b/SGGL/BLL/HSSE/OccupationHealth/OccupationalDiseaseAccidentService.cs index 068f54e5..264aa649 100644 --- a/SGGL/BLL/HSSE/OccupationHealth/OccupationalDiseaseAccidentService.cs +++ b/SGGL/BLL/HSSE/OccupationHealth/OccupationalDiseaseAccidentService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class OccupationalDiseaseAccidentService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取职业病事故 diff --git a/SGGL/BLL/HSSE/OccupationHealth/PhysicalExaminationService.cs b/SGGL/BLL/HSSE/OccupationHealth/PhysicalExaminationService.cs index 376b530c..4400b648 100644 --- a/SGGL/BLL/HSSE/OccupationHealth/PhysicalExaminationService.cs +++ b/SGGL/BLL/HSSE/OccupationHealth/PhysicalExaminationService.cs @@ -3,6 +3,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { @@ -11,8 +12,6 @@ namespace BLL /// public static class PhysicalExaminationService { - public static Model.SGGLDB db = Funs.DB; - #region 获取安全巡检列表信息 /// /// 记录数 @@ -26,7 +25,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.SitePerson_Person + private static IQueryable getDataLists = from x in Funs.DB.SitePerson_Person select x; /// @@ -54,13 +53,14 @@ namespace BLL return null; } getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + var db1 = Funs.DB; return from x in getDataList select new { x.ProjectId, - ProjectName = db.Base_Project.First(p => p.ProjectId == x.ProjectId).ProjectName, + ProjectName = db1.Base_Project.First(p => p.ProjectId == x.ProjectId).ProjectName, x.UnitId, - UnitName = db.Base_Unit.First(p => p.UnitId == x.UnitId).UnitName, + UnitName = db1.Base_Unit.First(p => p.UnitId == x.UnitId).UnitName, x.SitePersonId, x.PersonId, x.CardNo, diff --git a/SGGL/BLL/HSSE/QualityAudit/EquipmentPersonQualityService.cs b/SGGL/BLL/HSSE/QualityAudit/EquipmentPersonQualityService.cs index 5e176620..b182255c 100644 --- a/SGGL/BLL/HSSE/QualityAudit/EquipmentPersonQualityService.cs +++ b/SGGL/BLL/HSSE/QualityAudit/EquipmentPersonQualityService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class EquipmentPersonQualityService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取特种设备作业人员资质 diff --git a/SGGL/BLL/HSSE/QualityAudit/EquipmentQualityAuditDetailService.cs b/SGGL/BLL/HSSE/QualityAudit/EquipmentQualityAuditDetailService.cs index 18e74ed8..53b1828f 100644 --- a/SGGL/BLL/HSSE/QualityAudit/EquipmentQualityAuditDetailService.cs +++ b/SGGL/BLL/HSSE/QualityAudit/EquipmentQualityAuditDetailService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class EquipmentQualityAuditDetailService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取特种设备资质审查明细 diff --git a/SGGL/BLL/HSSE/QualityAudit/EquipmentQualityService.cs b/SGGL/BLL/HSSE/QualityAudit/EquipmentQualityService.cs index f4145cdf..756c5b79 100644 --- a/SGGL/BLL/HSSE/QualityAudit/EquipmentQualityService.cs +++ b/SGGL/BLL/HSSE/QualityAudit/EquipmentQualityService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class EquipmentQualityService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取特殊机具设备资质 diff --git a/SGGL/BLL/HSSE/QualityAudit/GeneralEquipmentQualityService.cs b/SGGL/BLL/HSSE/QualityAudit/GeneralEquipmentQualityService.cs index 12acb2d8..23e535e6 100644 --- a/SGGL/BLL/HSSE/QualityAudit/GeneralEquipmentQualityService.cs +++ b/SGGL/BLL/HSSE/QualityAudit/GeneralEquipmentQualityService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class GeneralEquipmentQualityService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取一般机具设备资质 diff --git a/SGGL/BLL/HSSE/QualityAudit/PersonQualityService.cs b/SGGL/BLL/HSSE/QualityAudit/PersonQualityService.cs index 1afa8c58..a40c266f 100644 --- a/SGGL/BLL/HSSE/QualityAudit/PersonQualityService.cs +++ b/SGGL/BLL/HSSE/QualityAudit/PersonQualityService.cs @@ -5,6 +5,7 @@ using Aspose.Words.Lists; using FineUIPro; using Org.BouncyCastle.Ocsp; using System.Collections; +using Model; namespace BLL { @@ -13,8 +14,6 @@ namespace BLL /// public static class PersonQualityService { - public static Model.SGGLDB db = Funs.DB; - #region 获取人员证书列表信息 /// /// 记录数 @@ -28,7 +27,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.QualityAudit_PersonQuality + private static IQueryable getDataLists = from x in Funs.DB.QualityAudit_PersonQuality select x; /// @@ -46,13 +45,14 @@ namespace BLL return null; } getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + var db1 = Funs.DB; return from x in getDataList select new { x.PersonQualityId, x.PersonId, x.CertificateId, - CertificateName = db.Base_Certificate.First(u => u.CertificateId == x.CertificateId).CertificateName, + CertificateName = db1.Base_Certificate.First(u => u.CertificateId == x.CertificateId).CertificateName, x.CertificateNo, x.SendUnit, x.SendDate, @@ -60,7 +60,7 @@ namespace BLL x.Major, x.LimitDate, x.Url, - db.AttachFile.First(u => u.ToKeyId == x.PersonQualityId).AttachUrl, + db1.AttachFile.First(u => u.ToKeyId == x.PersonQualityId).AttachUrl, }; } #endregion diff --git a/SGGL/BLL/HSSE/QualityAudit/SafePersonQualityService.cs b/SGGL/BLL/HSSE/QualityAudit/SafePersonQualityService.cs index 663524ef..3fecf64f 100644 --- a/SGGL/BLL/HSSE/QualityAudit/SafePersonQualityService.cs +++ b/SGGL/BLL/HSSE/QualityAudit/SafePersonQualityService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class SafePersonQualityService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取安全人员资质 diff --git a/SGGL/BLL/HSSE/QualityAudit/SubUnitQualityAuditDetailService.cs b/SGGL/BLL/HSSE/QualityAudit/SubUnitQualityAuditDetailService.cs index 14438ca9..a4fb47ad 100644 --- a/SGGL/BLL/HSSE/QualityAudit/SubUnitQualityAuditDetailService.cs +++ b/SGGL/BLL/HSSE/QualityAudit/SubUnitQualityAuditDetailService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class SubUnitQualityAuditDetailService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取分包商资质审查明细 diff --git a/SGGL/BLL/HSSE/QualityAudit/SubUnitQualityService.cs b/SGGL/BLL/HSSE/QualityAudit/SubUnitQualityService.cs index 77bc4cd9..39bd5fa2 100644 --- a/SGGL/BLL/HSSE/QualityAudit/SubUnitQualityService.cs +++ b/SGGL/BLL/HSSE/QualityAudit/SubUnitQualityService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class SubUnitQualityService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取分包商资质 diff --git a/SGGL/BLL/HSSE/Resources/SignManageService.cs b/SGGL/BLL/HSSE/Resources/SignManageService.cs index bbbe4571..a82f95f7 100644 --- a/SGGL/BLL/HSSE/Resources/SignManageService.cs +++ b/SGGL/BLL/HSSE/Resources/SignManageService.cs @@ -4,7 +4,7 @@ public static class SignManageService { - public static Model.SGGLDB db = Funs.DB; + /// /// 获取标牌信息 diff --git a/SGGL/BLL/HSSE/SecuritySystem/SafetyOrganizationService.cs b/SGGL/BLL/HSSE/SecuritySystem/SafetyOrganizationService.cs index 470f88b5..e67b21bd 100644 --- a/SGGL/BLL/HSSE/SecuritySystem/SafetyOrganizationService.cs +++ b/SGGL/BLL/HSSE/SecuritySystem/SafetyOrganizationService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class SafetyOrganizationService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取安全管理机构信息 diff --git a/SGGL/BLL/HSSE/SitePerson/PersonInOutService.cs b/SGGL/BLL/HSSE/SitePerson/PersonInOutService.cs index 6031bc7e..7a2bd10f 100644 --- a/SGGL/BLL/HSSE/SitePerson/PersonInOutService.cs +++ b/SGGL/BLL/HSSE/SitePerson/PersonInOutService.cs @@ -3,6 +3,7 @@ using System; using System.Collections; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { @@ -11,8 +12,6 @@ namespace BLL /// public static class PersonInOutService { - public static Model.SGGLDB db = Funs.DB; - /// /// 记录数 /// @@ -25,7 +24,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.SitePerson_PersonInOut select x; + private static IQueryable getDataLists = from x in Funs.DB.SitePerson_PersonInOut select x; /// /// 获取分页列表 diff --git a/SGGL/BLL/HSSE/SitePerson/SitePerson_CheckingService.cs b/SGGL/BLL/HSSE/SitePerson/SitePerson_CheckingService.cs index 72a9320a..ebad051e 100644 --- a/SGGL/BLL/HSSE/SitePerson/SitePerson_CheckingService.cs +++ b/SGGL/BLL/HSSE/SitePerson/SitePerson_CheckingService.cs @@ -5,7 +5,7 @@ namespace BLL { public class SitePerson_CheckingService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据人员考勤主键获取人员考勤管理信息 diff --git a/SGGL/BLL/HSSE/SitePerson/SitePerson_DayReportUnitDetailService.cs b/SGGL/BLL/HSSE/SitePerson/SitePerson_DayReportUnitDetailService.cs index c9d7d5c0..a6d71c70 100644 --- a/SGGL/BLL/HSSE/SitePerson/SitePerson_DayReportUnitDetailService.cs +++ b/SGGL/BLL/HSSE/SitePerson/SitePerson_DayReportUnitDetailService.cs @@ -6,7 +6,7 @@ namespace BLL { public class SitePerson_DayReportUnitDetailService { - public static Model.SGGLDB db = Funs.DB; + /// diff --git a/SGGL/BLL/HSSE/SitePerson/SitePerson_MonthReportUnitDetailService.cs b/SGGL/BLL/HSSE/SitePerson/SitePerson_MonthReportUnitDetailService.cs index 6ad112ab..83db0cbc 100644 --- a/SGGL/BLL/HSSE/SitePerson/SitePerson_MonthReportUnitDetailService.cs +++ b/SGGL/BLL/HSSE/SitePerson/SitePerson_MonthReportUnitDetailService.cs @@ -4,7 +4,7 @@ namespace BLL { public class SitePerson_MonthReportUnitDetailService { - public static Model.SGGLDB db = Funs.DB; + /// /// 增加工作日报明细信息 diff --git a/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonItemService.cs b/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonItemService.cs index 5d80ebd6..e98b36e9 100644 --- a/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonItemService.cs +++ b/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonItemService.cs @@ -10,8 +10,6 @@ namespace BLL { public static class SitePerson_PersonItemService { - public static Model.SGGLDB db = Funs.DB; - #region 获取列表数据 /// /// 记录数 @@ -25,7 +23,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.SitePerson_PersonItem select x; + private static IQueryable getDataLists = from x in Funs.DB.SitePerson_PersonItem select x; /// /// 获取分页列表 diff --git a/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs b/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs index a2b37be0..a65d77a0 100644 --- a/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs +++ b/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs @@ -17,8 +17,6 @@ namespace BLL /// public static class SitePerson_PersonService { - public static Model.SGGLDB db = Funs.DB; - #region 劳务人员列表 /// /// 记录数 @@ -101,7 +99,7 @@ namespace BLL x.WorkPostId, x.WorkPostName, x.ProjectId, - ProjectName = db.Base_Project.First(u => u.ProjectId == x.ProjectId).ShortName, + ProjectName = Funs.DB.Base_Project.First(u => u.ProjectId == x.ProjectId).ShortName, NativePlace = x.CountryName ?? "" + x.ProvinceName ?? "", x.TeamGroupId, x.TeamGroupName, @@ -126,7 +124,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getInPersonLists = from x in db.SitePerson_Person + private static IQueryable getInPersonLists = from x in Funs.DB.SitePerson_Person where x.States == Const.ProjectPersonStates_1 select x; @@ -173,7 +171,7 @@ namespace BLL x.CardNo, x.PersonName, x.UnitId, - db.Base_Unit.First(u => u.UnitId == x.UnitId).UnitName, + Funs.DB.Base_Unit.First(u => u.UnitId == x.UnitId).UnitName, x.IdentityCard, IsInName = "", InOuDate = DateTime.Now.ToShortDateString(), @@ -195,7 +193,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getNowPersonLists = from x in db.SitePerson_PersonInOutNow + private static IQueryable getNowPersonLists = from x in Funs.DB.SitePerson_PersonInOutNow select x; /// @@ -262,7 +260,7 @@ namespace BLL x.PersonId, x.personName, x.identityCard, - CardNo =db.SitePerson_Person.First(p=>p.PersonId == x.PersonId && p.ProjectId ==x.ProjectId).CardNo, + CardNo =Funs.DB.SitePerson_Person.First(p=>p.PersonId == x.PersonId && p.ProjectId ==x.ProjectId).CardNo, x.UnitName, x.UnitId, x.WorkPostId, diff --git a/SGGL/BLL/HSSE/Solution/ConstructSolutionService.cs b/SGGL/BLL/HSSE/Solution/ConstructSolutionService.cs index 8ab912c7..b46c4842 100644 --- a/SGGL/BLL/HSSE/Solution/ConstructSolutionService.cs +++ b/SGGL/BLL/HSSE/Solution/ConstructSolutionService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class ConstructSolutionService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取施工方案/审查 diff --git a/SGGL/BLL/HSSE/Solution/ExpertArgumentService.cs b/SGGL/BLL/HSSE/Solution/ExpertArgumentService.cs index e4aec9b1..793d4833 100644 --- a/SGGL/BLL/HSSE/Solution/ExpertArgumentService.cs +++ b/SGGL/BLL/HSSE/Solution/ExpertArgumentService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class ExpertArgumentService { - public static Model.SGGLDB db = Funs.DB; + #region 专家论证清单 /// diff --git a/SGGL/BLL/HSSE/Solution/SolutionTemplateService.cs b/SGGL/BLL/HSSE/Solution/SolutionTemplateService.cs index fd950a46..785f5815 100644 --- a/SGGL/BLL/HSSE/Solution/SolutionTemplateService.cs +++ b/SGGL/BLL/HSSE/Solution/SolutionTemplateService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class SolutionTemplateService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取方案模板 diff --git a/SGGL/BLL/HSSE/Technique/EmergencyService.cs b/SGGL/BLL/HSSE/Technique/EmergencyService.cs index af9cae94..719ffc02 100644 --- a/SGGL/BLL/HSSE/Technique/EmergencyService.cs +++ b/SGGL/BLL/HSSE/Technique/EmergencyService.cs @@ -5,7 +5,7 @@ namespace BLL { public static class EmergencyService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取应急预案 diff --git a/SGGL/BLL/HSSE/Technique/EnvironmentalService.cs b/SGGL/BLL/HSSE/Technique/EnvironmentalService.cs index 343447cb..9fd8c158 100644 --- a/SGGL/BLL/HSSE/Technique/EnvironmentalService.cs +++ b/SGGL/BLL/HSSE/Technique/EnvironmentalService.cs @@ -4,7 +4,7 @@ namespace BLL { public static class EnvironmentalService { - public static Model.SGGLDB db = Funs.DB; + /// /// 获取环境危险源信息 diff --git a/SGGL/BLL/HSSE/Technique/HazardListService.cs b/SGGL/BLL/HSSE/Technique/HazardListService.cs index 2f187d36..4e756ee5 100644 --- a/SGGL/BLL/HSSE/Technique/HazardListService.cs +++ b/SGGL/BLL/HSSE/Technique/HazardListService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class HazardListService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取危险源清单 diff --git a/SGGL/BLL/HSSE/Technique/HazardListTypeService.cs b/SGGL/BLL/HSSE/Technique/HazardListTypeService.cs index 2a2f8588..b6c0770a 100644 --- a/SGGL/BLL/HSSE/Technique/HazardListTypeService.cs +++ b/SGGL/BLL/HSSE/Technique/HazardListTypeService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class HazardListTypeService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取危险源类型 diff --git a/SGGL/BLL/HSSE/Technique/RectifyItemService.cs b/SGGL/BLL/HSSE/Technique/RectifyItemService.cs index 231f63ef..0e006a05 100644 --- a/SGGL/BLL/HSSE/Technique/RectifyItemService.cs +++ b/SGGL/BLL/HSSE/Technique/RectifyItemService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class RectifyItemService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取安全隐患明细 diff --git a/SGGL/BLL/HSSE/Technique/RectifyService.cs b/SGGL/BLL/HSSE/Technique/RectifyService.cs index 42f3b47d..cca719ed 100644 --- a/SGGL/BLL/HSSE/Technique/RectifyService.cs +++ b/SGGL/BLL/HSSE/Technique/RectifyService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class RectifyService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取安全隐患 diff --git a/SGGL/BLL/HSSE/Technique/SpecialSchemeService.cs b/SGGL/BLL/HSSE/Technique/SpecialSchemeService.cs index 4ba36bc6..0c530bd4 100644 --- a/SGGL/BLL/HSSE/Technique/SpecialSchemeService.cs +++ b/SGGL/BLL/HSSE/Technique/SpecialSchemeService.cs @@ -6,7 +6,7 @@ namespace BLL public static class SpecialSchemeService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取专项方案 diff --git a/SGGL/BLL/HSSE/Technique/Technique_CheckItemDetailService.cs b/SGGL/BLL/HSSE/Technique/Technique_CheckItemDetailService.cs index 6afa4a00..cce5ac81 100644 --- a/SGGL/BLL/HSSE/Technique/Technique_CheckItemDetailService.cs +++ b/SGGL/BLL/HSSE/Technique/Technique_CheckItemDetailService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class Technique_CheckItemDetailService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取检查项明细 diff --git a/SGGL/BLL/HSSE/Technique/Technique_CheckItemSetService.cs b/SGGL/BLL/HSSE/Technique/Technique_CheckItemSetService.cs index a705b95c..7af74f4a 100644 --- a/SGGL/BLL/HSSE/Technique/Technique_CheckItemSetService.cs +++ b/SGGL/BLL/HSSE/Technique/Technique_CheckItemSetService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class Technique_CheckItemSetService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取检查项 diff --git a/SGGL/BLL/Notice/NoticeService.cs b/SGGL/BLL/Notice/NoticeService.cs index 4784d18f..d0d2e525 100644 --- a/SGGL/BLL/Notice/NoticeService.cs +++ b/SGGL/BLL/Notice/NoticeService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class NoticeService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取通知 diff --git a/SGGL/BLL/OfficeCheck/ProjectEvaluation/ProjectEvaluationService.cs b/SGGL/BLL/OfficeCheck/ProjectEvaluation/ProjectEvaluationService.cs index b2ed2e00..6acc2d44 100644 --- a/SGGL/BLL/OfficeCheck/ProjectEvaluation/ProjectEvaluationService.cs +++ b/SGGL/BLL/OfficeCheck/ProjectEvaluation/ProjectEvaluationService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class ProjectEvaluationService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取项目绩效评价 diff --git a/SGGL/BLL/PHTGL/BiddingManagement/BidDocStandingBookService.cs b/SGGL/BLL/PHTGL/BiddingManagement/BidDocStandingBookService.cs index 7f594001..f69fd2ec 100644 --- a/SGGL/BLL/PHTGL/BiddingManagement/BidDocStandingBookService.cs +++ b/SGGL/BLL/PHTGL/BiddingManagement/BidDocStandingBookService.cs @@ -5,6 +5,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; +using Model; namespace BLL @@ -12,9 +13,6 @@ namespace BLL public static class BidDocStandingBookService { - public static Model.SGGLDB db = Funs.DB; - - #region 获取列表 /// /// 记录数 @@ -26,7 +24,7 @@ namespace BLL } public static List GetPHTGL_BidDocumentsStandingBookByModle(Model.PHTGL_BidDocumentsStandingBook table) { - var q = from x in db.PHTGL_BidDocumentsStandingBook + var q = from x in Funs.DB.PHTGL_BidDocumentsStandingBook where (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) && (string.IsNullOrEmpty(table.DepartId) || x.DepartId.Contains(table.DepartId)) && @@ -100,7 +98,7 @@ namespace BLL public static Model.PHTGL_BidDocumentsStandingBook GetPHTGL_BidDocumentsStandingBookById(string BidDocumentsStandingBookId) { - return db.PHTGL_BidDocumentsStandingBook.FirstOrDefault(x => x.BidDocumentsStandingBookId == BidDocumentsStandingBookId); + return Funs.DB.PHTGL_BidDocumentsStandingBook.FirstOrDefault(x => x.BidDocumentsStandingBookId == BidDocumentsStandingBookId); } @@ -132,22 +130,23 @@ namespace BLL BidNoticeCode=newtable.BidNoticeCode, BidUnitFileCode=newtable.BidUnitFileCode, }; - db.PHTGL_BidDocumentsStandingBook.InsertOnSubmit(table); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.PHTGL_BidDocumentsStandingBook.InsertOnSubmit(table); + db1.SubmitChanges(); } public static void AddBulkPHTGL_BidDocumentsStandingBook(List newtables) { - - db.PHTGL_BidDocumentsStandingBook.InsertAllOnSubmit(newtables); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.PHTGL_BidDocumentsStandingBook.InsertAllOnSubmit(newtables); + db1.SubmitChanges(); } public static void UpdatePHTGL_BidDocumentsStandingBook(Model.PHTGL_BidDocumentsStandingBook newtable) { - - Model.PHTGL_BidDocumentsStandingBook table = db.PHTGL_BidDocumentsStandingBook.FirstOrDefault(x => x.BidDocumentsStandingBookId == newtable.BidDocumentsStandingBookId); + var db1 = Funs.DB; + Model.PHTGL_BidDocumentsStandingBook table = db1.PHTGL_BidDocumentsStandingBook.FirstOrDefault(x => x.BidDocumentsStandingBookId == newtable.BidDocumentsStandingBookId); if (table != null) { table.BidDocumentsStandingBookId = newtable.BidDocumentsStandingBookId; @@ -172,28 +171,29 @@ namespace BLL table.State=newtable.State; table.BidNoticeCode= newtable.BidNoticeCode; table.BidUnitFileCode=newtable.BidUnitFileCode; - db.SubmitChanges(); + db1.SubmitChanges(); } } public static void DeletePHTGL_BidDocumentsStandingBookById(string BidDocumentsStandingBookId) { - - Model.PHTGL_BidDocumentsStandingBook table = db.PHTGL_BidDocumentsStandingBook.FirstOrDefault(x => x.BidDocumentsStandingBookId == BidDocumentsStandingBookId); + var db1 = Funs.DB; + Model.PHTGL_BidDocumentsStandingBook table = db1.PHTGL_BidDocumentsStandingBook.FirstOrDefault(x => x.BidDocumentsStandingBookId == BidDocumentsStandingBookId); if (table != null) { - db.PHTGL_BidDocumentsStandingBook.DeleteOnSubmit(table); - db.SubmitChanges(); + db1.PHTGL_BidDocumentsStandingBook.DeleteOnSubmit(table); + db1.SubmitChanges(); } } public static void DeleteALLPHTGL_BidDocumentsStandingBook() { - if (db.PHTGL_BidDocumentsStandingBook != null) + var db1 = Funs.DB; + if (db1.PHTGL_BidDocumentsStandingBook != null) { - db.PHTGL_BidDocumentsStandingBook.DeleteAllOnSubmit(db.PHTGL_BidDocumentsStandingBook); - db.SubmitChanges(); + db1.PHTGL_BidDocumentsStandingBook.DeleteAllOnSubmit(db1.PHTGL_BidDocumentsStandingBook); + db1.SubmitChanges(); } } diff --git a/SGGL/BLL/PHTGL/ContractCompile/ContractStandingBookService.cs b/SGGL/BLL/PHTGL/ContractCompile/ContractStandingBookService.cs index 44a40c24..47db61d9 100644 --- a/SGGL/BLL/PHTGL/ContractCompile/ContractStandingBookService.cs +++ b/SGGL/BLL/PHTGL/ContractCompile/ContractStandingBookService.cs @@ -11,7 +11,7 @@ namespace BLL /// public static class ContractStandingBookService { - public static Model.SGGLDB db = Funs.DB; + #region 获取列表 /// /// 记录数 diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogHJGLService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogHJGLService.cs index 65e9c06e..59b5ecff 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogHJGLService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogHJGLService.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class ConstructionLogHJGLService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取施工日志焊接数据明细列表 /// @@ -15,7 +14,7 @@ namespace BLL /// public static List getListData(string ConstructionLogId) { - return (from x in db.ZHGL_ConstructionLogHJGL + return (from x in Funs.DB.ZHGL_ConstructionLogHJGL where x.ConstructionLogId == ConstructionLogId select x).ToList(); } diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogMachineService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogMachineService.cs index 3c0cf59e..a634c776 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogMachineService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogMachineService.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class ConstructionLogMachineService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取施工日志机械明细列表 /// @@ -15,7 +14,7 @@ namespace BLL /// public static List getListData(string ConstructionLogId) { - return (from x in db.ZHGL_ConstructionLogMachine + return (from x in Funs.DB.ZHGL_ConstructionLogMachine where x.ConstructionLogId == ConstructionLogId select x).ToList(); } diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogManagementService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogManagementService.cs index 47270a4b..c35d0300 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogManagementService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogManagementService.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class ConstructionLogManagementService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取施工日志专业管理明细列表 /// @@ -15,7 +14,7 @@ namespace BLL /// public static List getListData(string ConstructionLogId) { - return (from x in db.ZHGL_ConstructionLogManagement + return (from x in Funs.DB.ZHGL_ConstructionLogManagement where x.ConstructionLogId == ConstructionLogId select x).ToList(); } diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogPersonService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogPersonService.cs index bb96c8cf..5e65c6da 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogPersonService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogPersonService.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class ConstructionLogPersonService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取施工日志作业人员明细列表 /// @@ -15,7 +14,7 @@ namespace BLL /// public static List getListData(string ConstructionLogId) { - return (from x in db.ZHGL_ConstructionLogPerson + return (from x in Funs.DB.ZHGL_ConstructionLogPerson where x.ConstructionLogId == ConstructionLogId select x).ToList(); } diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogProblemService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogProblemService.cs index 557f8a90..0b240491 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogProblemService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogProblemService.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class ConstructionLogProblemService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取施工日志需要协调解决的问题明细列表 /// @@ -15,7 +14,7 @@ namespace BLL /// public static List getListData(string ConstructionLogId) { - return (from x in db.ZHGL_ConstructionLogProblem + return (from x in Funs.DB.ZHGL_ConstructionLogProblem where x.ConstructionLogId == ConstructionLogId select x).ToList(); } diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogRecordService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogRecordService.cs index ced09506..e04da4ea 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogRecordService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogRecordService.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class ConstructionLogRecordService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取施工日志施工经理相关记录明细列表 /// @@ -15,7 +14,7 @@ namespace BLL /// public static List getListData(string ConstructionLogId) { - return (from x in db.ZHGL_ConstructionLogRecord + return (from x in Funs.DB.ZHGL_ConstructionLogRecord where x.ConstructionLogId == ConstructionLogId select x).ToList(); } diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogService.cs index 99d17bcd..6f7c8bb8 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class ConstructionLogService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取项目级施工日志 diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyCompanyService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyCompanyService.cs index 01dbe239..b8070e0f 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyCompanyService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyCompanyService.cs @@ -1,13 +1,12 @@ using System; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class ConstructionLogWorkEfficiencyCompanyService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取施工日志公司工效明细列表 /// @@ -16,7 +15,7 @@ namespace BLL /// public static List getListData(string projectId, DateTime month) { - return (from x in db.ZHGL_ConstructionLogWorkEfficiencyCompany + return (from x in Funs.DB.ZHGL_ConstructionLogWorkEfficiencyCompany select x).ToList(); } diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyMonthService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyMonthService.cs index 86cd9e10..561312b9 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyMonthService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyMonthService.cs @@ -1,13 +1,12 @@ using System; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class ConstructionLogWorkEfficiencyMonthService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取施工日志月工效明细列表 /// @@ -16,7 +15,7 @@ namespace BLL /// public static List getListData(string projectId, DateTime month) { - return (from x in db.ZHGL_ConstructionLogWorkEfficiencyMonth + return (from x in Funs.DB.ZHGL_ConstructionLogWorkEfficiencyMonth where x.ProjectId == projectId && x.Month == month select x).ToList(); } diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyProjectService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyProjectService.cs index 28fec743..858a8d42 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyProjectService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyProjectService.cs @@ -1,13 +1,12 @@ using System; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class ConstructionLogWorkEfficiencyProjectService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取施工日志项目工效明细列表 /// @@ -16,7 +15,7 @@ namespace BLL /// public static List getListData(string projectId, DateTime month) { - return (from x in db.ZHGL_ConstructionLogWorkEfficiencyProject + return (from x in Funs.DB.ZHGL_ConstructionLogWorkEfficiencyProject where x.ProjectId == projectId select x).ToList(); } diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyService.cs index 8fbfa530..50ab2c5c 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyService.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class ConstructionLogWorkEfficiencyService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取施工日志工效明细列表 /// @@ -15,7 +14,7 @@ namespace BLL /// public static List getListData(string ConstructionLogId) { - return (from x in db.ZHGL_ConstructionLogWorkEfficiency + return (from x in Funs.DB.ZHGL_ConstructionLogWorkEfficiency where x.ConstructionLogId == ConstructionLogId select x).ToList(); } diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionPlanApproveService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionPlanApproveService.cs index 51fc743b..aa10f957 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ConstructionPlanApproveService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionPlanApproveService.cs @@ -1,32 +1,32 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class ConstructionPlanApproveService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取分页列表 /// /// public static IEnumerable getListData(string ConstructionPlanId) { - return from x in db.ZHGL_ConstructionPlanApprove + var db1 = Funs.DB; + return from x in db1.ZHGL_ConstructionPlanApprove where x.ConstructionPlanId == ConstructionPlanId && x.ApproveDate != null orderby x.ApproveDate select new { x.ConstructionPlanApproveId, x.ConstructionPlanId, - ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + ApproveMan = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), x.ApproveDate, x.ApproveIdea, x.IsAgree, x.ApproveType, - UserName = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + UserName = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), IsAgreeName = x.IsAgree == true ? "同意" : "不同意" }; } @@ -95,7 +95,7 @@ namespace BLL /// 一个总承包商施工计划审批实体 public static Model.ZHGL_ConstructionPlanApprove GetConstructionPlanApproveByConstructionPlanId(string constructionPlanId) { - return db.ZHGL_ConstructionPlanApprove.FirstOrDefault(x => x.ConstructionPlanId == constructionPlanId && x.ApproveDate == null); + return Funs.DB.ZHGL_ConstructionPlanApprove.FirstOrDefault(x => x.ConstructionPlanId == constructionPlanId && x.ApproveDate == null); } /// /// 修改总承包商施工计划审批信息 @@ -117,7 +117,7 @@ namespace BLL public static Model.ZHGL_ConstructionPlanApprove GetComplie(string ConstructionPlanId) { - return db.ZHGL_ConstructionPlanApprove.FirstOrDefault(x => x.ConstructionPlanId == ConstructionPlanId && x.ApproveType == BLL.Const.ConstructionPlan_Compile); + return Funs.DB.ZHGL_ConstructionPlanApprove.FirstOrDefault(x => x.ConstructionPlanId == ConstructionPlanId && x.ApproveType == BLL.Const.ConstructionPlan_Compile); } public static Model.ZHGL_ConstructionPlanApprove GetConstructionPlanApproveById(string ConstructionPlanApproveId) { diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionPlanService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionPlanService.cs index fd6abc1f..8c268639 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ConstructionPlanService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionPlanService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class ConstructionPlanService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取总承包商施工计划 diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionReportApproveService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionReportApproveService.cs index 8a41fb9c..603102ef 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ConstructionReportApproveService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionReportApproveService.cs @@ -1,32 +1,32 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class ConstructionReportApproveService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取分页列表 /// /// public static IEnumerable getListData(string ConstructionReportId) { - return from x in db.ZHGL_ConstructionReportApprove + var db1 = Funs.DB; + return from x in db1.ZHGL_ConstructionReportApprove where x.ConstructionReportId == ConstructionReportId && x.ApproveDate != null orderby x.ApproveDate select new { x.ConstructionReportApproveId, x.ConstructionReportId, - ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + ApproveMan = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), x.ApproveDate, x.ApproveIdea, x.IsAgree, x.ApproveType, - UserName = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + UserName = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), IsAgreeName = x.IsAgree == true ? "同意" : "不同意" }; } @@ -95,7 +95,7 @@ namespace BLL /// 一个总承包商施工报告审批实体 public static Model.ZHGL_ConstructionReportApprove GetConstructionReportApproveByConstructionReportId(string constructionReportId) { - return db.ZHGL_ConstructionReportApprove.FirstOrDefault(x => x.ConstructionReportId == constructionReportId && x.ApproveDate == null); + return Funs.DB.ZHGL_ConstructionReportApprove.FirstOrDefault(x => x.ConstructionReportId == constructionReportId && x.ApproveDate == null); } /// /// 修改总承包商施工报告审批信息 @@ -117,7 +117,7 @@ namespace BLL public static Model.ZHGL_ConstructionReportApprove GetComplie(string ConstructionReportId) { - return db.ZHGL_ConstructionReportApprove.FirstOrDefault(x => x.ConstructionReportId == ConstructionReportId && x.ApproveType == BLL.Const.ConstructionReport_Compile); + return Funs.DB.ZHGL_ConstructionReportApprove.FirstOrDefault(x => x.ConstructionReportId == ConstructionReportId && x.ApproveType == BLL.Const.ConstructionReport_Compile); } public static Model.ZHGL_ConstructionReportApprove GetConstructionReportApproveById(string ConstructionReportApproveId) { diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionReportService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionReportService.cs index d89b59a0..61d3577d 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ConstructionReportService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionReportService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class ConstructionReportService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取总承包商施工报告 diff --git a/SGGL/BLL/PZHGL/InformationProject/PictureService.cs b/SGGL/BLL/PZHGL/InformationProject/PictureService.cs index cccc4104..8870efa7 100644 --- a/SGGL/BLL/PZHGL/InformationProject/PictureService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/PictureService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class PictureService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取项目图片 diff --git a/SGGL/BLL/PZHGL/InformationProject/ProjectConstructionLogService.cs b/SGGL/BLL/PZHGL/InformationProject/ProjectConstructionLogService.cs index 60cff24c..4a98e2dd 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ProjectConstructionLogService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ProjectConstructionLogService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class ProjectConstructionLogService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取项目级施工日志 diff --git a/SGGL/BLL/PZHGL/InformationProject/ReceiveFileManagerService.cs b/SGGL/BLL/PZHGL/InformationProject/ReceiveFileManagerService.cs index 722b84cc..b578b0b6 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ReceiveFileManagerService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ReceiveFileManagerService.cs @@ -8,8 +8,6 @@ namespace BLL /// public static class ReceiveFileManagerService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据主键获取一般来文 /// @@ -203,8 +201,9 @@ namespace BLL newReceiveFileManager.FromId = getFile.ReceiveFileManagerId; newReceiveFileManager.FromType = "2"; - db.InformationProject_ReceiveFileManager.InsertOnSubmit(newReceiveFileManager); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.InformationProject_ReceiveFileManager.InsertOnSubmit(newReceiveFileManager); + db1.SubmitChanges(); ////增加一条编码记录 BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ReceiveFileManagerMenuId, newReceiveFileManager.ProjectId, null, newReceiveFileManager.ReceiveFileManagerId, newReceiveFileManager.GetFileDate); diff --git a/SGGL/BLL/PZHGL/InformationProject/WorkHandoverApproveService.cs b/SGGL/BLL/PZHGL/InformationProject/WorkHandoverApproveService.cs index 28a6961c..c76923e7 100644 --- a/SGGL/BLL/PZHGL/InformationProject/WorkHandoverApproveService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/WorkHandoverApproveService.cs @@ -1,32 +1,32 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class WorkHandoverApproveService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取分页列表 /// /// public static IEnumerable getListData(string WorkHandoverId) { - return from x in db.ZHGL_WorkHandoverApprove + var db1 = Funs.DB; + return from x in db1.ZHGL_WorkHandoverApprove where x.WorkHandoverId == WorkHandoverId && x.ApproveDate != null orderby x.ApproveDate select new { x.WorkHandoverApproveId, x.WorkHandoverId, - ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + ApproveMan = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), x.ApproveDate, x.ApproveIdea, x.IsAgree, x.ApproveType, - PersonName = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + PersonName = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), IsAgreeName = x.IsAgree == true ? "同意" : "不同意" }; } @@ -95,7 +95,7 @@ namespace BLL /// 一个工作交接审批实体 public static Model.ZHGL_WorkHandoverApprove GetWorkHandoverApproveByWorkHandoverId(string constructionPlanId) { - return db.ZHGL_WorkHandoverApprove.FirstOrDefault(x => x.WorkHandoverId == constructionPlanId && x.ApproveDate == null); + return Funs.DB.ZHGL_WorkHandoverApprove.FirstOrDefault(x => x.WorkHandoverId == constructionPlanId && x.ApproveDate == null); } /// /// 修改工作交接审批信息 @@ -117,7 +117,7 @@ namespace BLL public static Model.ZHGL_WorkHandoverApprove GetComplie(string WorkHandoverId) { - return db.ZHGL_WorkHandoverApprove.FirstOrDefault(x => x.WorkHandoverId == WorkHandoverId && x.ApproveType == BLL.Const.WorkHandover_Compile); + return Funs.DB.ZHGL_WorkHandoverApprove.FirstOrDefault(x => x.WorkHandoverId == WorkHandoverId && x.ApproveType == BLL.Const.WorkHandover_Compile); } public static Model.ZHGL_WorkHandoverApprove GetWorkHandoverApproveById(string WorkHandoverApproveId) { diff --git a/SGGL/BLL/PZHGL/InformationProject/WorkHandoverDetailService.cs b/SGGL/BLL/PZHGL/InformationProject/WorkHandoverDetailService.cs index d21e8cfb..04a1c7d8 100644 --- a/SGGL/BLL/PZHGL/InformationProject/WorkHandoverDetailService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/WorkHandoverDetailService.cs @@ -1,13 +1,12 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class WorkHandoverDetailService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取工作交接明细列表 /// @@ -16,7 +15,7 @@ namespace BLL /// public static IEnumerable getListData(string WorkHandoverId) { - return from x in db.ZHGL_WorkHandoverDetail + return from x in Funs.DB.ZHGL_WorkHandoverDetail where x.WorkHandoverId == WorkHandoverId select new { diff --git a/SGGL/BLL/PZHGL/InformationProject/WorkHandoverService.cs b/SGGL/BLL/PZHGL/InformationProject/WorkHandoverService.cs index e782f628..65a203b0 100644 --- a/SGGL/BLL/PZHGL/InformationProject/WorkHandoverService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/WorkHandoverService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class WorkHandoverService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取工作交接 diff --git a/SGGL/BLL/PZHGL/ProjectData/ProjectMapService.cs b/SGGL/BLL/PZHGL/ProjectData/ProjectMapService.cs index f43308b7..1350fb2b 100644 --- a/SGGL/BLL/PZHGL/ProjectData/ProjectMapService.cs +++ b/SGGL/BLL/PZHGL/ProjectData/ProjectMapService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class ProjectMapService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取项目地图 diff --git a/SGGL/BLL/Person/PersonTotalService.cs b/SGGL/BLL/Person/PersonTotalService.cs index cfca12ec..1bbecedc 100644 --- a/SGGL/BLL/Person/PersonTotalService.cs +++ b/SGGL/BLL/Person/PersonTotalService.cs @@ -5,7 +5,7 @@ namespace BLL { public static class PersonTotalService { - public static Model.SGGLDB db = Funs.DB; + /// /// 获取人员信息 diff --git a/SGGL/BLL/Person/Person_DutyService.cs b/SGGL/BLL/Person/Person_DutyService.cs index 925cbc4c..29963576 100644 --- a/SGGL/BLL/Person/Person_DutyService.cs +++ b/SGGL/BLL/Person/Person_DutyService.cs @@ -2,13 +2,12 @@ using System; using System.Collections; using System.Linq; +using Model; namespace BLL { public static class Person_DutyService { - public static Model.SGGLDB db = Funs.DB; - #region 获取列表数据 /// /// 记录数 @@ -22,7 +21,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.Person_Duty + private static IQueryable getDataLists = from x in Funs.DB.Person_Duty select x; /// @@ -49,7 +48,7 @@ namespace BLL x.CompilePersonId, x.CompileTime, x.WorkPostId, - WorkPostName=db.Base_WorkPost.First(U=>U.WorkPostId == x.WorkPostId).WorkPostName, + WorkPostName=Funs.DB.Base_WorkPost.First(U=>U.WorkPostId == x.WorkPostId).WorkPostName, x.ApprovePersonId, x.ApproveTime, x.State, diff --git a/SGGL/BLL/Person/Person_DutyTemplateService.cs b/SGGL/BLL/Person/Person_DutyTemplateService.cs index 68621236..f0eb52d1 100644 --- a/SGGL/BLL/Person/Person_DutyTemplateService.cs +++ b/SGGL/BLL/Person/Person_DutyTemplateService.cs @@ -4,7 +4,7 @@ namespace BLL { public static class Person_DutyTemplateService { - public static Model.SGGLDB db = Funs.DB; + /// /// 获取员工责任书模板信息 /// diff --git a/SGGL/BLL/Person/Person_PersonContractService.cs b/SGGL/BLL/Person/Person_PersonContractService.cs index a9187ad7..c687d524 100644 --- a/SGGL/BLL/Person/Person_PersonContractService.cs +++ b/SGGL/BLL/Person/Person_PersonContractService.cs @@ -3,13 +3,12 @@ using System; using System.Collections; using System.Linq; using System.Runtime.InteropServices.ComTypes; +using Model; namespace BLL { public static class Person_PersonContractService { - public static Model.SGGLDB db = Funs.DB; - #region 获取列表数据 /// /// 记录数 @@ -23,7 +22,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.Person_PersonContract + private static IQueryable getDataLists = from x in Funs.DB.Person_PersonContract select x; /// @@ -41,15 +40,16 @@ namespace BLL return null; } getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + var db1 = Funs.DB; return from x in getDataList select new { x.PersonContractId, x.PersonId, x.UnitId, - db.Base_Unit.First(u => u.UnitId == x.UnitId).UnitName, + db1.Base_Unit.First(u => u.UnitId == x.UnitId).UnitName, x.ProjectId, - db.Base_Project.First(u => u.ProjectId == x.ProjectId).ProjectName, + db1.Base_Project.First(u => u.ProjectId == x.ProjectId).ProjectName, x.LeadManId, x.Telephone, x.ContractType, diff --git a/SGGL/BLL/Person/Person_PersonTrainService.cs b/SGGL/BLL/Person/Person_PersonTrainService.cs index e6104aa6..0273e636 100644 --- a/SGGL/BLL/Person/Person_PersonTrainService.cs +++ b/SGGL/BLL/Person/Person_PersonTrainService.cs @@ -2,13 +2,12 @@ using System; using System.Collections; using System.Linq; +using Model; namespace BLL { public static class Person_PersonTrainService { - public static Model.SGGLDB db = Funs.DB; - #region 获取列表数据 /// /// 记录数 @@ -22,7 +21,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.Person_PersonTrain + private static IQueryable getDataLists = from x in Funs.DB.Person_PersonTrain select x; /// @@ -46,7 +45,7 @@ namespace BLL x.PersonTrainId, x.PersonId, x.TrainTypeId, - db.Base_TrainType.First(u => u.TrainTypeId == x.TrainTypeId).TrainTypeName, + Funs.DB.Base_TrainType.First(u => u.TrainTypeId == x.TrainTypeId).TrainTypeName, x.TrainDate, x.TrainPlace, x.TrainResult, diff --git a/SGGL/BLL/Person/Person_PersonsService.cs b/SGGL/BLL/Person/Person_PersonsService.cs index 2590fff4..5a673b31 100644 --- a/SGGL/BLL/Person/Person_PersonsService.cs +++ b/SGGL/BLL/Person/Person_PersonsService.cs @@ -15,8 +15,6 @@ namespace BLL /// public static class Person_PersonsService { - public static Model.SGGLDB db = Funs.DB; - #region 获取人员列表信息 /// /// 记录数 @@ -30,7 +28,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.Person_Persons + private static IQueryable getDataLists = from x in Funs.DB.Person_Persons where x.PersonId != Const.sysglyId && x.PersonId != Const.hfnbdId select x; @@ -57,9 +55,11 @@ namespace BLL { getDataList = getDataList.Where(e => e.DepartId == departId); } + + var db1 = Funs.DB; if (!string.IsNullOrEmpty(projetcId) && projetcId != Const._Null) { - var idLists = (from x in db.SitePerson_PersonItem + var idLists = (from x in db1.SitePerson_PersonItem where x.ProjectId == projetcId && !x.OutTime.HasValue select x.PersonId).Distinct().ToList(); getDataList = getDataList.Where(x => idLists.Contains(x.PersonId)); @@ -115,9 +115,9 @@ namespace BLL Sex = x.Sex ?? "1", x.Birthday, x.UnitId, - db.Base_Unit.First(u => u.UnitId == x.UnitId).UnitName, + db1.Base_Unit.First(u => u.UnitId == x.UnitId).UnitName, x.DepartId, - db.Base_Depart.First(u => u.DepartId == x.DepartId).DepartName, + db1.Base_Depart.First(u => u.DepartId == x.DepartId).DepartName, x.WorkPostId, WorkPostName = WorkPostService.getWorkPostNamesWorkPostIds(x.WorkPostId), x.PostTitleId, @@ -975,12 +975,12 @@ namespace BLL } public static void DeletePerson_PersonsById(string PersonId) { - - Model.Person_Persons table = db.Person_Persons.FirstOrDefault(x => x.PersonId == PersonId); + var db1 = Funs.DB; + Model.Person_Persons table = db1.Person_Persons.FirstOrDefault(x => x.PersonId == PersonId); if (table != null) { - db.Person_Persons.DeleteOnSubmit(table); - db.SubmitChanges(); + db1.Person_Persons.DeleteOnSubmit(table); + db1.SubmitChanges(); } } diff --git a/SGGL/BLL/Person/Person_QuarterCheckApproveService.cs b/SGGL/BLL/Person/Person_QuarterCheckApproveService.cs index 1c2c61f2..545d32e1 100644 --- a/SGGL/BLL/Person/Person_QuarterCheckApproveService.cs +++ b/SGGL/BLL/Person/Person_QuarterCheckApproveService.cs @@ -6,7 +6,7 @@ namespace BLL { public static class Person_QuarterCheckApproveService { - public static Model.SGGLDB db = Funs.DB; + /// /// 获取人员信息 diff --git a/SGGL/BLL/Person/Person_QuarterCheckItemService.cs b/SGGL/BLL/Person/Person_QuarterCheckItemService.cs index a0fe6ef5..287a3ba3 100644 --- a/SGGL/BLL/Person/Person_QuarterCheckItemService.cs +++ b/SGGL/BLL/Person/Person_QuarterCheckItemService.cs @@ -6,7 +6,7 @@ namespace BLL { public static class Person_QuarterCheckItemService { - public static Model.SGGLDB db = Funs.DB; + /// /// 获取人员信息 diff --git a/SGGL/BLL/Person/Person_QuarterCheckService.cs b/SGGL/BLL/Person/Person_QuarterCheckService.cs index fb6d2b53..bc4c8121 100644 --- a/SGGL/BLL/Person/Person_QuarterCheckService.cs +++ b/SGGL/BLL/Person/Person_QuarterCheckService.cs @@ -7,7 +7,7 @@ namespace BLL { public static class Person_QuarterCheckService { - public static Model.SGGLDB db = Funs.DB; + /// /// 获取人员信息 diff --git a/SGGL/BLL/Person/Person_ShuntApproveService.cs b/SGGL/BLL/Person/Person_ShuntApproveService.cs index 6f15726c..883be408 100644 --- a/SGGL/BLL/Person/Person_ShuntApproveService.cs +++ b/SGGL/BLL/Person/Person_ShuntApproveService.cs @@ -1,13 +1,12 @@ using System.Collections; using System.Collections.Generic; using System.Linq; +using Model; namespace BLL { public class Person_ShuntApproveService { - public static Model.SGGLDB db = Funs.DB; - /// /// 获取分流管理模板列表 /// @@ -16,14 +15,15 @@ namespace BLL /// public static IEnumerable getListData(string ShuntId) { - return from x in db.Person_ShuntApprove + var db1 = Funs.DB; + return from x in db1.Person_ShuntApprove where x.ShuntId == ShuntId && x.ApproveDate != null orderby x.ApproveDate select new { x.ShuntApproveId, x.ShuntId, - ApproveMan = (from y in db.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), + ApproveMan = (from y in db1.Person_Persons where y.PersonId == x.ApproveMan select y.PersonName).First(), x.ApproveDate, x.IsAgree, x.ApproveIdea, @@ -38,7 +38,7 @@ namespace BLL /// 一个分流管理审批实体 public static Model.Person_ShuntApprove GetShuntApproveByShuntApproveId(string ShuntApproveId) { - return db.Person_ShuntApprove.FirstOrDefault(x => x.ShuntApproveId == ShuntApproveId); + return Funs.DB.Person_ShuntApprove.FirstOrDefault(x => x.ShuntApproveId == ShuntApproveId); } /// @@ -48,7 +48,7 @@ namespace BLL /// 一个分流管理审批实体 public static Model.Person_ShuntApprove GetShuntApproveByShuntId(string ShuntId) { - return db.Person_ShuntApprove.FirstOrDefault(x => x.ShuntId == ShuntId && x.ApproveDate == null); + return Funs.DB.Person_ShuntApprove.FirstOrDefault(x => x.ShuntId == ShuntId && x.ApproveDate == null); } /// @@ -58,17 +58,17 @@ namespace BLL /// 一个分流管理审批实体 public static Model.Person_ShuntApprove GetShuntApproveByApproveId(string approveId) { - return db.Person_ShuntApprove.FirstOrDefault(x => x.ShuntApproveId == approveId); + return Funs.DB.Person_ShuntApprove.FirstOrDefault(x => x.ShuntApproveId == approveId); } public static Model.Person_ShuntApprove GetComplie(string ShuntId) { - return db.Person_ShuntApprove.FirstOrDefault(x => x.ShuntId == ShuntId && x.ApproveType == BLL.Const.Shunt_Compile); + return Funs.DB.Person_ShuntApprove.FirstOrDefault(x => x.ShuntId == ShuntId && x.ApproveType == BLL.Const.Shunt_Compile); } public static Model.Person_ShuntApprove GetAudit(string ShuntId) { - return db.Person_ShuntApprove.FirstOrDefault(x => x.ShuntId == ShuntId && x.ApproveType == BLL.Const.Shunt_Audit); + return Funs.DB.Person_ShuntApprove.FirstOrDefault(x => x.ShuntId == ShuntId && x.ApproveType == BLL.Const.Shunt_Audit); } /// @@ -78,7 +78,7 @@ namespace BLL /// 分流管理审批集合 public static List GetShuntApprovesByShuntApproveId(string ShuntApproveId) { - return (from x in db.Person_ShuntApprove where x.ShuntApproveId == ShuntApproveId select x).ToList(); + return (from x in Funs.DB.Person_ShuntApprove where x.ShuntApproveId == ShuntApproveId select x).ToList(); } /// diff --git a/SGGL/BLL/Person/Person_ShuntService.cs b/SGGL/BLL/Person/Person_ShuntService.cs index f4b0ab8f..4dd4bf30 100644 --- a/SGGL/BLL/Person/Person_ShuntService.cs +++ b/SGGL/BLL/Person/Person_ShuntService.cs @@ -2,13 +2,12 @@ using NPOI.SS.Formula.Functions; using System.Collections; using System.Linq; +using Model; namespace BLL { public class Person_ShuntService { - public static Model.SGGLDB db = Funs.DB; - #region 获取人员列表信息 /// /// 记录数 @@ -22,7 +21,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.Person_Persons + private static IQueryable getDataLists = from x in Funs.DB.Person_Persons where x.PersonId != Const.sysglyId && x.PersonId != Const.hfnbdId && x.UnitId == Const.UnitId_SEDIN && x.DepartId == Const.Depart_constructionId && x.CurrentProjectId == null && (!x.IsOffice.HasValue || x.IsOffice == false) diff --git a/SGGL/BLL/Person/Person_TrainingPlanService.cs b/SGGL/BLL/Person/Person_TrainingPlanService.cs index a5ee8904..1ec02e41 100644 --- a/SGGL/BLL/Person/Person_TrainingPlanService.cs +++ b/SGGL/BLL/Person/Person_TrainingPlanService.cs @@ -4,7 +4,7 @@ namespace BLL { public static class Person_TrainingPlanService { - public static Model.SGGLDB db = Funs.DB; + /// /// 获取人员信息 /// diff --git a/SGGL/BLL/PersonManage/Test/ServerTestPlanService.cs b/SGGL/BLL/PersonManage/Test/ServerTestPlanService.cs index 22164072..c62ac7fa 100644 --- a/SGGL/BLL/PersonManage/Test/ServerTestPlanService.cs +++ b/SGGL/BLL/PersonManage/Test/ServerTestPlanService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class ServerTestPlanService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取知识竞赛计划 diff --git a/SGGL/BLL/PersonManage/Test/ServerTestPlanTrainingService.cs b/SGGL/BLL/PersonManage/Test/ServerTestPlanTrainingService.cs index fc02ec7d..92bbc507 100644 --- a/SGGL/BLL/PersonManage/Test/ServerTestPlanTrainingService.cs +++ b/SGGL/BLL/PersonManage/Test/ServerTestPlanTrainingService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class ServerTestPlanTrainingService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取知识竞赛计划 diff --git a/SGGL/BLL/PersonManage/Test/ServerTestRecordService.cs b/SGGL/BLL/PersonManage/Test/ServerTestRecordService.cs index 748e294e..70c8c893 100644 --- a/SGGL/BLL/PersonManage/Test/ServerTestRecordService.cs +++ b/SGGL/BLL/PersonManage/Test/ServerTestRecordService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class ServerTestRecordService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取考试记录 diff --git a/SGGL/BLL/ProjectData/MainItemService.cs b/SGGL/BLL/ProjectData/MainItemService.cs index a037b078..311bfeba 100644 --- a/SGGL/BLL/ProjectData/MainItemService.cs +++ b/SGGL/BLL/ProjectData/MainItemService.cs @@ -1,13 +1,12 @@ using System.Collections.Generic; using System.Linq; using System.Web.UI.WebControls; +using Model; namespace BLL { public class MainItemService { - public static Model.SGGLDB db = Funs.DB; - /// /// 记录数 /// @@ -20,7 +19,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable qq = from x in db.ProjectData_MainItem select x; + private static IQueryable qq = from x in Funs.DB.ProjectData_MainItem select x; /// diff --git a/SGGL/BLL/ProjectData/ProjectSateService.cs b/SGGL/BLL/ProjectData/ProjectSateService.cs index 1d1e43e0..7ebd9ead 100644 --- a/SGGL/BLL/ProjectData/ProjectSateService.cs +++ b/SGGL/BLL/ProjectData/ProjectSateService.cs @@ -7,7 +7,7 @@ namespace BLL /// public static class ProjectSateService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取项目状态及软件关闭信息 diff --git a/SGGL/BLL/ProjectData/ProjectUnitService.cs b/SGGL/BLL/ProjectData/ProjectUnitService.cs index bc03d2d0..4d93ab2d 100644 --- a/SGGL/BLL/ProjectData/ProjectUnitService.cs +++ b/SGGL/BLL/ProjectData/ProjectUnitService.cs @@ -6,8 +6,6 @@ public static class ProjectUnitService { - public static Model.SGGLDB db = Funs.DB; - /// ///获取项目单位信息 /// @@ -177,11 +175,12 @@ /// public static void DeleteProjectUnitByProjectId(string projectId) { - var q = (from x in db.Project_ProjectUnit where x.ProjectId == projectId select x).ToList(); + var db1 = Funs.DB; + var q = (from x in db1.Project_ProjectUnit where x.ProjectId == projectId select x).ToList(); if (q != null) { - db.Project_ProjectUnit.DeleteAllOnSubmit(q); - db.SubmitChanges(); + db1.Project_ProjectUnit.DeleteAllOnSubmit(q); + db1.SubmitChanges(); } } diff --git a/SGGL/BLL/ProjectData/TeamGroupService.cs b/SGGL/BLL/ProjectData/TeamGroupService.cs index f4ef60c2..7f0d711d 100644 --- a/SGGL/BLL/ProjectData/TeamGroupService.cs +++ b/SGGL/BLL/ProjectData/TeamGroupService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class TeamGroupService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取班组信息 diff --git a/SGGL/BLL/ProjectData/UnitWorkService.cs b/SGGL/BLL/ProjectData/UnitWorkService.cs index c034f5f8..868f18d4 100644 --- a/SGGL/BLL/ProjectData/UnitWorkService.cs +++ b/SGGL/BLL/ProjectData/UnitWorkService.cs @@ -8,7 +8,7 @@ namespace BLL { public class UnitWorkService { - public static Model.SGGLDB db = Funs.DB; + /// /// 添加单位工程信息 diff --git a/SGGL/BLL/SmartSite/EquipmentService.cs b/SGGL/BLL/SmartSite/EquipmentService.cs index 374fe59d..a1951ad7 100644 --- a/SGGL/BLL/SmartSite/EquipmentService.cs +++ b/SGGL/BLL/SmartSite/EquipmentService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class EquipmentService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取设备管理 diff --git a/SGGL/BLL/SmartSite/EquipmentSoftService.cs b/SGGL/BLL/SmartSite/EquipmentSoftService.cs index 19084553..a5f160fe 100644 --- a/SGGL/BLL/SmartSite/EquipmentSoftService.cs +++ b/SGGL/BLL/SmartSite/EquipmentSoftService.cs @@ -8,7 +8,7 @@ namespace BLL /// public static class EquipmentSoftService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取软件管理 diff --git a/SGGL/BLL/SysManage/DepartService.cs b/SGGL/BLL/SysManage/DepartService.cs index f482d3b3..c5e3373b 100644 --- a/SGGL/BLL/SysManage/DepartService.cs +++ b/SGGL/BLL/SysManage/DepartService.cs @@ -5,7 +5,7 @@ namespace BLL { public static class DepartService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取信息 diff --git a/SGGL/BLL/SysManage/LogService.cs b/SGGL/BLL/SysManage/LogService.cs index 83601548..c6cbe637 100644 --- a/SGGL/BLL/SysManage/LogService.cs +++ b/SGGL/BLL/SysManage/LogService.cs @@ -7,7 +7,7 @@ namespace BLL public static class LogService { - public static Model.SGGLDB db = Funs.DB; + /// /// Ӳ־ diff --git a/SGGL/BLL/SysManage/RoleItemService.cs b/SGGL/BLL/SysManage/RoleItemService.cs index 9905d668..a8844359 100644 --- a/SGGL/BLL/SysManage/RoleItemService.cs +++ b/SGGL/BLL/SysManage/RoleItemService.cs @@ -5,7 +5,7 @@ namespace BLL { public static class RoleItemService { - public static Model.SGGLDB db = Funs.DB; + /// /// 获取角色明细信息 diff --git a/SGGL/BLL/SysManage/RoleService.cs b/SGGL/BLL/SysManage/RoleService.cs index 9362af6d..64c01bc0 100644 --- a/SGGL/BLL/SysManage/RoleService.cs +++ b/SGGL/BLL/SysManage/RoleService.cs @@ -5,7 +5,7 @@ public static class RoleService { - public static Model.SGGLDB db = Funs.DB; + /// /// 获取角色信息 diff --git a/SGGL/BLL/SysManage/SysHttplogService.cs b/SGGL/BLL/SysManage/SysHttplogService.cs index 12bcfdf7..b0e8cd51 100644 --- a/SGGL/BLL/SysManage/SysHttplogService.cs +++ b/SGGL/BLL/SysManage/SysHttplogService.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; +using Model; namespace BLL @@ -11,9 +12,6 @@ namespace BLL public static class SysHttplogService { - public static Model.SGGLDB db = Funs.DB; - - #region 获取列表 /// /// 记录数 @@ -25,7 +23,7 @@ namespace BLL } public static List GetSys_HttpLogByModle(Model.Sys_HttpLog table) { - var q = from x in db.Sys_HttpLog + var q = from x in Funs.DB.Sys_HttpLog where (string.IsNullOrEmpty(table.HttpLogId) || x.HttpLogId.Contains(table.HttpLogId)) && (string.IsNullOrEmpty(table.UserName) || x.UserName.Contains(table.UserName)) && @@ -74,7 +72,7 @@ namespace BLL public static Model.Sys_HttpLog GetSys_HttpLogById(string HttpLogId) { - return db.Sys_HttpLog.FirstOrDefault(x => x.HttpLogId == HttpLogId); + return Funs.DB.Sys_HttpLog.FirstOrDefault(x => x.HttpLogId == HttpLogId); } @@ -90,22 +88,23 @@ namespace BLL LogTxt = newtable.LogTxt, MeThod = newtable.MeThod, }; - db.Sys_HttpLog.InsertOnSubmit(table); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Sys_HttpLog.InsertOnSubmit(table); + db1.SubmitChanges(); } public static void AddBulkSys_HttpLog(List newtables) { - - db.Sys_HttpLog.InsertAllOnSubmit(newtables); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Sys_HttpLog.InsertAllOnSubmit(newtables); + db1.SubmitChanges(); } public static void UpdateSys_HttpLog(Model.Sys_HttpLog newtable) { - - Model.Sys_HttpLog table = db.Sys_HttpLog.FirstOrDefault(x => x.HttpLogId == newtable.HttpLogId); + var db1 = Funs.DB; + Model.Sys_HttpLog table = db1.Sys_HttpLog.FirstOrDefault(x => x.HttpLogId == newtable.HttpLogId); if (table != null) { table.HttpLogId = newtable.HttpLogId; @@ -114,28 +113,29 @@ namespace BLL table.HttpUrl = newtable.HttpUrl; table.LogTxt = newtable.LogTxt; table.MeThod = newtable.MeThod; - db.SubmitChanges(); + db1.SubmitChanges(); } } public static void DeleteSys_HttpLogById(string HttpLogId) { - - Model.Sys_HttpLog table = db.Sys_HttpLog.FirstOrDefault(x => x.HttpLogId == HttpLogId); + var db1 = Funs.DB; + Model.Sys_HttpLog table = db1.Sys_HttpLog.FirstOrDefault(x => x.HttpLogId == HttpLogId); if (table != null) { - db.Sys_HttpLog.DeleteOnSubmit(table); - db.SubmitChanges(); + db1.Sys_HttpLog.DeleteOnSubmit(table); + db1.SubmitChanges(); } } public static void DeleteALLSys_HttpLog() { - if (db.Sys_HttpLog != null) + var db1 = Funs.DB; + if (db1.Sys_HttpLog != null) { - db.Sys_HttpLog.DeleteAllOnSubmit(db.Sys_HttpLog); - db.SubmitChanges(); + db1.Sys_HttpLog.DeleteAllOnSubmit(db1.Sys_HttpLog); + db1.SubmitChanges(); } } diff --git a/SGGL/BLL/SysManage/SysMenuService.cs b/SGGL/BLL/SysManage/SysMenuService.cs index 166d8751..1718031c 100644 --- a/SGGL/BLL/SysManage/SysMenuService.cs +++ b/SGGL/BLL/SysManage/SysMenuService.cs @@ -5,7 +5,7 @@ namespace BLL { public static class SysMenuService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据MenuId获取菜单名称项 diff --git a/SGGL/BLL/SysManage/Sys_UserShowColumnsService.cs b/SGGL/BLL/SysManage/Sys_UserShowColumnsService.cs index 7238ede4..65c1f1f0 100644 --- a/SGGL/BLL/SysManage/Sys_UserShowColumnsService.cs +++ b/SGGL/BLL/SysManage/Sys_UserShowColumnsService.cs @@ -7,8 +7,6 @@ namespace BLL /// public static class Sys_UserShowColumnsService { - public static Model.SGGLDB db = Funs.DB; - /// /// 根据用户ID获取信息 /// @@ -32,8 +30,9 @@ namespace BLL newShowColumns.UserId = showColumns.UserId; newShowColumns.Columns = showColumns.Columns; newShowColumns.ShowType = showColumns.ShowType; - db.Sys_UserShowColumns.InsertOnSubmit(newShowColumns); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Sys_UserShowColumns.InsertOnSubmit(newShowColumns); + db1.SubmitChanges(); } /// @@ -44,12 +43,13 @@ namespace BLL /// public static void UpdateUserShowColumns(Model.Sys_UserShowColumns showColumns) { - Model.Sys_UserShowColumns newShowColumns = db.Sys_UserShowColumns.FirstOrDefault(e => e.ShowColumnId == showColumns.ShowColumnId); + var db1 = Funs.DB; + Model.Sys_UserShowColumns newShowColumns = db1.Sys_UserShowColumns.FirstOrDefault(e => e.ShowColumnId == showColumns.ShowColumnId); if (newShowColumns != null) { newShowColumns.Columns = showColumns.Columns; newShowColumns.ShowType = showColumns.ShowType; - db.SubmitChanges(); + db1.SubmitChanges(); } } @@ -59,9 +59,10 @@ namespace BLL /// public static void DeleteUserShowColumns(string showColumnId) { - Model.Sys_UserShowColumns newShowColumns = db.Sys_UserShowColumns.First(e => e.ShowColumnId == showColumnId); - db.Sys_UserShowColumns.DeleteOnSubmit(newShowColumns); - db.SubmitChanges(); + var db1 = Funs.DB; + Model.Sys_UserShowColumns newShowColumns = db1.Sys_UserShowColumns.First(e => e.ShowColumnId == showColumnId); + db1.Sys_UserShowColumns.DeleteOnSubmit(newShowColumns); + db1.SubmitChanges(); } } } diff --git a/SGGL/BLL/SysManage/UnitService.cs b/SGGL/BLL/SysManage/UnitService.cs index 8d7a7b0d..087ab937 100644 --- a/SGGL/BLL/SysManage/UnitService.cs +++ b/SGGL/BLL/SysManage/UnitService.cs @@ -11,7 +11,7 @@ namespace BLL /// public static class UnitService { - public static Model.SGGLDB db = Funs.DB; + /// /// 获取单位信息 diff --git a/SGGL/BLL/TaskScheduling/InterFaceService/DataForJTApiService.cs b/SGGL/BLL/TaskScheduling/InterFaceService/DataForJTApiService.cs index c72bcb90..dbb986a9 100644 --- a/SGGL/BLL/TaskScheduling/InterFaceService/DataForJTApiService.cs +++ b/SGGL/BLL/TaskScheduling/InterFaceService/DataForJTApiService.cs @@ -6,7 +6,7 @@ namespace BLL public static class DataForJTApiService { - public static Model.SGGLDB db = Funs.DB; + /// /// ȡӿϢ diff --git a/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceLogService .cs b/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceLogService .cs index 353ace12..cfa8ad4f 100644 --- a/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceLogService .cs +++ b/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceLogService .cs @@ -7,6 +7,7 @@ using System.Drawing.Printing; using System.Linq; using System.Runtime.InteropServices; using System.Text; +using Model; namespace BLL @@ -14,8 +15,6 @@ namespace BLL public static class InterFaceLogService { - public static Model.SGGLDB db = Funs.DB; - public const string Type1 = "上报"; public const string Type2= "下发"; public const string Type3 = "回调"; @@ -31,7 +30,7 @@ namespace BLL } public static List GetInterFaceLogByModle(Model.InterFaceLog table) { - var q = from x in db.InterFaceLog + var q = from x in Funs.DB.InterFaceLog where (string.IsNullOrEmpty(table.InterFaceLogId) || x.InterFaceLogId.Contains(table.InterFaceLogId)) && (string.IsNullOrEmpty(table.UserId) || x.UserId.Contains(table.UserId)) && @@ -87,7 +86,7 @@ namespace BLL public static Model.InterFaceLog GetInterFaceLogById(string InterFaceLogId) { - return db.InterFaceLog.FirstOrDefault(x=>x.InterFaceLogId==InterFaceLogId); + return Funs.DB.InterFaceLog.FirstOrDefault(x=>x.InterFaceLogId==InterFaceLogId); } @@ -151,7 +150,7 @@ namespace BLL public static void UpdateInterFaceLog(Model.InterFaceLog newtable) { - Model.InterFaceLog table = db.InterFaceLog.FirstOrDefault(x=>x.InterFaceLogId==newtable.InterFaceLogId); + Model.InterFaceLog table = Funs.DB.InterFaceLog.FirstOrDefault(x=>x.InterFaceLogId==newtable.InterFaceLogId); if (table != null) { table.InterFaceLogId=newtable.InterFaceLogId; diff --git a/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceTaskService .cs b/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceTaskService .cs index ce3b8fe3..27ea69ea 100644 --- a/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceTaskService .cs +++ b/SGGL/BLL/TaskScheduling/InterFaceService/InterFaceTaskService .cs @@ -15,10 +15,7 @@ namespace BLL public static class InterFaceTaskService { - public static Model.SGGLDB db = Funs.DB; - - - #region 获取列表 + #region 获取列表 /// /// 记录数 /// @@ -29,7 +26,7 @@ namespace BLL } public static List GetInterFaceTaskByModle(Model.InterFaceTask table) { - var q= from x in db.InterFaceTask + var q= from x in Funs.DB.InterFaceTask where ( string.IsNullOrEmpty(table.InterFaceTaskId)||x.InterFaceTaskId.Contains(table.InterFaceTaskId)) && ( string.IsNullOrEmpty(table.InterFaceName)||x.InterFaceName.Contains(table.InterFaceName)) && @@ -73,7 +70,7 @@ namespace BLL public static Model.InterFaceTask GetInterFaceTaskById(string InterFaceTaskId) { - return db.InterFaceTask.FirstOrDefault(x=>x.InterFaceTaskId==InterFaceTaskId); + return Funs.DB.InterFaceTask.FirstOrDefault(x=>x.InterFaceTaskId==InterFaceTaskId); } public static void AddInterFaceTask(Model.InterFaceTask newtable) { @@ -86,15 +83,16 @@ namespace BLL CreateTime=newtable.CreateTime, Enable=newtable.Enable, }; - db.InterFaceTask.InsertOnSubmit(table); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.InterFaceTask.InsertOnSubmit(table); + db1.SubmitChanges(); } public static void UpdateInterFaceTask(Model.InterFaceTask newtable) { - - Model.InterFaceTask table = db.InterFaceTask.FirstOrDefault(x=>x.InterFaceTaskId==newtable.InterFaceTaskId); + var db1 = Funs.DB; + Model.InterFaceTask table = db1.InterFaceTask.FirstOrDefault(x=>x.InterFaceTaskId==newtable.InterFaceTaskId); if (table != null) { table.InterFaceTaskId=newtable.InterFaceTaskId; @@ -103,18 +101,18 @@ namespace BLL table.Frequency=newtable.Frequency; table.CreateTime=newtable.CreateTime; table.Enable=newtable.Enable; - db.SubmitChanges(); + db1.SubmitChanges(); } } public static void DeleteInterFaceTaskById (string InterFaceTaskId) - { - - Model.InterFaceTask table =db.InterFaceTask.FirstOrDefault(x=>x.InterFaceTaskId==InterFaceTaskId); + { + var db1 = Funs.DB; + Model.InterFaceTask table =db1.InterFaceTask.FirstOrDefault(x=>x.InterFaceTaskId==InterFaceTaskId); if (table != null) { - db.InterFaceTask.DeleteOnSubmit(table); - db.SubmitChanges(); + db1.InterFaceTask.DeleteOnSubmit(table); + db1.SubmitChanges(); } } diff --git a/SGGL/BLL/ZHGL/ConstructionMonthReport/ConstructionMonthReportMainCostService.cs b/SGGL/BLL/ZHGL/ConstructionMonthReport/ConstructionMonthReportMainCostService.cs index 5a5743a5..6d65ee80 100644 --- a/SGGL/BLL/ZHGL/ConstructionMonthReport/ConstructionMonthReportMainCostService.cs +++ b/SGGL/BLL/ZHGL/ConstructionMonthReport/ConstructionMonthReportMainCostService.cs @@ -5,7 +5,7 @@ namespace BLL { public class ConstructionMonthReportMainCostService { - public static Model.SGGLDB db = Funs.DB; + /// /// 获取施工月报总包工程施工请款情况模板列表 diff --git a/SGGL/BLL/ZHGL/ConstructionMonthReport/ConstructionMonthReportService.cs b/SGGL/BLL/ZHGL/ConstructionMonthReport/ConstructionMonthReportService.cs index 89733cb7..02b79688 100644 --- a/SGGL/BLL/ZHGL/ConstructionMonthReport/ConstructionMonthReportService.cs +++ b/SGGL/BLL/ZHGL/ConstructionMonthReport/ConstructionMonthReportService.cs @@ -8,7 +8,7 @@ namespace BLL { public class ConstructionMonthReportService { - public static Model.SGGLDB db = Funs.DB; + /// /// 添加施工月报 diff --git a/SGGL/BLL/ZHGL/ConstructionMonthReport/ConstructionMonthReportSubCostService.cs b/SGGL/BLL/ZHGL/ConstructionMonthReport/ConstructionMonthReportSubCostService.cs index df6fa798..ba4fe558 100644 --- a/SGGL/BLL/ZHGL/ConstructionMonthReport/ConstructionMonthReportSubCostService.cs +++ b/SGGL/BLL/ZHGL/ConstructionMonthReport/ConstructionMonthReportSubCostService.cs @@ -5,7 +5,7 @@ namespace BLL { public class ConstructionMonthReportSubCostService { - public static Model.SGGLDB db = Funs.DB; + /// /// 获取施工月报分包工程施工付款情况模板列表 diff --git a/SGGL/BLL/ZHGL/DataSync/HJGLData_DefectService.cs b/SGGL/BLL/ZHGL/DataSync/HJGLData_DefectService.cs index f3eecb3a..a4c0ba33 100644 --- a/SGGL/BLL/ZHGL/DataSync/HJGLData_DefectService.cs +++ b/SGGL/BLL/ZHGL/DataSync/HJGLData_DefectService.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; +using Model; namespace BLL @@ -11,9 +12,6 @@ namespace BLL public static class HJGLData_DefectService { - public static Model.SGGLDB db = Funs.DB; - - #region 获取列表 /// /// 记录数 @@ -25,7 +23,7 @@ namespace BLL } public static List GetHJGLData_DefectByModle(Model.HJGLData_Defect table) { - var q = from x in db.HJGLData_Defect + var q = from x in Funs.DB.HJGLData_Defect where (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) && @@ -69,11 +67,11 @@ namespace BLL public static Model.HJGLData_Defect GetHJGLData_DefectById(string Id) { - return db.HJGLData_Defect.FirstOrDefault(x => x.Id == Id); + return Funs.DB.HJGLData_Defect.FirstOrDefault(x => x.Id == Id); } public static List GetHJGLData_DefectByDate(DateTime? reportDate) { - var q = from x in db.HJGLData_Defect + var q = from x in Funs.DB.HJGLData_Defect where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 select x; return q.ToList(); diff --git a/SGGL/BLL/ZHGL/DataSync/HSSEData_HiddenDangerDetailService.cs b/SGGL/BLL/ZHGL/DataSync/HSSEData_HiddenDangerDetailService.cs index 9677c589..6fbe9796 100644 --- a/SGGL/BLL/ZHGL/DataSync/HSSEData_HiddenDangerDetailService.cs +++ b/SGGL/BLL/ZHGL/DataSync/HSSEData_HiddenDangerDetailService.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; +using Model; namespace BLL @@ -11,9 +12,6 @@ namespace BLL public static class HSSEData_HiddenDangerDetailService { - public static Model.SGGLDB db = Funs.DB; - - #region 获取列表 /// /// 记录数 @@ -25,7 +23,7 @@ namespace BLL } public static List GetHSSEData_HiddenDangerDetailByModle(Model.HSSEData_HiddenDangerDetail table) { - var q = from x in db.HSSEData_HiddenDangerDetail + var q = from x in Funs.DB.HSSEData_HiddenDangerDetail where (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) && @@ -70,12 +68,12 @@ namespace BLL public static Model.HSSEData_HiddenDangerDetail GetHSSEData_HiddenDangerDetailById(string Id) { - return db.HSSEData_HiddenDangerDetail.FirstOrDefault(x => x.Id == Id); + return Funs.DB.HSSEData_HiddenDangerDetail.FirstOrDefault(x => x.Id == Id); } public static List GetHSSEData_HiddenDangerDetailByDate(DateTime? reportDate) { - var q = from x in db.HSSEData_HiddenDangerDetail + var q = from x in Funs.DB.HSSEData_HiddenDangerDetail where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 select x; return q.ToList(); diff --git a/SGGL/BLL/ZHGL/DataSync/Hazard_RealTimeDeviceService.cs b/SGGL/BLL/ZHGL/DataSync/Hazard_RealTimeDeviceService.cs index 50a51306..d397e718 100644 --- a/SGGL/BLL/ZHGL/DataSync/Hazard_RealTimeDeviceService.cs +++ b/SGGL/BLL/ZHGL/DataSync/Hazard_RealTimeDeviceService.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; +using Model; namespace BLL @@ -11,9 +12,6 @@ namespace BLL public static class HazardRealtimedeviceService { - public static Model.SGGLDB db = Funs.DB; - - #region 获取列表 /// /// 记录数 @@ -25,7 +23,7 @@ namespace BLL } public static List GetHazard_RealTimeDeviceByModle(Model.Hazard_RealTimeDevice table) { - var q = from x in db.Hazard_RealTimeDevice + var q = from x in Funs.DB.Hazard_RealTimeDevice where (string.IsNullOrEmpty(table.ID) || x.ID.Contains(table.ID)) && (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) && @@ -130,7 +128,7 @@ namespace BLL public static Model.Hazard_RealTimeDevice GetHazard_RealTimeDeviceById(string ID) { - return db.Hazard_RealTimeDevice.FirstOrDefault(x => x.ID == ID); + return Funs.DB.Hazard_RealTimeDevice.FirstOrDefault(x => x.ID == ID); } @@ -268,7 +266,7 @@ namespace BLL } public static List GetHazard_RealTimeDeviceByDate(DateTime? reportDate) { - var q = from x in db.Hazard_RealTimeDevice + var q = from x in Funs.DB.Hazard_RealTimeDevice where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 select x; return q.ToList(); diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_CQMSDataService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_CQMSDataService.cs index 30c6f34d..a434a107 100644 --- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_CQMSDataService.cs +++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_CQMSDataService.cs @@ -13,7 +13,6 @@ namespace BLL public static class Project_CQMSDataService { - public static Model.SGGLDB db = Funs.DB; /// /// CQMS数据类型 /// @@ -64,7 +63,7 @@ namespace BLL } public static List GetProject_CQMSData_CQMSByModle(Model.Project_CQMSData_CQMS table) { - var q = from x in db.Project_CQMSData_CQMS + var q = from x in Funs.DB.Project_CQMSData_CQMS where (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && (string.IsNullOrEmpty(table.ProjectId) || x.Id.Contains(table.ProjectId)) && @@ -141,11 +140,11 @@ namespace BLL /// public static Model.Project_CQMSData_CQMS GetProject_CQMSData_CQMSById(string Id) { - return db.Project_CQMSData_CQMS.FirstOrDefault(x => x.Id == Id); + return Funs.DB.Project_CQMSData_CQMS.FirstOrDefault(x => x.Id == Id); } public static List GetProject_CQMSData_CQMSByprojectid(string projectid) { - var q = (from x in db.Project_CQMSData_CQMS + var q = (from x in Funs.DB.Project_CQMSData_CQMS where x.ProjectId == projectid select x).ToList(); return q; @@ -756,7 +755,7 @@ namespace BLL /// public static ReturnData PushProjectCQMSData() { - var items = (from x in db.Project_CQMSData_CQMS + var items = (from x in Funs.DB.Project_CQMSData_CQMS where x.ReportDate == DateTime.Now.Date select x).ToList(); Model.ReturnData responeData = new Model.ReturnData(); diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLService.cs index ee830ff3..de032880 100644 --- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLService.cs +++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLService.cs @@ -14,7 +14,6 @@ namespace BLL public static class Project_HJGLData_HJGLService { - public static Model.SGGLDB db = Funs.DB; /// /// HJGL数据类型 /// @@ -54,7 +53,7 @@ namespace BLL } public static List GetProject_HJGLData_HJGLByModle(Model.Project_HJGLData_HJGL table) { - var q = from x in db.Project_HJGLData_HJGL + var q = from x in Funs.DB.Project_HJGLData_HJGL where (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && (string.IsNullOrEmpty(table.ProjectId) || x.Id.Contains(table.ProjectId)) && @@ -102,12 +101,12 @@ namespace BLL public static Model.Project_HJGLData_HJGL GetProject_HJGLData_HJGLById(string Id) { - return db.Project_HJGLData_HJGL.FirstOrDefault(x => x.Id == Id); + return Funs.DB.Project_HJGLData_HJGL.FirstOrDefault(x => x.Id == Id); } public static List GetProject_HJGLData_HJGLByProjectid(string Projectid) { - var q = (from x in db.Project_HJGLData_HJGL + var q = (from x in Funs.DB.Project_HJGLData_HJGL where x.ProjectId == Projectid select x).ToList(); return q; @@ -355,10 +354,11 @@ namespace BLL /// public static ReturnData PushProjectHJGLData() { - var items = (from x in db.Project_HJGLData_HJGL + var db1 = Funs.DB; + var items = (from x in db1.Project_HJGLData_HJGL where x.ReportDate == DateTime.Now.Date select x).ToList(); - var defectItems = (from x in db.Project_HJGLData_Defect + var defectItems = (from x in db1.Project_HJGLData_Defect where x.ReportDate == DateTime.Now.Date select x).ToList(); Model.ReturnData responeData = new Model.ReturnData(); diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HiddenDangerDetailService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HiddenDangerDetailService.cs index bea0cf00..f75c7496 100644 --- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HiddenDangerDetailService.cs +++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_HSSEData_HiddenDangerDetailService.cs @@ -13,9 +13,6 @@ namespace BLL public static class Project_HSSEData_HiddenDangerDetailService { - public static Model.SGGLDB db = Funs.DB; - - #region 获取列表 /// /// 记录数 @@ -27,7 +24,7 @@ namespace BLL } public static List GetProject_HSSEData_HiddenDangerDetailByModle(Model.Project_HSSEData_HiddenDangerDetail table) { - var q = from x in db.Project_HSSEData_HiddenDangerDetail + var q = from x in Funs.DB.Project_HSSEData_HiddenDangerDetail where (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && (string.IsNullOrEmpty(table.ProjectId) || x.Id.Contains(table.ProjectId)) && @@ -74,7 +71,7 @@ namespace BLL public static Model.Project_HSSEData_HiddenDangerDetail GetModelById(string Id) { - return db.Project_HSSEData_HiddenDangerDetail.FirstOrDefault(x => x.Id == Id); + return Funs.DB.Project_HSSEData_HiddenDangerDetail.FirstOrDefault(x => x.Id == Id); } /// /// 获取项目该日期的隐患类别数据 diff --git a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_SYHSEData_SYHSEService.cs b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_SYHSEData_SYHSEService.cs index a6cef0c4..83402270 100644 --- a/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_SYHSEData_SYHSEService.cs +++ b/SGGL/BLL/ZHGL/DataSync/ProjectDataSync/Project_SYHSEData_SYHSEService.cs @@ -13,7 +13,6 @@ namespace BLL public static class Project_SYHSEData_SYHSEService { - public static Model.SGGLDB db = Funs.DB; /// /// 实业数据类型 /// @@ -61,7 +60,7 @@ namespace BLL } public static List GetProject_SYHSEData_SYHSEByModle(Model.Project_SYHSEData_SYHSE table) { - var q = from x in db.Project_SYHSEData_SYHSE + var q = from x in Funs.DB.Project_SYHSEData_SYHSE where (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && (string.IsNullOrEmpty(table.ProjectId) || x.Id.Contains(table.ProjectId)) && @@ -138,7 +137,7 @@ namespace BLL public static Model.Project_SYHSEData_SYHSE GetProject_SYHSEData_SYHSEById(string Id) { - return db.Project_SYHSEData_SYHSE.FirstOrDefault(x => x.Id == Id); + return Funs.DB.Project_SYHSEData_SYHSE.FirstOrDefault(x => x.Id == Id); } public static void AddProject_SYHSEData_SYHSE(Model.Project_SYHSEData_SYHSE newtable) { diff --git a/SGGL/BLL/ZHGL/DataSync/SYHSEData_DataService.cs b/SGGL/BLL/ZHGL/DataSync/SYHSEData_DataService.cs index ad280ff4..e90facda 100644 --- a/SGGL/BLL/ZHGL/DataSync/SYHSEData_DataService.cs +++ b/SGGL/BLL/ZHGL/DataSync/SYHSEData_DataService.cs @@ -13,9 +13,6 @@ namespace BLL public static class SYHSEData_DataService { - public static Model.SGGLDB db = Funs.DB; - - #region 获取列表 /// /// 记录数 @@ -27,7 +24,7 @@ namespace BLL } public static List GetSYHSEData_DataByModle(Model.SYHSEData_Data table) { - var q = from x in db.SYHSEData_Data + var q = from x in Funs.DB.SYHSEData_Data where (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && (string.IsNullOrEmpty(table.FactoryId) || x.FactoryId.Contains(table.FactoryId)) @@ -174,7 +171,7 @@ namespace BLL public static Model.SYHSEData_Data GetSYHSEData_DataById(string Id) { - return db.SYHSEData_Data.FirstOrDefault(x => x.Id == Id); + return Funs.DB.SYHSEData_Data.FirstOrDefault(x => x.Id == Id); } @@ -192,22 +189,23 @@ namespace BLL GreatRiskNum = newtable.GreatRiskNum, ReportDate = newtable.ReportDate, }; - db.SYHSEData_Data.InsertOnSubmit(table); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.SYHSEData_Data.InsertOnSubmit(table); + db1.SubmitChanges(); } public static void AddBulkSYHSEData_Data(List newtables) { - - db.SYHSEData_Data.InsertAllOnSubmit(newtables); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.SYHSEData_Data.InsertAllOnSubmit(newtables); + db1.SubmitChanges(); } public static void UpdateSYHSEData_Data(Model.SYHSEData_Data newtable) { - - Model.SYHSEData_Data table = db.SYHSEData_Data.FirstOrDefault(x => x.Id == newtable.Id); + var db1 = Funs.DB; + Model.SYHSEData_Data table = db1.SYHSEData_Data.FirstOrDefault(x => x.Id == newtable.Id); if (table != null) { table.Id = newtable.Id; @@ -218,28 +216,29 @@ namespace BLL table.MoreRiskNum = newtable.MoreRiskNum; table.GreatRiskNum = newtable.GreatRiskNum; table.ReportDate = newtable.ReportDate; - db.SubmitChanges(); + db1.SubmitChanges(); } } public static void DeleteSYHSEData_DataById(string Id) { - - Model.SYHSEData_Data table = db.SYHSEData_Data.FirstOrDefault(x => x.Id == Id); + var db1 = Funs.DB; + Model.SYHSEData_Data table = db1.SYHSEData_Data.FirstOrDefault(x => x.Id == Id); if (table != null) { - db.SYHSEData_Data.DeleteOnSubmit(table); - db.SubmitChanges(); + db1.SYHSEData_Data.DeleteOnSubmit(table); + db1.SubmitChanges(); } } public static void DeleteALLSYHSEData_Data() { - if (db.SYHSEData_Data != null) + var db1 = Funs.DB; + if (db1.SYHSEData_Data != null) { - db.SYHSEData_Data.DeleteAllOnSubmit(db.SYHSEData_Data); - db.SubmitChanges(); + db1.SYHSEData_Data.DeleteAllOnSubmit(db1.SYHSEData_Data); + db1.SubmitChanges(); } } diff --git a/SGGL/BLL/ZHGL/DataSync/SYHSEData_HiddenDangerCheckService.cs b/SGGL/BLL/ZHGL/DataSync/SYHSEData_HiddenDangerCheckService.cs index 1c17e777..c25d8c2d 100644 --- a/SGGL/BLL/ZHGL/DataSync/SYHSEData_HiddenDangerCheckService.cs +++ b/SGGL/BLL/ZHGL/DataSync/SYHSEData_HiddenDangerCheckService.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; +using Model; namespace BLL @@ -11,9 +12,6 @@ namespace BLL public static class SyhsedataHiddendangercheckService { - public static Model.SGGLDB db = Funs.DB; - - #region 获取列表 /// /// 记录数 @@ -25,7 +23,7 @@ namespace BLL } public static List GetSYHSEData_HiddenDangerCheckByModle(Model.SYHSEData_HiddenDangerCheck table) { - var q = from x in db.SYHSEData_HiddenDangerCheck + var q = from x in Funs.DB.SYHSEData_HiddenDangerCheck where (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && (string.IsNullOrEmpty(table.FactoryId) || x.FactoryId.Contains(table.FactoryId)) && @@ -67,7 +65,7 @@ namespace BLL public static Model.SYHSEData_HiddenDangerCheck GetSYHSEData_HiddenDangerCheckById(string Id) { - return db.SYHSEData_HiddenDangerCheck.FirstOrDefault(x => x.Id == Id); + return Funs.DB.SYHSEData_HiddenDangerCheck.FirstOrDefault(x => x.Id == Id); } @@ -83,22 +81,23 @@ namespace BLL OKNum = newtable.OKNum, ReportDate = newtable.ReportDate, }; - db.SYHSEData_HiddenDangerCheck.InsertOnSubmit(table); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.SYHSEData_HiddenDangerCheck.InsertOnSubmit(table); + db1.SubmitChanges(); } public static void AddBulkSYHSEData_HiddenDangerCheck(List newtables) { - - db.SYHSEData_HiddenDangerCheck.InsertAllOnSubmit(newtables); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.SYHSEData_HiddenDangerCheck.InsertAllOnSubmit(newtables); + db1.SubmitChanges(); } public static void UpdateSYHSEData_HiddenDangerCheck(Model.SYHSEData_HiddenDangerCheck newtable) { - - Model.SYHSEData_HiddenDangerCheck table = db.SYHSEData_HiddenDangerCheck.FirstOrDefault(x => x.Id == newtable.Id); + var db1 = Funs.DB; + Model.SYHSEData_HiddenDangerCheck table = db1.SYHSEData_HiddenDangerCheck.FirstOrDefault(x => x.Id == newtable.Id); if (table != null) { table.Id = newtable.Id; @@ -107,45 +106,46 @@ namespace BLL table.TotalNum = newtable.TotalNum; table.OKNum = newtable.OKNum; table.ReportDate = newtable.ReportDate; - db.SubmitChanges(); + db1.SubmitChanges(); } } public static void DeleteSYHSEData_HiddenDangerCheckById(string Id) { - - Model.SYHSEData_HiddenDangerCheck table = db.SYHSEData_HiddenDangerCheck.FirstOrDefault(x => x.Id == Id); + var db1 = Funs.DB; + Model.SYHSEData_HiddenDangerCheck table = db1.SYHSEData_HiddenDangerCheck.FirstOrDefault(x => x.Id == Id); if (table != null) { - db.SYHSEData_HiddenDangerCheck.DeleteOnSubmit(table); - db.SubmitChanges(); + db1.SYHSEData_HiddenDangerCheck.DeleteOnSubmit(table); + db1.SubmitChanges(); } } public static void DeleteALLSYHSEData_HiddenDangerCheck() { - if (db.SYHSEData_HiddenDangerCheck != null) + var db1 = Funs.DB; + if (db1.SYHSEData_HiddenDangerCheck != null) { - db.SYHSEData_HiddenDangerCheck.DeleteAllOnSubmit(db.SYHSEData_HiddenDangerCheck); - db.SubmitChanges(); + db1.SYHSEData_HiddenDangerCheck.DeleteAllOnSubmit(db1.SYHSEData_HiddenDangerCheck); + db1.SubmitChanges(); } } public static List GetSYHSEData_HiddenDangerCheckByDate(DateTime? reportDate) { - var q = from x in db.SYHSEData_HiddenDangerCheck + var q = from x in Funs.DB.SYHSEData_HiddenDangerCheck where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 select x; return q.ToList(); } public static void DeleteSYHSEData_HiddenDangerCheckByDate(DateTime? reportDate) { - - var table = db.SYHSEData_HiddenDangerCheck.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0); + var db1 = Funs.DB; + var table = db1.SYHSEData_HiddenDangerCheck.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0); if (table != null) { - db.SYHSEData_HiddenDangerCheck.DeleteAllOnSubmit(table); - db.SubmitChanges(); + db1.SYHSEData_HiddenDangerCheck.DeleteAllOnSubmit(table); + db1.SubmitChanges(); } } diff --git a/SGGL/BLL/ZHGL/DataSync/SYHSEData_RiskControlService.cs b/SGGL/BLL/ZHGL/DataSync/SYHSEData_RiskControlService.cs index cf013d66..d13aab2c 100644 --- a/SGGL/BLL/ZHGL/DataSync/SYHSEData_RiskControlService.cs +++ b/SGGL/BLL/ZHGL/DataSync/SYHSEData_RiskControlService.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; +using Model; namespace BLL @@ -11,9 +12,6 @@ namespace BLL public static class SyhsedataRiskcontrolService { - public static Model.SGGLDB db = Funs.DB; - - #region 获取列表 /// /// 记录数 @@ -25,7 +23,7 @@ namespace BLL } public static List GetSYHSEData_RiskControlByModle(Model.SYHSEData_RiskControl table) { - var q = from x in db.SYHSEData_RiskControl + var q = from x in Funs.DB.SYHSEData_RiskControl where (string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) && (string.IsNullOrEmpty(table.FactoryId) || x.FactoryId.Contains(table.FactoryId)) && @@ -65,7 +63,7 @@ namespace BLL public static Model.SYHSEData_RiskControl GetSYHSEData_RiskControlById(string Id) { - return db.SYHSEData_RiskControl.FirstOrDefault(x => x.Id == Id); + return Funs.DB.SYHSEData_RiskControl.FirstOrDefault(x => x.Id == Id); } @@ -79,67 +77,69 @@ namespace BLL RiskControlName = newtable.RiskControlName, ReportDate = newtable.ReportDate, }; - db.SYHSEData_RiskControl.InsertOnSubmit(table); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.SYHSEData_RiskControl.InsertOnSubmit(table); + db1.SubmitChanges(); } public static void AddBulkSYHSEData_RiskControl(List newtables) { - - db.SYHSEData_RiskControl.InsertAllOnSubmit(newtables); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.SYHSEData_RiskControl.InsertAllOnSubmit(newtables); + db1.SubmitChanges(); } public static void UpdateSYHSEData_RiskControl(Model.SYHSEData_RiskControl newtable) { - - Model.SYHSEData_RiskControl table = db.SYHSEData_RiskControl.FirstOrDefault(x => x.Id == newtable.Id); + var db1 = Funs.DB; + Model.SYHSEData_RiskControl table = db1.SYHSEData_RiskControl.FirstOrDefault(x => x.Id == newtable.Id); if (table != null) { table.Id = newtable.Id; table.FactoryId = newtable.FactoryId; table.RiskControlName = newtable.RiskControlName; table.ReportDate = newtable.ReportDate; - db.SubmitChanges(); + db1.SubmitChanges(); } } public static void DeleteSYHSEData_RiskControlById(string Id) { - - Model.SYHSEData_RiskControl table = db.SYHSEData_RiskControl.FirstOrDefault(x => x.Id == Id); + var db1 = Funs.DB; + Model.SYHSEData_RiskControl table = db1.SYHSEData_RiskControl.FirstOrDefault(x => x.Id == Id); if (table != null) { - db.SYHSEData_RiskControl.DeleteOnSubmit(table); - db.SubmitChanges(); + db1.SYHSEData_RiskControl.DeleteOnSubmit(table); + db1.SubmitChanges(); } } public static void DeleteALLSYHSEData_RiskControl() { - if (db.SYHSEData_RiskControl != null) + var db1 = Funs.DB; + if (db1.SYHSEData_RiskControl != null) { - db.SYHSEData_RiskControl.DeleteAllOnSubmit(db.SYHSEData_RiskControl); - db.SubmitChanges(); + db1.SYHSEData_RiskControl.DeleteAllOnSubmit(db1.SYHSEData_RiskControl); + db1.SubmitChanges(); } } public static List GetSYHSEData_RiskControlByDate(DateTime? reportDate) { - var q = from x in db.SYHSEData_RiskControl + var q = from x in Funs.DB.SYHSEData_RiskControl where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0 select x; return q.ToList(); } public static void DeleteSYHSEData_RiskControlByDate(DateTime? reportDate) { - - var table = db.SYHSEData_RiskControl.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0); + var db1 = Funs.DB; + var table = db1.SYHSEData_RiskControl.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0); if (table != null) { - db.SYHSEData_RiskControl.DeleteAllOnSubmit(table); - db.SubmitChanges(); + db1.SYHSEData_RiskControl.DeleteAllOnSubmit(table); + db1.SubmitChanges(); } } diff --git a/SGGL/BLL/ZHGL/DataSync/SYHSEData_SYHSEService.cs b/SGGL/BLL/ZHGL/DataSync/SYHSEData_SYHSEService.cs index 31f91a76..19b0cc25 100644 --- a/SGGL/BLL/ZHGL/DataSync/SYHSEData_SYHSEService.cs +++ b/SGGL/BLL/ZHGL/DataSync/SYHSEData_SYHSEService.cs @@ -10,7 +10,7 @@ namespace BLL { public static class SYHSEData_SYHSEService { - public static Model.SGGLDB db = Funs.DB; + #region 获取列表 diff --git a/SGGL/BLL/ZHGL/Emergency/UnitDrillRecordListService.cs b/SGGL/BLL/ZHGL/Emergency/UnitDrillRecordListService.cs index 47545cb0..98387ba3 100644 --- a/SGGL/BLL/ZHGL/Emergency/UnitDrillRecordListService.cs +++ b/SGGL/BLL/ZHGL/Emergency/UnitDrillRecordListService.cs @@ -10,7 +10,7 @@ namespace BLL /// public static class UnitDrillRecordListService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取应急演练 diff --git a/SGGL/BLL/ZHGL/Emergency/UnitEmergencyListService.cs b/SGGL/BLL/ZHGL/Emergency/UnitEmergencyListService.cs index 955669a7..a18fe6a7 100644 --- a/SGGL/BLL/ZHGL/Emergency/UnitEmergencyListService.cs +++ b/SGGL/BLL/ZHGL/Emergency/UnitEmergencyListService.cs @@ -10,7 +10,7 @@ namespace BLL /// public static class UnitEmergencyListService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取应急预案管理 diff --git a/SGGL/BLL/ZHGL/Environmental/EnergyReportService.cs b/SGGL/BLL/ZHGL/Environmental/EnergyReportService.cs index 24554f61..84ed5c08 100644 --- a/SGGL/BLL/ZHGL/Environmental/EnergyReportService.cs +++ b/SGGL/BLL/ZHGL/Environmental/EnergyReportService.cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; +using Model; namespace BLL @@ -11,9 +12,6 @@ namespace BLL public static class EnergyReportService { - public static Model.SGGLDB db = Funs.DB; - - #region 获取列表 /// /// 记录数 @@ -25,7 +23,7 @@ namespace BLL } public static List GetEnvironmental_EnergyReportByModle(Model.Environmental_EnergyReport table) { - var q = from x in db.Environmental_EnergyReport + var q = from x in Funs.DB.Environmental_EnergyReport where (string.IsNullOrEmpty(table.EnergyReportId) || x.EnergyReportId.Contains(table.EnergyReportId)) && (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) && @@ -71,7 +69,7 @@ namespace BLL public static Model.Environmental_EnergyReport GetEnvironmental_EnergyReportById(string EnergyReportId) { - return db.Environmental_EnergyReport.FirstOrDefault(x => x.EnergyReportId == EnergyReportId); + return Funs.DB.Environmental_EnergyReport.FirstOrDefault(x => x.EnergyReportId == EnergyReportId); } public static Model.Environmental_EnergyReport GetEnvironmental_EnergyReportByUnitIdAndYearAndQuarters(string unitId, int year, int Quarters) @@ -92,15 +90,16 @@ namespace BLL DutyPerson = newtable.DutyPerson, UpState = newtable.UpState, }; - db.Environmental_EnergyReport.InsertOnSubmit(table); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Environmental_EnergyReport.InsertOnSubmit(table); + db1.SubmitChanges(); } public static void AddBulkEnvironmental_EnergyReport(List newtables) { - - db.Environmental_EnergyReport.InsertAllOnSubmit(newtables); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Environmental_EnergyReport.InsertAllOnSubmit(newtables); + db1.SubmitChanges(); } /// @@ -124,8 +123,8 @@ namespace BLL } public static void UpdateEnvironmental_EnergyReport(Model.Environmental_EnergyReport newtable) { - - Model.Environmental_EnergyReport table = db.Environmental_EnergyReport.FirstOrDefault(x => x.EnergyReportId == newtable.EnergyReportId); + var db1 = Funs.DB; + Model.Environmental_EnergyReport table = db1.Environmental_EnergyReport.FirstOrDefault(x => x.EnergyReportId == newtable.EnergyReportId); if (table != null) { table.EnergyReportId = newtable.EnergyReportId; @@ -136,7 +135,7 @@ namespace BLL table.FillingDate = newtable.FillingDate; table.DutyPerson = newtable.DutyPerson; table.UpState = newtable.UpState; - db.SubmitChanges(); + db1.SubmitChanges(); } } @@ -154,10 +153,11 @@ namespace BLL public static void DeleteALLEnvironmental_EnergyReport() { - if (db.Environmental_EnergyReport != null) + var db1 = Funs.DB; + if (db1.Environmental_EnergyReport != null) { - db.Environmental_EnergyReport.DeleteAllOnSubmit(db.Environmental_EnergyReport); - db.SubmitChanges(); + db1.Environmental_EnergyReport.DeleteAllOnSubmit(db1.Environmental_EnergyReport); + db1.SubmitChanges(); } } diff --git a/SGGL/BLL/ZHGL/Environmental/EnergyreportItemService .cs b/SGGL/BLL/ZHGL/Environmental/EnergyreportItemService .cs index faf399be..3db7ab0d 100644 --- a/SGGL/BLL/ZHGL/Environmental/EnergyreportItemService .cs +++ b/SGGL/BLL/ZHGL/Environmental/EnergyreportItemService .cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; +using Model; namespace BLL @@ -11,9 +12,6 @@ namespace BLL public static class EnergyreportItemService { - public static Model.SGGLDB db = Funs.DB; - - #region 获取列表 /// /// 记录数 @@ -25,7 +23,7 @@ namespace BLL } public static List GetEnvironmental_EnergyReportItemByModle(Model.Environmental_EnergyReportItem table) { - var q = from x in db.Environmental_EnergyReportItem + var q = from x in Funs.DB.Environmental_EnergyReportItem where (string.IsNullOrEmpty(table.EnergyReportItemId) || x.EnergyReportItemId.Contains(table.EnergyReportItemId)) && (string.IsNullOrEmpty(table.EnergyReportId) || x.EnergyReportId.Contains(table.EnergyReportId)) && @@ -87,7 +85,7 @@ namespace BLL public static Model.Environmental_EnergyReportItem GetEnvironmental_EnergyReportItemById(string EnergyReportItemId) { - return db.Environmental_EnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == EnergyReportItemId); + return Funs.DB.Environmental_EnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == EnergyReportItemId); } /// @@ -203,22 +201,23 @@ namespace BLL ServiceOperatingIncome_LastYear = newtable.ServiceOperatingIncome_LastYear, ServiceOperatingIncome_ThisYear = newtable.ServiceOperatingIncome_ThisYear, }; - db.Environmental_EnergyReportItem.InsertOnSubmit(table); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Environmental_EnergyReportItem.InsertOnSubmit(table); + db1.SubmitChanges(); } public static void AddBulkEnvironmental_EnergyReportItem(List newtables) { - - db.Environmental_EnergyReportItem.InsertAllOnSubmit(newtables); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Environmental_EnergyReportItem.InsertAllOnSubmit(newtables); + db1.SubmitChanges(); } public static void UpdateEnvironmental_EnergyReportItem(Model.Environmental_EnergyReportItem newtable) { - - Model.Environmental_EnergyReportItem table = db.Environmental_EnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == newtable.EnergyReportItemId); + var db1 = Funs.DB; + Model.Environmental_EnergyReportItem table = db1.Environmental_EnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == newtable.EnergyReportItemId); if (table != null) { table.EnergyReportItemId = newtable.EnergyReportItemId; @@ -243,28 +242,29 @@ namespace BLL table.ServiceOperatingIncome_BasePeriod = newtable.ServiceOperatingIncome_BasePeriod; table.ServiceOperatingIncome_LastYear = newtable.ServiceOperatingIncome_LastYear; table.ServiceOperatingIncome_ThisYear = newtable.ServiceOperatingIncome_ThisYear; - db.SubmitChanges(); + db1.SubmitChanges(); } } public static void DeleteEnvironmental_EnergyReportItemById(string EnergyReportItemId) { - - Model.Environmental_EnergyReportItem table = db.Environmental_EnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == EnergyReportItemId); + var db1 = Funs.DB; + Model.Environmental_EnergyReportItem table = db1.Environmental_EnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == EnergyReportItemId); if (table != null) { - db.Environmental_EnergyReportItem.DeleteOnSubmit(table); - db.SubmitChanges(); + db1.Environmental_EnergyReportItem.DeleteOnSubmit(table); + db1.SubmitChanges(); } } public static void DeleteALLEnvironmental_EnergyReportItem() { - if (db.Environmental_EnergyReportItem != null) + var db1 = Funs.DB; + if (db1.Environmental_EnergyReportItem != null) { - db.Environmental_EnergyReportItem.DeleteAllOnSubmit(db.Environmental_EnergyReportItem); - db.SubmitChanges(); + db1.Environmental_EnergyReportItem.DeleteAllOnSubmit(db1.Environmental_EnergyReportItem); + db1.SubmitChanges(); } } public static void DeleteEnergyReportItemByChemicalReportId(string EnergyReportId) diff --git a/SGGL/BLL/ZHGL/Environmental/ProjectEnergyReportService.cs b/SGGL/BLL/ZHGL/Environmental/ProjectEnergyReportService.cs index 2c423ba8..264507da 100644 --- a/SGGL/BLL/ZHGL/Environmental/ProjectEnergyReportService.cs +++ b/SGGL/BLL/ZHGL/Environmental/ProjectEnergyReportService.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Linq; using System.Security.Cryptography; using System.Text; +using Model; namespace BLL @@ -12,9 +13,6 @@ namespace BLL public static class ProjectEnergyReportService { - public static Model.SGGLDB db = Funs.DB; - - #region 获取列表 /// /// 记录数 @@ -26,7 +24,7 @@ namespace BLL } public static List GetEnvironmental_ProjectEnergyReportByModle(Model.Environmental_ProjectEnergyReport table) { - var q = from x in db.Environmental_ProjectEnergyReport + var q = from x in Funs.DB.Environmental_ProjectEnergyReport where (string.IsNullOrEmpty(table.EnergyReportId) || x.EnergyReportId.Contains(table.EnergyReportId)) && (string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) && @@ -73,7 +71,7 @@ namespace BLL public static Model.Environmental_ProjectEnergyReport GetEnvironmental_ProjectEnergyReportById(string EnergyReportId) { - return db.Environmental_ProjectEnergyReport.FirstOrDefault(x => x.EnergyReportId == EnergyReportId); + return Funs.DB.Environmental_ProjectEnergyReport.FirstOrDefault(x => x.EnergyReportId == EnergyReportId); } public static Model.Environmental_ProjectEnergyReport GetEnvironmental_ProjectEnergyReportByProjectIdAndYearAndQuarters(string ProjectId, int year, int Quarters) @@ -95,15 +93,16 @@ namespace BLL UpState = newtable.UpState, ProjectId=newtable.ProjectId, }; - db.Environmental_ProjectEnergyReport.InsertOnSubmit(table); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Environmental_ProjectEnergyReport.InsertOnSubmit(table); + db1.SubmitChanges(); } public static void AddBulkEnvironmental_ProjectEnergyReport(List newtables) { - - db.Environmental_ProjectEnergyReport.InsertAllOnSubmit(newtables); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Environmental_ProjectEnergyReport.InsertAllOnSubmit(newtables); + db1.SubmitChanges(); } /// @@ -131,8 +130,8 @@ namespace BLL } public static void UpdateEnvironmental_ProjectEnergyReport(Model.Environmental_ProjectEnergyReport newtable) { - - Model.Environmental_ProjectEnergyReport table = db.Environmental_ProjectEnergyReport.FirstOrDefault(x => x.EnergyReportId == newtable.EnergyReportId); + var db1 = Funs.DB; + Model.Environmental_ProjectEnergyReport table = db1.Environmental_ProjectEnergyReport.FirstOrDefault(x => x.EnergyReportId == newtable.EnergyReportId); if (table != null) { table.EnergyReportId = newtable.EnergyReportId; @@ -144,28 +143,29 @@ namespace BLL table.DutyPerson = newtable.DutyPerson; table.UpState = newtable.UpState; table.ProjectId=newtable.ProjectId; - db.SubmitChanges(); + db1.SubmitChanges(); } } public static void DeleteEnvironmental_ProjectEnergyReportById(string EnergyReportId) { - - Model.Environmental_ProjectEnergyReport table = db.Environmental_ProjectEnergyReport.FirstOrDefault(x => x.EnergyReportId == EnergyReportId); + var db1 = Funs.DB; + Model.Environmental_ProjectEnergyReport table = db1.Environmental_ProjectEnergyReport.FirstOrDefault(x => x.EnergyReportId == EnergyReportId); if (table != null) { - db.Environmental_ProjectEnergyReport.DeleteOnSubmit(table); - db.SubmitChanges(); + db1.Environmental_ProjectEnergyReport.DeleteOnSubmit(table); + db1.SubmitChanges(); } } public static void DeleteALLEnvironmental_ProjectEnergyReport() { - if (db.Environmental_ProjectEnergyReport != null) + var db1 = Funs.DB; + if (db1.Environmental_ProjectEnergyReport != null) { - db.Environmental_ProjectEnergyReport.DeleteAllOnSubmit(db.Environmental_ProjectEnergyReport); - db.SubmitChanges(); + db1.Environmental_ProjectEnergyReport.DeleteAllOnSubmit(db1.Environmental_ProjectEnergyReport); + db1.SubmitChanges(); } } diff --git a/SGGL/BLL/ZHGL/Environmental/ProjectEnergyreportItemService .cs b/SGGL/BLL/ZHGL/Environmental/ProjectEnergyreportItemService .cs index 4fa85ed2..67676f15 100644 --- a/SGGL/BLL/ZHGL/Environmental/ProjectEnergyreportItemService .cs +++ b/SGGL/BLL/ZHGL/Environmental/ProjectEnergyreportItemService .cs @@ -4,6 +4,7 @@ using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; +using Model; namespace BLL @@ -11,9 +12,6 @@ namespace BLL public static class ProjectEnergyreportItemService { - public static Model.SGGLDB db = Funs.DB; - - #region 获取列表 /// /// 记录数 @@ -25,7 +23,7 @@ namespace BLL } public static List GetEnvironmental_ProjectEnergyReportItemByModle(Model.Environmental_ProjectEnergyReportItem table) { - var q = from x in db.Environmental_ProjectEnergyReportItem + var q = from x in Funs.DB.Environmental_ProjectEnergyReportItem where (string.IsNullOrEmpty(table.EnergyReportItemId) || x.EnergyReportItemId.Contains(table.EnergyReportItemId)) && (string.IsNullOrEmpty(table.EnergyReportId) || x.EnergyReportId.Contains(table.EnergyReportId)) && @@ -87,7 +85,7 @@ namespace BLL public static Model.Environmental_ProjectEnergyReportItem GetEnvironmental_ProjectEnergyReportItemById(string EnergyReportItemId) { - return db.Environmental_ProjectEnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == EnergyReportItemId); + return Funs.DB.Environmental_ProjectEnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == EnergyReportItemId); } /// @@ -209,22 +207,23 @@ namespace BLL ServiceOperatingIncome_LastYear = newtable.ServiceOperatingIncome_LastYear, ServiceOperatingIncome_ThisYear = newtable.ServiceOperatingIncome_ThisYear, }; - db.Environmental_ProjectEnergyReportItem.InsertOnSubmit(table); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Environmental_ProjectEnergyReportItem.InsertOnSubmit(table); + db1.SubmitChanges(); } public static void AddBulkEnvironmental_ProjectEnergyReportItem(List newtables) { - - db.Environmental_ProjectEnergyReportItem.InsertAllOnSubmit(newtables); - db.SubmitChanges(); + var db1 = Funs.DB; + db1.Environmental_ProjectEnergyReportItem.InsertAllOnSubmit(newtables); + db1.SubmitChanges(); } public static void UpdateEnvironmental_ProjectEnergyReportItem(Model.Environmental_ProjectEnergyReportItem newtable) { - - Model.Environmental_ProjectEnergyReportItem table = db.Environmental_ProjectEnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == newtable.EnergyReportItemId); + var db1 = Funs.DB; + Model.Environmental_ProjectEnergyReportItem table = db1.Environmental_ProjectEnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == newtable.EnergyReportItemId); if (table != null) { table.EnergyReportItemId = newtable.EnergyReportItemId; @@ -249,28 +248,29 @@ namespace BLL table.ServiceOperatingIncome_BasePeriod = newtable.ServiceOperatingIncome_BasePeriod; table.ServiceOperatingIncome_LastYear = newtable.ServiceOperatingIncome_LastYear; table.ServiceOperatingIncome_ThisYear = newtable.ServiceOperatingIncome_ThisYear; - db.SubmitChanges(); + db1.SubmitChanges(); } } public static void DeleteEnvironmental_ProjectEnergyReportItemById(string EnergyReportItemId) { - - Model.Environmental_ProjectEnergyReportItem table = db.Environmental_ProjectEnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == EnergyReportItemId); + var db1 = Funs.DB; + Model.Environmental_ProjectEnergyReportItem table = db1.Environmental_ProjectEnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == EnergyReportItemId); if (table != null) { - db.Environmental_ProjectEnergyReportItem.DeleteOnSubmit(table); - db.SubmitChanges(); + db1.Environmental_ProjectEnergyReportItem.DeleteOnSubmit(table); + db1.SubmitChanges(); } } public static void DeleteALLEnvironmental_ProjectEnergyReportItem() { - if (db.Environmental_ProjectEnergyReportItem != null) + var db1 = Funs.DB; + if (db1.Environmental_ProjectEnergyReportItem != null) { - db.Environmental_ProjectEnergyReportItem.DeleteAllOnSubmit(db.Environmental_ProjectEnergyReportItem); - db.SubmitChanges(); + db1.Environmental_ProjectEnergyReportItem.DeleteAllOnSubmit(db1.Environmental_ProjectEnergyReportItem); + db1.SubmitChanges(); } } public static void DeleteEnergyReportItemByChemicalReportId(string EnergyReportId) diff --git a/SGGL/BLL/ZHGL/Meeting/CompanySafetyMeetingService.cs b/SGGL/BLL/ZHGL/Meeting/CompanySafetyMeetingService.cs index 002877c0..503e46d4 100644 --- a/SGGL/BLL/ZHGL/Meeting/CompanySafetyMeetingService.cs +++ b/SGGL/BLL/ZHGL/Meeting/CompanySafetyMeetingService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class CompanySafetyMeetingService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取企业安委会 diff --git a/SGGL/BLL/ZHGL/Meeting/CompanySpecialMeetingService.cs b/SGGL/BLL/ZHGL/Meeting/CompanySpecialMeetingService.cs index 1e8886ee..00d4515e 100644 --- a/SGGL/BLL/ZHGL/Meeting/CompanySpecialMeetingService.cs +++ b/SGGL/BLL/ZHGL/Meeting/CompanySpecialMeetingService.cs @@ -9,7 +9,7 @@ namespace BLL /// public static class CompanySpecialMeetingService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取企业专题会 diff --git a/SGGL/BLL/ZHGL/RealName/BasicDataService.cs b/SGGL/BLL/ZHGL/RealName/BasicDataService.cs index 49e39bdf..db320a11 100644 --- a/SGGL/BLL/ZHGL/RealName/BasicDataService.cs +++ b/SGGL/BLL/ZHGL/RealName/BasicDataService.cs @@ -6,7 +6,7 @@ namespace BLL { public static class BasicDataService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取字典信息 diff --git a/SGGL/BLL/ZHGL/RealName/CityService.cs b/SGGL/BLL/ZHGL/RealName/CityService.cs index 639d9a86..6fb87689 100644 --- a/SGGL/BLL/ZHGL/RealName/CityService.cs +++ b/SGGL/BLL/ZHGL/RealName/CityService.cs @@ -5,7 +5,7 @@ namespace BLL { public static class CityService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取国家信息 diff --git a/SGGL/BLL/ZHGL/RealName/CountryService.cs b/SGGL/BLL/ZHGL/RealName/CountryService.cs index c1f919ab..d0c7877d 100644 --- a/SGGL/BLL/ZHGL/RealName/CountryService.cs +++ b/SGGL/BLL/ZHGL/RealName/CountryService.cs @@ -5,7 +5,7 @@ namespace BLL { public static class CountryService { - public static Model.SGGLDB db = Funs.DB; + /// /// 根据主键获取国家信息 diff --git a/SGGL/BLL/ZHGL/RealName/OnPostService.cs b/SGGL/BLL/ZHGL/RealName/OnPostService.cs index 6f6be46a..0cd1cdfb 100644 --- a/SGGL/BLL/ZHGL/RealName/OnPostService.cs +++ b/SGGL/BLL/ZHGL/RealName/OnPostService.cs @@ -1,13 +1,12 @@ using FineUIPro; using System.Collections; using System.Linq; +using Model; namespace BLL { public static class OnPostService { - public static Model.SGGLDB db = Funs.DB; - #region 获取列表 /// /// 记录数 @@ -21,7 +20,7 @@ namespace BLL /// /// 定义变量 /// - private static IQueryable getDataLists = from x in db.SitePerson_Person + private static IQueryable getDataLists = from x in Funs.DB.SitePerson_Person where x.States == Const.State_1 select x; @@ -87,8 +86,9 @@ namespace BLL return null; } getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize); + var db1 = Funs.DB; return from x in getDataList - join y in db.Person_Persons on x.IdentityCard equals y.IdentityCard + join y in db1.Person_Persons on x.IdentityCard equals y.IdentityCard select new { x.PersonId, @@ -103,9 +103,9 @@ namespace BLL y.CountryCode, y.ProvinceCode, x.TeamGroupId, - db.ProjectData_TeamGroup.First(z => x.TeamGroupId == z.TeamGroupId).TeamGroupName, + db1.ProjectData_TeamGroup.First(z => x.TeamGroupId == z.TeamGroupId).TeamGroupName, x.WorkPostId, - db.Base_WorkPost.First(z => x.WorkPostId == z.WorkPostId).WorkPostName, + db1.Base_WorkPost.First(z => x.WorkPostId == z.WorkPostId).WorkPostName, IsPostName = x.OutTime.HasValue ? "是" : "否", y.Telephone, }; diff --git a/SGGL/BLL/ZHGL/RealName/RealName_ProjectService.cs b/SGGL/BLL/ZHGL/RealName/RealName_ProjectService.cs index 03af01f9..3808a1c0 100644 --- a/SGGL/BLL/ZHGL/RealName/RealName_ProjectService.cs +++ b/SGGL/BLL/ZHGL/RealName/RealName_ProjectService.cs @@ -5,7 +5,7 @@ namespace BLL { public static class RealName_ProjectService { - public static Model.SGGLDB db = Funs.DB; + /// /// diff --git a/SGGL/Model/Model.csproj b/SGGL/Model/Model.csproj index ac3b9b05..4e0b688a 100644 --- a/SGGL/Model/Model.csproj +++ b/SGGL/Model/Model.csproj @@ -29,8 +29,9 @@ bin\Debug\ DEBUG;TRACE prompt - 4 + 5 false + bin\Debug\Model.xml pdbonly diff --git a/SGGL/WebAPI/App_Start/SwaggerConfig.cs b/SGGL/WebAPI/App_Start/SwaggerConfig.cs index 90589fcb..67fd92af 100644 --- a/SGGL/WebAPI/App_Start/SwaggerConfig.cs +++ b/SGGL/WebAPI/App_Start/SwaggerConfig.cs @@ -3,6 +3,8 @@ using System.Web.Http; using WebActivatorEx; using WebAPI; using Swashbuckle.Application; +using System.Web.Http.Description; +using System; [assembly: PreApplicationStartMethod(typeof(SwaggerConfig), "Register")] @@ -16,241 +18,263 @@ namespace WebAPI GlobalConfiguration.Configuration .EnableSwagger(c => - { - // By default, the service root url is inferred from the request used to access the docs. - // However, there may be situations (e.g. proxy and load-balanced environments) where this does not - // resolve correctly. You can workaround this by providing your own code to determine the root URL. - // - //c.RootUrl(req => GetRootUrlFromAppConfig()); + { + // By default, the service root url is inferred from the request used to access the docs. + // However, there may be situations (e.g. proxy and load-balanced environments) where this does not + // resolve correctly. You can workaround this by providing your own code to determine the root URL. + // + //c.RootUrl(req => GetRootUrlFromAppConfig()); - // If schemes are not explicitly provided in a Swagger 2.0 document, then the scheme used to access - // the docs is taken as the default. If your API supports multiple schemes and you want to be explicit - // about them, you can use the "Schemes" option as shown below. - // - //c.Schemes(new[] { "http", "https" }); + // If schemes are not explicitly provided in a Swagger 2.0 document, then the scheme used to access + // the docs is taken as the default. If your API supports multiple schemes and you want to be explicit + // about them, you can use the "Schemes" option as shown below. + // + //c.Schemes(new[] { "http", "https" }); - // Use "SingleApiVersion" to describe a single version API. Swagger 2.0 includes an "Info" object to - // hold additional metadata for an API. Version and title are required but you can also provide - // additional fields by chaining methods off SingleApiVersion. - // - c.SingleApiVersion("v1", "WebAPI"); + // Use "SingleApiVersion" to describe a single version API. Swagger 2.0 includes an "Info" object to + // hold additional metadata for an API. Version and title are required but you can also provide + // additional fields by chaining methods off SingleApiVersion. + // + c.SingleApiVersion("v1", "WebAPI"); - // If you want the output Swagger docs to be indented properly, enable the "PrettyPrint" option. - // - //c.PrettyPrint(); - // If your API has multiple versions, use "MultipleApiVersions" instead of "SingleApiVersion". - // In this case, you must provide a lambda that tells Swashbuckle which actions should be - // included in the docs for a given API version. Like "SingleApiVersion", each call to "Version" - // returns an "Info" builder so you can provide additional metadata per API version. - // - //c.MultipleApiVersions( - // (apiDesc, targetApiVersion) => ResolveVersionSupportByRouteConstraint(apiDesc, targetApiVersion), - // (vc) => - // { - // vc.Version("v2", "Swashbuckle Dummy API V2"); - // vc.Version("v1", "Swashbuckle Dummy API V1"); - // }); + // If you want the output Swagger docs to be indented properly, enable the "PrettyPrint" option. + // + //c.PrettyPrint(); - // You can use "BasicAuth", "ApiKey" or "OAuth2" options to describe security schemes for the API. - // See https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md for more details. - // NOTE: These only define the schemes and need to be coupled with a corresponding "security" property - // at the document or operation level to indicate which schemes are required for an operation. To do this, - // you'll need to implement a custom IDocumentFilter and/or IOperationFilter to set these properties - // according to your specific authorization implementation - // - //c.BasicAuth("basic") - // .Description("Basic HTTP Authentication"); - // - // NOTE: You must also configure 'EnableApiKeySupport' below in the SwaggerUI section - //c.ApiKey("apiKey") - // .Description("API Key Authentication") - // .Name("apiKey") - // .In("header"); - // - //c.OAuth2("oauth2") - // .Description("OAuth2 Implicit Grant") - // .Flow("implicit") - // .AuthorizationUrl("http://petstore.swagger.wordnik.com/api/oauth/dialog") - // //.TokenUrl("https://tempuri.org/token") - // .Scopes(scopes => - // { - // scopes.Add("read", "Read access to protected resources"); - // scopes.Add("write", "Write access to protected resources"); - // }); + // If your API has multiple versions, use "MultipleApiVersions" instead of "SingleApiVersion". + // In this case, you must provide a lambda that tells Swashbuckle which actions should be + // included in the docs for a given API version. Like "SingleApiVersion", each call to "Version" + // returns an "Info" builder so you can provide additional metadata per API version. + // + //c.MultipleApiVersions( + // (apiDesc, targetApiVersion) => ResolveVersionSupportByRouteConstraint(apiDesc, targetApiVersion), + // (vc) => + // { + // vc.Version("Cqms", "ͬ"); + // vc.Version("Hsse", "ȫͬ"); + // vc.Version("ProjectDataSync", "ĿϢͬ"); + // vc.Version("v1", "Swashbuckle Dummy API V1"); + // }); - // Set this flag to omit descriptions for any actions decorated with the Obsolete attribute - //c.IgnoreObsoleteActions(); + // You can use "BasicAuth", "ApiKey" or "OAuth2" options to describe security schemes for the API. + // See https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md for more details. + // NOTE: These only define the schemes and need to be coupled with a corresponding "security" property + // at the document or operation level to indicate which schemes are required for an operation. To do this, + // you'll need to implement a custom IDocumentFilter and/or IOperationFilter to set these properties + // according to your specific authorization implementation + // + //c.BasicAuth("basic") + // .Description("Basic HTTP Authentication"); + // + // NOTE: You must also configure 'EnableApiKeySupport' below in the SwaggerUI section + c.ApiKey("token") + .Description("API Key Authentication") + .Name("token") + .In("header"); + // + //c.OAuth2("oauth2") + // .Description("OAuth2 Implicit Grant") + // .Flow("implicit") + // .AuthorizationUrl("http://petstore.swagger.wordnik.com/api/oauth/dialog") + // //.TokenUrl("https://tempuri.org/token") + // .Scopes(scopes => + // { + // scopes.Add("read", "Read access to protected resources"); + // scopes.Add("write", "Write access to protected resources"); + // }); - // Each operation be assigned one or more tags which are then used by consumers for various reasons. - // For example, the swagger-ui groups operations according to the first tag of each operation. - // By default, this will be controller name but you can use the "GroupActionsBy" option to - // override with any value. - // - //c.GroupActionsBy(apiDesc => apiDesc.HttpMethod.ToString()); + // Set this flag to omit descriptions for any actions decorated with the Obsolete attribute + //c.IgnoreObsoleteActions(); - // You can also specify a custom sort order for groups (as defined by "GroupActionsBy") to dictate - // the order in which operations are listed. For example, if the default grouping is in place - // (controller name) and you specify a descending alphabetic sort order, then actions from a - // ProductsController will be listed before those from a CustomersController. This is typically - // used to customize the order of groupings in the swagger-ui. - // - //c.OrderActionGroupsBy(new DescendingAlphabeticComparer()); + // Each operation be assigned one or more tags which are then used by consumers for various reasons. + // For example, the swagger-ui groups operations according to the first tag of each operation. + // By default, this will be controller name but you can use the "GroupActionsBy" option to + // override with any value. + // + //c.GroupActionsBy(apiDesc => apiDesc.HttpMethod.ToString()); - // If you annotate Controllers and API Types with - // Xml comments (http://msdn.microsoft.com/en-us/library/b2s063f7(v=vs.110).aspx), you can incorporate - // those comments into the generated docs and UI. You can enable this by providing the path to one or - // more Xml comment files. - // - //c.IncludeXmlComments(GetXmlCommentsPath()); + // You can also specify a custom sort order for groups (as defined by "GroupActionsBy") to dictate + // the order in which operations are listed. For example, if the default grouping is in place + // (controller name) and you specify a descending alphabetic sort order, then actions from a + // ProductsController will be listed before those from a CustomersController. This is typically + // used to customize the order of groupings in the swagger-ui. + // + //c.OrderActionGroupsBy(new DescendingAlphabeticComparer()); - // Swashbuckle makes a best attempt at generating Swagger compliant JSON schemas for the various types - // exposed in your API. However, there may be occasions when more control of the output is needed. - // This is supported through the "MapType" and "SchemaFilter" options: - // - // Use the "MapType" option to override the Schema generation for a specific type. - // It should be noted that the resulting Schema will be placed "inline" for any applicable Operations. - // While Swagger 2.0 supports inline definitions for "all" Schema types, the swagger-ui tool does not. - // It expects "complex" Schemas to be defined separately and referenced. For this reason, you should only - // use the "MapType" option when the resulting Schema is a primitive or array type. If you need to alter a - // complex Schema, use a Schema filter. - // - //c.MapType(() => new Schema { type = "integer", format = "int32" }); + // If you annotate Controllers and API Types with + // Xml comments (http://msdn.microsoft.com/en-us/library/b2s063f7(v=vs.110).aspx), you can incorporate + // those comments into the generated docs and UI. You can enable this by providing the path to one or + // more Xml comment files. + // - // If you want to post-modify "complex" Schemas once they've been generated, across the board or for a - // specific type, you can wire up one or more Schema filters. - // - //c.SchemaFilter(); + c.IncludeXmlComments(GetXmlCommentsPath("Model")); + c.IncludeXmlComments(GetXmlCommentsPath(thisAssembly.GetName().Name)); - // In a Swagger 2.0 document, complex types are typically declared globally and referenced by unique - // Schema Id. By default, Swashbuckle does NOT use the full type name in Schema Ids. In most cases, this - // works well because it prevents the "implementation detail" of type namespaces from leaking into your - // Swagger docs and UI. However, if you have multiple types in your API with the same class name, you'll - // need to opt out of this behavior to avoid Schema Id conflicts. - // - //c.UseFullTypeNameInSchemaIds(); + // Swashbuckle makes a best attempt at generating Swagger compliant JSON schemas for the various types + // exposed in your API. However, there may be occasions when more control of the output is needed. + // This is supported through the "MapType" and "SchemaFilter" options: + // + // Use the "MapType" option to override the Schema generation for a specific type. + // It should be noted that the resulting Schema will be placed "inline" for any applicable Operations. + // While Swagger 2.0 supports inline definitions for "all" Schema types, the swagger-ui tool does not. + // It expects "complex" Schemas to be defined separately and referenced. For this reason, you should only + // use the "MapType" option when the resulting Schema is a primitive or array type. If you need to alter a + // complex Schema, use a Schema filter. + // + //c.MapType(() => new Schema { type = "integer", format = "int32" }); - // Alternatively, you can provide your own custom strategy for inferring SchemaId's for - // describing "complex" types in your API. - // - //c.SchemaId(t => t.FullName.Contains('`') ? t.FullName.Substring(0, t.FullName.IndexOf('`')) : t.FullName); + // If you want to post-modify "complex" Schemas once they've been generated, across the board or for a + // specific type, you can wire up one or more Schema filters. + // + //c.SchemaFilter(); - // Set this flag to omit schema property descriptions for any type properties decorated with the - // Obsolete attribute - //c.IgnoreObsoleteProperties(); + // In a Swagger 2.0 document, complex types are typically declared globally and referenced by unique + // Schema Id. By default, Swashbuckle does NOT use the full type name in Schema Ids. In most cases, this + // works well because it prevents the "implementation detail" of type namespaces from leaking into your + // Swagger docs and UI. However, if you have multiple types in your API with the same class name, you'll + // need to opt out of this behavior to avoid Schema Id conflicts. + // + c.UseFullTypeNameInSchemaIds(); - // In accordance with the built in JsonSerializer, Swashbuckle will, by default, describe enums as integers. - // You can change the serializer behavior by configuring the StringToEnumConverter globally or for a given - // enum type. Swashbuckle will honor this change out-of-the-box. However, if you use a different - // approach to serialize enums as strings, you can also force Swashbuckle to describe them as strings. - // - //c.DescribeAllEnumsAsStrings(); + // Alternatively, you can provide your own custom strategy for inferring SchemaId's for + // describing "complex" types in your API. + // + //c.SchemaId(t => t.FullName.Contains('`') ? t.FullName.Substring(0, t.FullName.IndexOf('`')) : t.FullName); - // Similar to Schema filters, Swashbuckle also supports Operation and Document filters: - // - // Post-modify Operation descriptions once they've been generated by wiring up one or more - // Operation filters. - // - //c.OperationFilter(); - // - // If you've defined an OAuth2 flow as described above, you could use a custom filter - // to inspect some attribute on each action and infer which (if any) OAuth2 scopes are required - // to execute the operation - // - //c.OperationFilter(); + // Set this flag to omit schema property descriptions for any type properties decorated with the + // Obsolete attribute + //c.IgnoreObsoleteProperties(); - // Post-modify the entire Swagger document by wiring up one or more Document filters. - // This gives full control to modify the final SwaggerDocument. You should have a good understanding of - // the Swagger 2.0 spec. - https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md - // before using this option. - // - //c.DocumentFilter(); + // In accordance with the built in JsonSerializer, Swashbuckle will, by default, describe enums as integers. + // You can change the serializer behavior by configuring the StringToEnumConverter globally or for a given + // enum type. Swashbuckle will honor this change out-of-the-box. However, if you use a different + // approach to serialize enums as strings, you can also force Swashbuckle to describe them as strings. + // + //c.DescribeAllEnumsAsStrings(); - // In contrast to WebApi, Swagger 2.0 does not include the query string component when mapping a URL - // to an action. As a result, Swashbuckle will raise an exception if it encounters multiple actions - // with the same path (sans query string) and HTTP method. You can workaround this by providing a - // custom strategy to pick a winner or merge the descriptions for the purposes of the Swagger docs - // - c.ResolveConflictingActions(apiDescriptions => apiDescriptions.First()); + // Similar to Schema filters, Swashbuckle also supports Operation and Document filters: + // + // Post-modify Operation descriptions once they've been generated by wiring up one or more + // Operation filters. + // + //c.OperationFilter(); + // + // If you've defined an OAuth2 flow as described above, you could use a custom filter + // to inspect some attribute on each action and infer which (if any) OAuth2 scopes are required + // to execute the operation + // + //c.OperationFilter(); - // Wrap the default SwaggerGenerator with additional behavior (e.g. caching) or provide an - // alternative implementation for ISwaggerProvider with the CustomProvider option. - // - //c.CustomProvider((defaultProvider) => new CachingSwaggerProvider(defaultProvider)); - }) + // Post-modify the entire Swagger document by wiring up one or more Document filters. + // This gives full control to modify the final SwaggerDocument. You should have a good understanding of + // the Swagger 2.0 spec. - https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md + // before using this option. + // + //c.DocumentFilter(); + + // In contrast to WebApi, Swagger 2.0 does not include the query string component when mapping a URL + // to an action. As a result, Swashbuckle will raise an exception if it encounters multiple actions + // with the same path (sans query string) and HTTP method. You can workaround this by providing a + // custom strategy to pick a winner or merge the descriptions for the purposes of the Swagger docs + // + c.ResolveConflictingActions(apiDescriptions => apiDescriptions.First()); + + // Wrap the default SwaggerGenerator with additional behavior (e.g. caching) or provide an + // alternative implementation for ISwaggerProvider with the CustomProvider option. + // + //c.CustomProvider((defaultProvider) => new CachingSwaggerProvider(defaultProvider)); + }) .EnableSwaggerUi(c => - { - // Use the "DocumentTitle" option to change the Document title. - // Very helpful when you have multiple Swagger pages open, to tell them apart. - // - //c.DocumentTitle("My Swagger UI"); + { + // Use the "DocumentTitle" option to change the Document title. + // Very helpful when you have multiple Swagger pages open, to tell them apart. + // + //c.DocumentTitle("My Swagger UI"); - // Use the "InjectStylesheet" option to enrich the UI with one or more additional CSS stylesheets. - // The file must be included in your project as an "Embedded Resource", and then the resource's - // "Logical Name" is passed to the method as shown below. - // - //c.InjectStylesheet(containingAssembly, "Swashbuckle.Dummy.SwaggerExtensions.testStyles1.css"); + // Use the "InjectStylesheet" option to enrich the UI with one or more additional CSS stylesheets. + // The file must be included in your project as an "Embedded Resource", and then the resource's + // "Logical Name" is passed to the method as shown below. + // + //c.InjectStylesheet(containingAssembly, "Swashbuckle.Dummy.SwaggerExtensions.testStyles1.css"); - // Use the "InjectJavaScript" option to invoke one or more custom JavaScripts after the swagger-ui - // has loaded. The file must be included in your project as an "Embedded Resource", and then the resource's - // "Logical Name" is passed to the method as shown above. - // - //c.InjectJavaScript(thisAssembly, "Swashbuckle.Dummy.SwaggerExtensions.testScript1.js"); + // Use the "InjectJavaScript" option to invoke one or more custom JavaScripts after the swagger-ui + // has loaded. The file must be included in your project as an "Embedded Resource", and then the resource's + // "Logical Name" is passed to the method as shown above. + // + //c.InjectJavaScript(thisAssembly, "Swashbuckle.Dummy.SwaggerExtensions.testScript1.js"); - // The swagger-ui renders boolean data types as a dropdown. By default, it provides "true" and "false" - // strings as the possible choices. You can use this option to change these to something else, - // for example 0 and 1. - // - //c.BooleanValues(new[] { "0", "1" }); + // The swagger-ui renders boolean data types as a dropdown. By default, it provides "true" and "false" + // strings as the possible choices. You can use this option to change these to something else, + // for example 0 and 1. + // + //c.BooleanValues(new[] { "0", "1" }); - // By default, swagger-ui will validate specs against swagger.io's online validator and display the result - // in a badge at the bottom of the page. Use these options to set a different validator URL or to disable the - // feature entirely. - //c.SetValidatorUrl("http://localhost/validator"); - //c.DisableValidator(); + // By default, swagger-ui will validate specs against swagger.io's online validator and display the result + // in a badge at the bottom of the page. Use these options to set a different validator URL or to disable the + // feature entirely. + //c.SetValidatorUrl("http://localhost/validator"); + //c.DisableValidator(); - // Use this option to control how the Operation listing is displayed. - // It can be set to "None" (default), "List" (shows operations for each resource), - // or "Full" (fully expanded: shows operations and their details). - // - //c.DocExpansion(DocExpansion.List); + // Use this option to control how the Operation listing is displayed. + // It can be set to "None" (default), "List" (shows operations for each resource), + // or "Full" (fully expanded: shows operations and their details). + // + //c.DocExpansion(DocExpansion.List); - // Specify which HTTP operations will have the 'Try it out!' option. An empty paramter list disables - // it for all operations. - // - //c.SupportedSubmitMethods("GET", "HEAD"); + // Specify which HTTP operations will have the 'Try it out!' option. An empty paramter list disables + // it for all operations. + // + //c.SupportedSubmitMethods("GET", "HEAD"); - // Use the CustomAsset option to provide your own version of assets used in the swagger-ui. - // It's typically used to instruct Swashbuckle to return your version instead of the default - // when a request is made for "index.html". As with all custom content, the file must be included - // in your project as an "Embedded Resource", and then the resource's "Logical Name" is passed to - // the method as shown below. - // - //c.CustomAsset("index", containingAssembly, "YourWebApiProject.SwaggerExtensions.index.html"); + // Use the CustomAsset option to provide your own version of assets used in the swagger-ui. + // It's typically used to instruct Swashbuckle to return your version instead of the default + // when a request is made for "index.html". As with all custom content, the file must be included + // in your project as an "Embedded Resource", and then the resource's "Logical Name" is passed to + // the method as shown below. + // + //c.CustomAsset("index", containingAssembly, "YourWebApiProject.SwaggerExtensions.index.html"); - // If your API has multiple versions and you've applied the MultipleApiVersions setting - // as described above, you can also enable a select box in the swagger-ui, that displays - // a discovery URL for each version. This provides a convenient way for users to browse documentation - // for different API versions. - // - //c.EnableDiscoveryUrlSelector(); + // If your API has multiple versions and you've applied the MultipleApiVersions setting + // as described above, you can also enable a select box in the swagger-ui, that displays + // a discovery URL for each version. This provides a convenient way for users to browse documentation + // for different API versions. + // + c.EnableDiscoveryUrlSelector(); + // If your API supports the OAuth2 Implicit flow, and you've described it correctly, according to + // the Swagger 2.0 specification, you can enable UI support as shown below. + // + //c.EnableOAuth2Support( + // clientId: "test-client-id", + // clientSecret: null, + // realm: "test-realm", + // appName: "Swagger UI" + // //additionalQueryStringParams: new Dictionary() { { "foo", "bar" } } + //); - // If your API supports the OAuth2 Implicit flow, and you've described it correctly, according to - // the Swagger 2.0 specification, you can enable UI support as shown below. - // - //c.EnableOAuth2Support( - // clientId: "test-client-id", - // clientSecret: null, - // realm: "test-realm", - // appName: "Swagger UI" - // //additionalQueryStringParams: new Dictionary() { { "foo", "bar" } } - //); + // If your API supports ApiKey, you can override the default values. + // "apiKeyIn" can either be "query" or "header" + // + c.EnableApiKeySupport("token", "header"); + }); + } - // If your API supports ApiKey, you can override the default values. - // "apiKeyIn" can either be "query" or "header" - // - //c.EnableApiKeySupport("apiKey", "header"); - }); + /// + /// ض汾µĽӿ + /// + /// + /// + /// + private static bool ResolveVersionSupportByRouteConstraint(ApiDescription apiDesc, string targetApiVersion) + { + //var controllerFullName = apiDesc.ActionDescriptor.ControllerDescriptor.ControllerType.FullName; + //return controllerFullName.Split('.').Contains(targetApiVersion, StringComparer.OrdinalIgnoreCase); + var controllerFullName = apiDesc.ActionDescriptor.ControllerDescriptor.ControllerName; + return controllerFullName.Contains(targetApiVersion); + } + protected static string GetXmlCommentsPath(string name) + { + return System.String.Format(@"{0}\bin\{1}.xml", System.AppDomain.CurrentDomain.BaseDirectory, name); } } }