去除静态变量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,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>
/// 获取分页列表