去除静态变量Funs.DB

This commit is contained in:
2025-01-07 19:00:48 +08:00
parent 188974fadc
commit 2c1a328bc1
290 changed files with 1205 additions and 1242 deletions
-2
View File
@@ -8,8 +8,6 @@ namespace BLL
/// </summary>
public static class AccidentTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取事故类型
/// </summary>
+17 -20
View File
@@ -11,10 +11,7 @@ namespace BLL
public static class Base_CompanytemplateService
{
public static Model.SGGLDB db = Funs.DB;
#region
#region
/// <summary>
/// 记录数
/// </summary>
@@ -25,7 +22,7 @@ namespace BLL
}
public static List<Model.Base_CompanyTemplate> 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<Model.Base_CompanyTemplate> 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)
+17 -20
View File
@@ -11,9 +11,6 @@ namespace BLL
public static class Base_FactoryService
{
public static Model.SGGLDB db = Funs.DB;
#region
/// <summary>
/// 记录数
@@ -25,7 +22,7 @@ namespace BLL
}
public static List<Model.Base_Factory> 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<Model.Base_Factory> 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<Model.Base_Factory> 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)
@@ -7,8 +7,6 @@ namespace BLL
{
public class CNProfessionalService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取实体集合
/// </summary>
@@ -8,7 +8,6 @@ namespace BLL
{
public static class CQMSTrainObjectService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取培训对象
@@ -8,7 +8,6 @@ namespace BLL
/// </summary>
public static class CQMSTrainTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取培训类型
-2
View File
@@ -8,8 +8,6 @@ namespace BLL
/// </summary>
public static class CertificateService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取特岗证书
/// </summary>
+2 -3
View File
@@ -2,6 +2,7 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
@@ -10,8 +11,6 @@ namespace BLL
/// </summary>
public static class CheckTemplateService
{
public static Model.SGGLDB db = Funs.DB;
#region
/// <summary>
/// 记录数
@@ -25,7 +24,7 @@ namespace BLL
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.ProjectSupervision_CheckTemplate> getDataLists = from x in db.ProjectSupervision_CheckTemplate
private static IQueryable<Model.ProjectSupervision_CheckTemplate> getDataLists = from x in Funs.DB.ProjectSupervision_CheckTemplate
select x;
/// 获取分页列表
@@ -8,8 +8,6 @@ namespace BLL
/// </summary>
public static class ConstructionTestTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取施工试验类型
/// </summary>
-2
View File
@@ -8,8 +8,6 @@ namespace BLL
/// </summary>
public static class CostTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取费用类型
/// </summary>
@@ -7,7 +7,6 @@ namespace BLL
{
public class DesignProfessionalService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取实体集合
@@ -5,7 +5,6 @@ namespace BLL
{
public static class EmergencyTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取信息
@@ -5,7 +5,6 @@ namespace BLL
{
public class HSSEStandardListTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取标准规范类别信息
@@ -8,7 +8,6 @@ namespace BLL
/// </summary>
public static class LawsRegulationsTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据id获取法律法规类型信息
-1
View File
@@ -8,7 +8,6 @@ namespace BLL
/// </summary>
public static class LicenseTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取许可证类型
@@ -8,7 +8,6 @@ namespace BLL
/// </summary>
public static class ManageRuleTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取管理规定分类
+1 -1
View File
@@ -8,7 +8,7 @@ namespace BLL
/// </summary>
public static class MaterialTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取材料类型
@@ -8,7 +8,7 @@ namespace BLL
/// </summary>
public static class NoticeAndSupervisionTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取告知和监检类型
+1 -1
View File
@@ -8,7 +8,7 @@ namespace BLL
/// </summary>
public static class PictureTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取项目图片分类
+1 -1
View File
@@ -8,7 +8,7 @@ namespace BLL
/// </summary>
public static class PositionService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取主键
+1 -1
View File
@@ -5,7 +5,7 @@ namespace BLL
{
public static class PostTitleService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取信息
@@ -5,7 +5,7 @@ namespace BLL
{
public static class PracticeCertificateService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取执业资格证书
+1 -1
View File
@@ -8,7 +8,7 @@ namespace BLL
public static class ProjectTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取信息
+1 -1
View File
@@ -8,7 +8,7 @@ namespace BLL
/// </summary>
public static class PunishTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取处罚定义
@@ -6,7 +6,7 @@ namespace BLL
{
public class QualityQuestionTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 获取实体集合
+1 -1
View File
@@ -8,7 +8,7 @@ namespace BLL
/// </summary>
public static class RewardTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取奖励定义
@@ -8,7 +8,7 @@ namespace BLL
/// </summary>
public static class RulesRegulationsTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取规章制度类别
+3 -3
View File
@@ -8,7 +8,7 @@ namespace BLL
/// </summary>
public static class SafetyMeasuresService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取安全措施
@@ -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();
}
/// <summary>
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
@@ -8,8 +9,6 @@ namespace BLL
/// </summary>
public static class SolutionTempleteTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取施工方案模板类型
/// </summary>
@@ -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
/// <param name="solutionTempleteType"></param>
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
/// <param name="solutionTempleteTypeCode"></param>
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
/// <returns></returns>
public static List<Model.Base_SolutionTempleteType> 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();
}
/// <summary>
/// 获取类别下拉项
+1 -1
View File
@@ -9,7 +9,7 @@ namespace BLL
/// </summary>
public static class SpecialEquipmentService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取机具设备
@@ -5,7 +5,7 @@ namespace BLL
{
public static class SpecialSchemeTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取信息
+1 -1
View File
@@ -8,7 +8,7 @@ namespace BLL
/// </summary>
public static class TrainLevelService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取主键
+1 -1
View File
@@ -8,7 +8,7 @@ namespace BLL
/// </summary>
public static class TrainTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取培训类型
+1 -1
View File
@@ -6,7 +6,7 @@ namespace BLL
public static class UnitTypeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取信息
+1 -1
View File
@@ -6,7 +6,7 @@ namespace BLL
{
public static class WorkPostService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取信息
+12 -10
View File
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
@@ -8,8 +9,6 @@ namespace BLL
/// </summary>
public static class WorkStageService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取工作阶段
/// </summary>
@@ -36,7 +35,7 @@ namespace BLL
/// <returns></returns>
public static List<Model.Base_WorkStage> 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();
}
/// <summary>
@@ -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();
}
/// <summary>
@@ -62,13 +62,14 @@ namespace BLL
/// <param name="workStage"></param>
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
/// <param name="workStageId"></param>
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();
}
}
@@ -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;
/// <summary>
/// 获取质量巡检模板列表
/// </summary>
@@ -16,14 +16,15 @@ namespace BLL
/// <returns></returns>
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
/// <returns></returns>
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
/// <returns>一个质量巡检审批实体</returns>
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);
}
/// <summary>
/// 修改质量巡检审批信息
@@ -163,7 +164,7 @@ namespace BLL
/// <returns></returns>
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);
}
/// <summary>
@@ -173,7 +174,7 @@ namespace BLL
/// <returns></returns>
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);
}
/// <summary>
@@ -183,7 +184,7 @@ namespace BLL
/// <returns></returns>
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);
}
/// <summary>
@@ -193,7 +194,7 @@ namespace BLL
/// <returns></returns>
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);
}
/// <summary>
@@ -203,12 +204,12 @@ namespace BLL
/// <returns></returns>
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<Model.Check_CheckControlApprove> GetListDataByCodeForApi(string code)
{
+1 -1
View File
@@ -8,7 +8,7 @@ namespace BLL
{
public class CheckControlService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据质量检查与控制Id删除一个质量检查与控制信息
/// </summary>
@@ -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;
/// <summary>
/// 获取设计变更模板列表
/// </summary>
@@ -16,14 +15,15 @@ namespace BLL
/// <returns></returns>
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
/// <returns>一个设计变更审批实体</returns>
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);
}
/// <summary>
@@ -48,17 +48,17 @@ namespace BLL
/// <returns>一个设计变更审批实体</returns>
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);
}
/// <summary>
@@ -68,7 +68,7 @@ namespace BLL
/// <returns>设计变更审批集合</returns>
public static List<Model.Check_CheckEquipmentApprove> 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();
}
/// <summary>
@@ -187,14 +187,15 @@ namespace BLL
}
public static List<Model.Check_CheckEquipmentApprove> 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,
+5 -5
View File
@@ -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;
/// <summary>
/// 记录数
/// </summary>
@@ -22,7 +21,7 @@ namespace BLL
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.Check_CheckEquipment> qq = from x in db.Check_CheckEquipment orderby x.CompileDate descending select x;
private static IQueryable<Model.Check_CheckEquipment> qq = from x in Funs.DB.Check_CheckEquipment orderby x.CompileDate descending select x;
/// <summary>
/// 获取分页列表
@@ -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,
};
+20 -20
View File
@@ -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
/// <summary>
/// 记录数
@@ -25,7 +23,7 @@ namespace BLL
}
public static List<Model.Check_MaterialAcceptance> 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<Model.Check_MaterialAcceptance> 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();
}
}
+3 -4
View File
@@ -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;
/// <summary>
/// 记录数
/// </summary>
@@ -20,7 +19,7 @@ namespace BLL
/// <summary>
/// 定义变量
/// </summary>
public static IQueryable<Model.Check_CheckMonth> qq = from x in db.Check_CheckMonth orderby x.Months descending select x;
public static IQueryable<Model.Check_CheckMonth> qq = from x in Funs.DB.Check_CheckMonth orderby x.Months descending select x;
/// <summary>
/// 获取分页列表
@@ -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(),
};
+10 -10
View File
@@ -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;
/// <summary>
/// 获取设计变更模板列表
/// </summary>
@@ -16,14 +15,15 @@ namespace BLL
/// <returns></returns>
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
/// <returns>一个设计变更审批实体</returns>
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);
}
/// <summary>
@@ -48,22 +48,22 @@ namespace BLL
/// <returns>一个设计变更审批实体</returns>
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);
}
/// <summary>
@@ -73,7 +73,7 @@ namespace BLL
/// <returns>设计变更审批集合</returns>
public static List<Model.Check_DesignApprove> 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();
}
/// <summary>
+2 -3
View File
@@ -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;
/// <summary>
/// 记录数
/// </summary>
@@ -23,7 +22,7 @@ namespace BLL
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.Check_Design> qq = from x in db.Check_Design orderby x.DesignDate descending select x;
private static IQueryable<Model.Check_Design> qq = from x in Funs.DB.Check_Design orderby x.DesignDate descending select x;
public static string CovBool(bool? b)
+8 -6
View File
@@ -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;
/// <summary>
/// 增加信息
/// </summary>
@@ -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();
}
/// <summary>
/// 记录数
@@ -55,7 +56,7 @@ namespace BLL
/// <returns></returns>
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);
}
/// <summary>
/// 获取重要文件
@@ -104,7 +105,8 @@ namespace BLL
/// <param name="updateFileCabinet">实体</param>
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();
}
}
@@ -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;
/// <summary>
/// 根据质量共检编号删除对应的所有质量共检审批信息
/// </summary>
@@ -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
/// <returns></returns>
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);
}
/// <summary>
@@ -237,7 +237,7 @@ namespace BLL
/// <returns></returns>
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);
}
/// <summary>
@@ -247,7 +247,7 @@ namespace BLL
/// <returns></returns>
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);
}
/// <summary>
@@ -257,7 +257,7 @@ namespace BLL
/// <returns></returns>
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<Model.Check_JointCheckApprove> getListDataByJcidForApi(string JointCheckId, string JointCheckDetailId)
{
+2 -3
View File
@@ -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;
/// <summary>
/// 获取月报设计变更情况列表
/// </summary>
@@ -15,7 +14,7 @@ namespace BLL
/// <returns></returns>
public static List<Model.Check_MonthDesign> 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();
}
+2 -3
View File
@@ -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;
/// <summary>
/// 获取月报无损检测情况模板列表
/// </summary>
@@ -15,7 +14,7 @@ namespace BLL
/// <returns></returns>
public static List<Model.Check_MonthNDTCheck> 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();
}
+2 -3
View File
@@ -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;
/// <summary>
/// 获取月报质量巡检情况模板列表
/// </summary>
@@ -15,7 +14,7 @@ namespace BLL
/// <returns></returns>
public static List<Model.Check_MonthRectify> 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();
}
@@ -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;
/// <summary>
/// 获取月报质量验收情况模板列表
/// </summary>
@@ -15,7 +14,7 @@ namespace BLL
/// <returns></returns>
public static List<Model.Check_MonthSpotCheckDetail> 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();
}
+2 -3
View File
@@ -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;
/// <summary>
/// 获取月报焊工资格评定情况模板列表
/// </summary>
@@ -15,7 +14,7 @@ namespace BLL
/// <returns></returns>
public static List<Model.Check_MonthWelder> 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();
}
@@ -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;
/// <summary>
/// 获取月报特种设备信息模板列表
/// </summary>
@@ -16,7 +15,7 @@ namespace BLL
/// <returns></returns>
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
{
+16 -14
View File
@@ -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
/// <returns></returns>
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
/// <returns></returns>
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
/// <returns>一个实体验收审批实体</returns>
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);
}
/// <summary>
@@ -137,7 +138,7 @@ namespace BLL
/// <returns>实体验收审批集合</returns>
public static List<Model.Check_SpotCheckApprove> 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();
}
/// <summary>
@@ -233,14 +234,15 @@ namespace BLL
}
public static List<Model.Check_SpotCheckApprove> 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,
@@ -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;
/// <summary>
/// 获取实体验收记录明细
/// </summary>
@@ -17,7 +16,7 @@ namespace BLL
/// <returns></returns>
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
{
+1 -1
View File
@@ -8,7 +8,7 @@ namespace BLL
{
public class SpotCheckService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 添加实体验收记录
@@ -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
/// <returns></returns>
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);
}
/// <summary>
@@ -125,7 +125,7 @@ namespace BLL
/// <returns>一个工程联络单审批实体</returns>
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");
}
/// <summary>
/// 根据工程联络单审批编号获取一个工程联络单审批信息
@@ -134,7 +134,7 @@ namespace BLL
/// <returns>一个工程联络单审批实体</returns>
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);
}
/// <summary>
@@ -155,7 +155,7 @@ namespace BLL
/// <returns></returns>
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);
}
/// <summary>
@@ -165,7 +165,7 @@ namespace BLL
/// <returns></returns>
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));
}
/// <summary>
@@ -175,7 +175,7 @@ namespace BLL
/// <returns></returns>
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));
}
/// <summary>
@@ -185,7 +185,7 @@ namespace BLL
/// <returns></returns>
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<Model.Check_TechnicalContactListApprove> GetListDataByIdForApi(string TechnicalContactListId)
{
@@ -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;
/// <summary>
/// 根据工程联络单信息Id删除一个工程联络单信息信息
/// </summary>
@@ -401,7 +400,7 @@ namespace BLL
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.Check_TechnicalContactList> qq = from x in db.Check_TechnicalContactList orderby x.CompileDate descending select x;
private static IQueryable<Model.Check_TechnicalContactList> qq = from x in Funs.DB.Check_TechnicalContactList orderby x.CompileDate descending select x;
/// <summary>
/// 获取分页列表
@@ -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;
/// <summary>
/// 获取报验管理模板列表
/// </summary>
@@ -16,14 +16,15 @@ namespace BLL
/// <returns></returns>
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
/// <returns></returns>
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
/// <returns>一个报验管理审批实体</returns>
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);
}
/// <summary>
/// 修改报验管理审批信息
@@ -148,7 +149,7 @@ namespace BLL
/// <returns></returns>
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);
}
/// <summary>
@@ -158,12 +159,12 @@ namespace BLL
/// <returns></returns>
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);
}
}
}
@@ -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;
/// <summary>
/// 获取质量会议模板列表
/// </summary>
@@ -16,14 +16,15 @@ namespace BLL
/// <returns></returns>
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
/// <returns></returns>
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
/// <returns>一个质量会议审批实体</returns>
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);
}
/// <summary>
/// 修改质量会议审批信息
@@ -160,12 +161,12 @@ namespace BLL
/// <returns></returns>
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<Model.Meeting_CQMSMeetingApprove> GetListDataByIdForApi(string id)
+1 -1
View File
@@ -10,7 +10,7 @@ namespace BLL
/// </summary>
public static class CQMS_MeetingService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取质量会议
@@ -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;
/// <summary>
/// 获取焊工考试计划明细列表
/// </summary>
@@ -19,8 +18,9 @@ namespace BLL
/// <returns></returns>
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
/// <returns></returns>
public static List<string> 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();
}
@@ -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;
/// <summary>
/// 获取总包施工计划模板列表
/// </summary>
@@ -16,14 +16,15 @@ namespace BLL
/// <returns></returns>
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
/// <returns></returns>
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
/// <returns>一个总包施工计划审批实体</returns>
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);
}
/// <summary>
@@ -108,12 +109,12 @@ namespace BLL
/// <returns>总包施工计划审批集合</returns>
public static List<Model.Plan_MainPlanApprove> 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
/// <returns></returns>
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);
}
/// <summary>
@@ -200,7 +201,7 @@ namespace BLL
/// <returns></returns>
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);
}
/// <summary>
@@ -210,12 +211,12 @@ namespace BLL
/// <returns></returns>
public static List<string> 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<Model.Plan_MainPlanApprove> getApproveListDataByIdForApi(string MainPlanId)
@@ -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;
/// <summary>
/// 获取质量奖罚模板列表
/// </summary>
@@ -16,14 +16,15 @@ namespace BLL
/// <returns></returns>
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
/// <returns></returns>
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
/// <returns>一个质量奖罚审批实体</returns>
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);
}
/// <summary>
/// 修改质量奖罚审批信息
@@ -193,12 +194,12 @@ namespace BLL
/// <returns></returns>
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)
@@ -10,7 +10,7 @@ namespace BLL
/// </summary>
public static class RewardAndPunishService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取质量奖罚
@@ -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;
/// <summary>
/// 获取分页列表
/// </summary>
/// <returns></returns>
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
/// <returns>一个工作联系单审批实体</returns>
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");
}
/// <summary>
/// 修改工作联系单审批信息
@@ -138,7 +138,7 @@ namespace BLL
/// <returns></returns>
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);
}
/// <summary>
@@ -148,7 +148,7 @@ namespace BLL
/// <returns></returns>
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));
}
/// <summary>
@@ -158,7 +158,7 @@ namespace BLL
/// <returns></returns>
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);
}
/// <summary>
@@ -168,12 +168,12 @@ namespace BLL
/// <returns></returns>
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)
{
+10 -9
View File
@@ -8,8 +8,6 @@ namespace BLL
{
public static class AttachFileService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 添加附件存储信息
/// </summary>
@@ -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();
}
/// <summary>
@@ -34,12 +33,13 @@ namespace BLL
/// <param name="workArea"></param>
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
/// <param name="workAreaId"></param>
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();
}
}
+6 -5
View File
@@ -1,4 +1,6 @@
namespace BLL
using Model;
namespace BLL
{
using System;
using System.Collections;
@@ -9,7 +11,6 @@
/// </summary>
public static class ProjectDataFlowSetService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 记录数
/// </summary>
@@ -27,7 +28,7 @@
/// <returns></returns>
public static IEnumerable getListData(string dataId, int startRowIndex, int maximumRows)
{
IQueryable<Model.View_ProjectData_FlowOperate> q = from x in db.View_ProjectData_FlowOperate
IQueryable<Model.View_ProjectData_FlowOperate> 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 @@
/// <param name="dataId">主表主键Id</param>
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 @@
/// </summary>
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;
+1 -1
View File
@@ -9,7 +9,7 @@ namespace BLL
/// </summary>
public class WeatherService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取事故类型
+3 -4
View File
@@ -8,8 +8,6 @@ namespace BLL
/// </summary>
public static class CQMSDataCollectService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取项目质量数据汇总
/// </summary>
@@ -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
}
+2 -3
View File
@@ -2,6 +2,7 @@
using System;
using System.Collections;
using System.Linq;
using Model;
namespace BLL
{
@@ -10,8 +11,6 @@ namespace BLL
/// </summary>
public static class CQMSDataDWService
{
public static Model.SGGLDB db = Funs.DB;
#region
/// <summary>
/// 记录数
@@ -25,7 +24,7 @@ namespace BLL
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.Base_Project> getDataLists = from x in db.Base_Project
private static IQueryable<Model.Base_Project> getDataLists = from x in Funs.DB.Base_Project
where x.ProjectState == Const.ProjectState_1
select x;
+3 -4
View File
@@ -8,8 +8,6 @@ namespace BLL
/// </summary>
public static class HSEDataCollectService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取项目HSE数据汇总
/// </summary>
@@ -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
}
+5 -5
View File
@@ -2,6 +2,7 @@
using System;
using System.Collections;
using System.Linq;
using Model;
namespace BLL
{
@@ -10,8 +11,6 @@ namespace BLL
/// </summary>
public static class HSEDataDWService
{
public static Model.SGGLDB db = Funs.DB;
#region
/// <summary>
/// 记录数
@@ -25,7 +24,7 @@ namespace BLL
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.Base_Project> getDataLists = from x in db.Base_Project
private static IQueryable<Model.Base_Project> 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), //安全巡检整改率
};
}
+2 -3
View File
@@ -2,6 +2,7 @@
using System;
using System.Collections;
using System.Linq;
using Model;
namespace BLL
{
@@ -10,8 +11,6 @@ namespace BLL
/// </summary>
public static class HTGLDataDWService
{
public static Model.SGGLDB db = Funs.DB;
#region
/// <summary>
/// 记录数
@@ -25,7 +24,7 @@ namespace BLL
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.Base_Project> getDataLists = from x in db.Base_Project
private static IQueryable<Model.Base_Project> getDataLists = from x in Funs.DB.Base_Project
select x;
/// <summary>
+2 -3
View File
@@ -2,6 +2,7 @@
using System;
using System.Collections;
using System.Linq;
using Model;
namespace BLL
{
@@ -10,8 +11,6 @@ namespace BLL
/// </summary>
public static class JDGLDataDWService
{
public static Model.SGGLDB db = Funs.DB;
#region
/// <summary>
/// 记录数
@@ -25,7 +24,7 @@ namespace BLL
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.Base_Project> getDataLists = from x in db.Base_Project
private static IQueryable<Model.Base_Project> getDataLists = from x in Funs.DB.Base_Project
select x;
/// <summary>
+6 -7
View File
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Model;
namespace BLL
{
@@ -9,8 +10,6 @@ namespace BLL
/// </summary>
public static class ProblemAnalysisService
{
public static Model.SGGLDB db = Funs.DB;
#region AnalysisColumn
/// <summary>
/// 统计列
@@ -56,7 +55,7 @@ namespace BLL
/// <summary>
/// 安全巡检
/// </summary>
public static IQueryable<Model.HSSE_Hazard_HazardRegister> getHazardRegisterLists = from x in db.HSSE_Hazard_HazardRegister
public static IQueryable<Model.HSSE_Hazard_HazardRegister> 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;
/// <summary>
@@ -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
/// <summary>
/// 隐患整改单
/// </summary>
public static IQueryable<Model.Check_RectifyNotices> getRectifyNoticesLists = from x in db.Check_RectifyNotices
public static IQueryable<Model.Check_RectifyNotices> 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;
/// <summary>
@@ -409,13 +408,13 @@ namespace BLL
/// <summary>
/// 教育培训
/// </summary>
public static IQueryable<Model.EduTrain_TrainRecord> getTrainRecordLists = from x in db.EduTrain_TrainRecord
public static IQueryable<Model.EduTrain_TrainRecord> getTrainRecordLists = from x in Funs.DB.EduTrain_TrainRecord
where x.ProjectId != Const.Project_TestProjectId && x.ProjectId != null
select x;
/// <summary>
/// 教育培训明细
/// </summary>
public static IQueryable<Model.EduTrain_TrainRecordDetail> getTrainRecordDetailLists = from x in db.EduTrain_TrainRecordDetail
public static IQueryable<Model.EduTrain_TrainRecordDetail> getTrainRecordDetailLists = from x in Funs.DB.EduTrain_TrainRecordDetail
select x;
/// <summary>
/// 教育培训统计
@@ -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
/// </summary>
public static class ProjectWBSAnalysisService
{
public static Model.SGGLDB db = Funs.DB;
#region WBS分析
/// <summary>
/// 记录数
@@ -28,7 +27,7 @@ namespace BLL
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.WBS_WorkPackage> getDataLists = from x in db.WBS_WorkPackage
private static IQueryable<Model.WBS_WorkPackage> 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<Model.WBS_WorkPackage> listWork = new List<Model.WBS_WorkPackage>();
+2 -3
View File
@@ -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
/// </summary>
public static class WBSAnalysisService
{
public static Model.SGGLDB db = Funs.DB;
#region WBS分析
/// <summary>
/// 记录数
@@ -28,7 +27,7 @@ namespace BLL
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.WBS_WorkPackageInit> getDataLists = from x in db.WBS_WorkPackageInit
private static IQueryable<Model.WBS_WorkPackageInit> getDataLists = from x in Funs.DB.WBS_WorkPackageInit
select x;
/// <summary>
+1 -1
View File
@@ -8,7 +8,7 @@ namespace BLL
/// </summary>
public static class DocService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取帮助文档
@@ -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
/// <summary>
/// 记录数
@@ -30,7 +29,7 @@ namespace BLL
/// <returns></returns>
public static IEnumerable getListData(string name, Grid Grid1)
{
IQueryable<Model.HJGL_DesignBasisDataImport> q1 = from x in db.HJGL_DesignBasisDataImport select x;
IQueryable<Model.HJGL_DesignBasisDataImport> 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<Model.HJGL_DesignBasisDataImport> 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<decimal?> 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();
}
}
@@ -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();
}
}
@@ -35,7 +35,7 @@ namespace BLL
}
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 未到场
/// </summary>
@@ -73,9 +73,10 @@ namespace BLL
/// <returns></returns>
public static IEnumerable getListData(string name, Grid Grid1)
{
IQueryable<Model.HJGL_PackagingManage> 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<Model.HJGL_PackagingManage> 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();
}
}
@@ -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);
}
/// <summary>
/// 修改尾项检查审批信息
@@ -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<Model.HJGL_Pipeline_ComponentJoint> 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<Model.HJGL_Pipeline_ComponentJoint> 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();
}
}
@@ -7,7 +7,7 @@ namespace BLL
/// </summary>
public static class AccidentHandleService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取HSSE事故(含未遂)处理
@@ -7,7 +7,7 @@ namespace BLL
/// </summary>
public static class AccidentPersonRecordService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取HSSE事故(对人员)记录
@@ -9,7 +9,7 @@ namespace BLL
/// </summary>
public static class AccidentReportOtherService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取事故调查处理报告
@@ -9,7 +9,7 @@ namespace BLL
/// </summary>
public static class AccidentReportService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取事故调查报告
@@ -7,7 +7,7 @@ namespace BLL
/// </summary>
public static class NoFourLetoffService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取四不放过
@@ -8,7 +8,7 @@ namespace BLL
/// </summary>
public class Check_CheckColligationDetailService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据综合检查id获取所有相关明细信息
@@ -8,7 +8,7 @@ namespace BLL
/// </summary>
public class Check_CheckSpecialDetailService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据专项检查id获取所有相关明细信息
@@ -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
/// </summary>
public static class Check_CheckSpecialService
{
public static Model.SGGLDB db = Funs.DB;
#region
/// <summary>
/// 记录数
@@ -27,7 +26,7 @@ namespace BLL
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.Check_CheckSpecial> getDataLists = from x in db.Check_CheckSpecial
private static IQueryable<Model.Check_CheckSpecial> getDataLists = from x in Funs.DB.Check_CheckSpecial
select x;
/// <summary>
@@ -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" ? "待整改" : "待提交"),
};
@@ -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
/// </summary>
public static class Check_ProjectLeaderCheckService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取领导带班检查
/// </summary>
@@ -37,7 +36,7 @@ namespace BLL
/// <summary>
/// 定义变量
/// </summary>
private static IQueryable<Model.Check_ProjectLeaderCheck> getDataLists = from x in db.Check_ProjectLeaderCheck
private static IQueryable<Model.Check_ProjectLeaderCheck> getDataLists = from x in Funs.DB.Check_ProjectLeaderCheck
select x;
/// <summary>
@@ -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,
@@ -9,7 +9,7 @@ namespace BLL
/// </summary>
public static class IncentiveNoticeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取奖励通知单
+1 -1
View File
@@ -9,7 +9,7 @@ namespace BLL
/// </summary>
public static class PunishNoticeService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取处罚通知单
@@ -10,7 +10,7 @@ namespace BLL
/// </summary>
public static class CostManageItemService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键删除费用管理明细
+1 -1
View File
@@ -11,7 +11,7 @@ namespace BLL
/// </summary>
public static class CostManageService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取安全费用管理
@@ -9,7 +9,7 @@ namespace BLL
/// </summary>
public static class CostSmallDetailItemService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取安全费用投入登记明细
@@ -7,7 +7,7 @@ namespace BLL
/// </summary>
public static class CostSmallDetailService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取安全费用投入登记
+3 -4
View File
@@ -9,8 +9,6 @@ namespace BLL
/// </summary>
public static class ExpenseService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据主键获取措施费用使用计划
/// </summary>
@@ -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();
}
}
}
@@ -5,7 +5,7 @@ namespace BLL
{
public class AccidentCaseItemService
{
public static Model.SGGLDB db = Funs.DB;
/// <summary>
/// 根据常见事故案例明细Id获取事故案例明细

Some files were not shown because too many files have changed in this diff Show More