全局处理问题:public static Model.SGGLDB db = Funs.DB;
This commit is contained in:
@@ -13,7 +13,7 @@ namespace BLL
|
||||
|
||||
public static class SYHSEData_DataService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
|
||||
#region 获取列表
|
||||
@@ -27,6 +27,7 @@ namespace BLL
|
||||
}
|
||||
public static List<Model.SYHSEData_Data> GetSYHSEData_DataByModle(Model.SYHSEData_Data table)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = from x in db.SYHSEData_Data
|
||||
where
|
||||
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
|
||||
@@ -174,13 +175,14 @@ namespace BLL
|
||||
|
||||
public static Model.SYHSEData_Data GetSYHSEData_DataById(string Id)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
return db.SYHSEData_Data.FirstOrDefault(x => x.Id == Id);
|
||||
}
|
||||
|
||||
|
||||
public static void AddSYHSEData_Data(Model.SYHSEData_Data newtable)
|
||||
{
|
||||
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.SYHSEData_Data table = new Model.SYHSEData_Data
|
||||
{
|
||||
Id = newtable.Id,
|
||||
@@ -198,7 +200,7 @@ namespace BLL
|
||||
|
||||
public static void AddBulkSYHSEData_Data(List<Model.SYHSEData_Data> newtables)
|
||||
{
|
||||
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
db.SYHSEData_Data.InsertAllOnSubmit(newtables);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
@@ -206,7 +208,7 @@ namespace BLL
|
||||
|
||||
public static void UpdateSYHSEData_Data(Model.SYHSEData_Data newtable)
|
||||
{
|
||||
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.SYHSEData_Data table = db.SYHSEData_Data.FirstOrDefault(x => x.Id == newtable.Id);
|
||||
if (table != null)
|
||||
{
|
||||
@@ -224,7 +226,7 @@ namespace BLL
|
||||
}
|
||||
public static void DeleteSYHSEData_DataById(string Id)
|
||||
{
|
||||
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.SYHSEData_Data table = db.SYHSEData_Data.FirstOrDefault(x => x.Id == Id);
|
||||
if (table != null)
|
||||
{
|
||||
@@ -236,6 +238,7 @@ namespace BLL
|
||||
|
||||
public static void DeleteALLSYHSEData_Data()
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
if (db.SYHSEData_Data != null)
|
||||
{
|
||||
db.SYHSEData_Data.DeleteAllOnSubmit(db.SYHSEData_Data);
|
||||
|
||||
Reference in New Issue
Block a user