去除静态变量Funs.DB
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user