去除静态变量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
@@ -5,6 +5,7 @@ using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
namespace BLL
@@ -12,9 +13,6 @@ namespace BLL
public static class BidDocStandingBookService
{
public static Model.SGGLDB db = Funs.DB;
#region
/// <summary>
/// 记录数
@@ -26,7 +24,7 @@ namespace BLL
}
public static List<Model.PHTGL_BidDocumentsStandingBook> GetPHTGL_BidDocumentsStandingBookByModle(Model.PHTGL_BidDocumentsStandingBook table)
{
var q = from x in db.PHTGL_BidDocumentsStandingBook
var q = from x in Funs.DB.PHTGL_BidDocumentsStandingBook
where
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
(string.IsNullOrEmpty(table.DepartId) || x.DepartId.Contains(table.DepartId)) &&
@@ -100,7 +98,7 @@ namespace BLL
public static Model.PHTGL_BidDocumentsStandingBook GetPHTGL_BidDocumentsStandingBookById(string BidDocumentsStandingBookId)
{
return db.PHTGL_BidDocumentsStandingBook.FirstOrDefault(x => x.BidDocumentsStandingBookId == BidDocumentsStandingBookId);
return Funs.DB.PHTGL_BidDocumentsStandingBook.FirstOrDefault(x => x.BidDocumentsStandingBookId == BidDocumentsStandingBookId);
}
@@ -132,22 +130,23 @@ namespace BLL
BidNoticeCode=newtable.BidNoticeCode,
BidUnitFileCode=newtable.BidUnitFileCode,
};
db.PHTGL_BidDocumentsStandingBook.InsertOnSubmit(table);
db.SubmitChanges();
var db1 = Funs.DB;
db1.PHTGL_BidDocumentsStandingBook.InsertOnSubmit(table);
db1.SubmitChanges();
}
public static void AddBulkPHTGL_BidDocumentsStandingBook(List<Model.PHTGL_BidDocumentsStandingBook> newtables)
{
db.PHTGL_BidDocumentsStandingBook.InsertAllOnSubmit(newtables);
db.SubmitChanges();
var db1 = Funs.DB;
db1.PHTGL_BidDocumentsStandingBook.InsertAllOnSubmit(newtables);
db1.SubmitChanges();
}
public static void UpdatePHTGL_BidDocumentsStandingBook(Model.PHTGL_BidDocumentsStandingBook newtable)
{
Model.PHTGL_BidDocumentsStandingBook table = db.PHTGL_BidDocumentsStandingBook.FirstOrDefault(x => x.BidDocumentsStandingBookId == newtable.BidDocumentsStandingBookId);
var db1 = Funs.DB;
Model.PHTGL_BidDocumentsStandingBook table = db1.PHTGL_BidDocumentsStandingBook.FirstOrDefault(x => x.BidDocumentsStandingBookId == newtable.BidDocumentsStandingBookId);
if (table != null)
{
table.BidDocumentsStandingBookId = newtable.BidDocumentsStandingBookId;
@@ -172,28 +171,29 @@ namespace BLL
table.State=newtable.State;
table.BidNoticeCode= newtable.BidNoticeCode;
table.BidUnitFileCode=newtable.BidUnitFileCode;
db.SubmitChanges();
db1.SubmitChanges();
}
}
public static void DeletePHTGL_BidDocumentsStandingBookById(string BidDocumentsStandingBookId)
{
Model.PHTGL_BidDocumentsStandingBook table = db.PHTGL_BidDocumentsStandingBook.FirstOrDefault(x => x.BidDocumentsStandingBookId == BidDocumentsStandingBookId);
var db1 = Funs.DB;
Model.PHTGL_BidDocumentsStandingBook table = db1.PHTGL_BidDocumentsStandingBook.FirstOrDefault(x => x.BidDocumentsStandingBookId == BidDocumentsStandingBookId);
if (table != null)
{
db.PHTGL_BidDocumentsStandingBook.DeleteOnSubmit(table);
db.SubmitChanges();
db1.PHTGL_BidDocumentsStandingBook.DeleteOnSubmit(table);
db1.SubmitChanges();
}
}
public static void DeleteALLPHTGL_BidDocumentsStandingBook()
{
if (db.PHTGL_BidDocumentsStandingBook != null)
var db1 = Funs.DB;
if (db1.PHTGL_BidDocumentsStandingBook != null)
{
db.PHTGL_BidDocumentsStandingBook.DeleteAllOnSubmit(db.PHTGL_BidDocumentsStandingBook);
db.SubmitChanges();
db1.PHTGL_BidDocumentsStandingBook.DeleteAllOnSubmit(db1.PHTGL_BidDocumentsStandingBook);
db1.SubmitChanges();
}
}