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