去除静态变量Funs.DB
This commit is contained in:
@@ -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