1
This commit is contained in:
@@ -11,7 +11,7 @@ namespace BLL
|
||||
|
||||
public static class EnergyreportItemService
|
||||
{
|
||||
public static Model.CNPCDB db = Funs.DB;
|
||||
|
||||
|
||||
|
||||
#region 获取列表
|
||||
@@ -25,6 +25,7 @@ namespace BLL
|
||||
}
|
||||
public static List<Model.Environmental_EnergyReportItem> GetEnvironmental_EnergyReportItemByModle(Model.Environmental_EnergyReportItem table)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
var q = from x in db.Environmental_EnergyReportItem
|
||||
where
|
||||
(string.IsNullOrEmpty(table.EnergyReportItemId) || x.EnergyReportItemId.Contains(table.EnergyReportItemId)) &&
|
||||
@@ -87,6 +88,7 @@ namespace BLL
|
||||
|
||||
public static Model.Environmental_EnergyReportItem GetEnvironmental_EnergyReportItemById(string EnergyReportItemId)
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
return db.Environmental_EnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == EnergyReportItemId);
|
||||
}
|
||||
|
||||
@@ -177,7 +179,7 @@ namespace BLL
|
||||
}
|
||||
public static void AddEnvironmental_EnergyReportItem(Model.Environmental_EnergyReportItem newtable)
|
||||
{
|
||||
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Environmental_EnergyReportItem table = new Model.Environmental_EnergyReportItem
|
||||
{
|
||||
EnergyReportItemId = newtable.EnergyReportItemId,
|
||||
@@ -209,7 +211,7 @@ namespace BLL
|
||||
|
||||
public static void AddBulkEnvironmental_EnergyReportItem(List<Model.Environmental_EnergyReportItem> newtables)
|
||||
{
|
||||
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
db.Environmental_EnergyReportItem.InsertAllOnSubmit(newtables);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
@@ -217,7 +219,7 @@ namespace BLL
|
||||
|
||||
public static void UpdateEnvironmental_EnergyReportItem(Model.Environmental_EnergyReportItem newtable)
|
||||
{
|
||||
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Environmental_EnergyReportItem table = db.Environmental_EnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == newtable.EnergyReportItemId);
|
||||
if (table != null)
|
||||
{
|
||||
@@ -249,7 +251,7 @@ namespace BLL
|
||||
}
|
||||
public static void DeleteEnvironmental_EnergyReportItemById(string EnergyReportItemId)
|
||||
{
|
||||
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
Model.Environmental_EnergyReportItem table = db.Environmental_EnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == EnergyReportItemId);
|
||||
if (table != null)
|
||||
{
|
||||
@@ -261,6 +263,7 @@ namespace BLL
|
||||
|
||||
public static void DeleteALLEnvironmental_EnergyReportItem()
|
||||
{
|
||||
Model.CNPCDB db = Funs.DB;
|
||||
if (db.Environmental_EnergyReportItem != null)
|
||||
{
|
||||
db.Environmental_EnergyReportItem.DeleteAllOnSubmit(db.Environmental_EnergyReportItem);
|
||||
|
||||
Reference in New Issue
Block a user