提交代码

This commit is contained in:
2024-10-30 17:15:30 +08:00
parent a2afd22163
commit 254c7ac7c0
24 changed files with 1527 additions and 828 deletions
@@ -142,7 +142,7 @@ namespace BLL
}
public static void DeleteEnvironmental_EnergyReportById(string EnergyReportId)
{
Model.SGGLDB db = Funs.DB;
Model.Environmental_EnergyReport table = db.Environmental_EnergyReport.FirstOrDefault(x => x.EnergyReportId == EnergyReportId);
if (table != null)
{
@@ -99,7 +99,7 @@ namespace BLL
{
return (from x in Funs.DB.Environmental_EnergyReportItem
where x.EnergyReportId == EnergyReportId
orderby x.SortIndex
orderby x.SortIndex,x.SortUnit
select x).ToList();
}
@@ -141,38 +141,39 @@ namespace BLL
{
var q = (from x in Funs.DB.Environmental_EnergyReportItem
where x.EnergyReportId == EnergyReportId
orderby x.SortIndex
orderby x.SortIndex,x.SortUnit
select x).ToList();
List<Model.Environmental_EnergyReportItem> newItems = new List<Model.Environmental_EnergyReportItem>();
foreach (var item in q)
{
Model.Environmental_EnergyReportItem newItem = new Model.Environmental_EnergyReportItem();
//List<Model.Environmental_EnergyReportItem> newItems = new List<Model.Environmental_EnergyReportItem>();
//foreach (var item in q)
//{
// Model.Environmental_EnergyReportItem newItem = new Model.Environmental_EnergyReportItem();
newItem.EnergyReportItemId = item.EnergyReportItemId;
newItem.EnergyReportId = item.EnergyReportId;
newItem.SortIndex = item.SortIndex;
newItem.BusinessCategory = item.BusinessCategory;
newItem.Throughput_BasePeriod = item.Throughput_BasePeriod;
newItem.Throughput_LastPeriod = item.Throughput_LastPeriod;
newItem.Throughput_ThisPeriod = item.Throughput_ThisPeriod;
newItem.Throughput_UnitOfMeasurement = item.Throughput_UnitOfMeasurement;
newItem.Yield_BasePeriod = item.Yield_BasePeriod;
newItem.Yield_LastPeriod = item.Yield_LastPeriod;
newItem.Yield_ThisPeriod = item.Yield_ThisPeriod;
newItem.Yield_UnitOfMeasurement = item.Yield_UnitOfMeasurement;
newItem.OutputValue_BasePeriod = item.OutputValue_BasePeriod;
newItem.OutputValue_LastYear = item.OutputValue_LastYear;
newItem.OutputValue_ThisYear = item.OutputValue_ThisYear;
newItem.OperationScale_BasePeriod = item.OperationScale_BasePeriod;
newItem.OperationScale_LastYear = item.OperationScale_LastYear;
newItem.OperationScale_ThisYear = item.OperationScale_ThisYear;
newItem.OperationScale_UnitOfMeasurement = item.OperationScale_UnitOfMeasurement;
newItem.ServiceOperatingIncome_BasePeriod = item.ServiceOperatingIncome_BasePeriod;
newItem.ServiceOperatingIncome_LastYear = item.ServiceOperatingIncome_LastYear;
newItem.ServiceOperatingIncome_ThisYear = item.ServiceOperatingIncome_ThisYear;
newItems.Add(newItem);
}
return newItems;
// newItem.EnergyReportItemId = item.EnergyReportItemId;
// newItem.EnergyReportId = item.EnergyReportId;
// newItem.SortIndex = item.SortIndex;
// newItem.BusinessCategory = item.BusinessCategory;
// newItem.Throughput_BasePeriod = item.Throughput_BasePeriod;
// newItem.Throughput_LastPeriod = item.Throughput_LastPeriod;
// newItem.Throughput_ThisPeriod = item.Throughput_ThisPeriod;
// newItem.Throughput_UnitOfMeasurement = item.Throughput_UnitOfMeasurement;
// newItem.Yield_BasePeriod = item.Yield_BasePeriod;
// newItem.Yield_LastPeriod = item.Yield_LastPeriod;
// newItem.Yield_ThisPeriod = item.Yield_ThisPeriod;
// newItem.Yield_UnitOfMeasurement = item.Yield_UnitOfMeasurement;
// newItem.OutputValue_BasePeriod = item.OutputValue_BasePeriod;
// newItem.OutputValue_LastYear = item.OutputValue_LastYear;
// newItem.OutputValue_ThisYear = item.OutputValue_ThisYear;
// newItem.OperationScale_BasePeriod = item.OperationScale_BasePeriod;
// newItem.OperationScale_LastYear = item.OperationScale_LastYear;
// newItem.OperationScale_ThisYear = item.OperationScale_ThisYear;
// newItem.OperationScale_UnitOfMeasurement = item.OperationScale_UnitOfMeasurement;
// newItem.ServiceOperatingIncome_BasePeriod = item.ServiceOperatingIncome_BasePeriod;
// newItem.ServiceOperatingIncome_LastYear = item.ServiceOperatingIncome_LastYear;
// newItem.ServiceOperatingIncome_ThisYear = item.ServiceOperatingIncome_ThisYear;
// newItems.Add(newItem);
//}
return q;
}
public static void AddEnvironmental_EnergyReportItem(Model.Environmental_EnergyReportItem newtable)
{
@@ -268,11 +269,12 @@ namespace BLL
}
public static void DeleteEnergyReportItemByChemicalReportId(string EnergyReportId)
{
Model.SGGLDB db = Funs.DB;
var q = from x in Funs.DB.Environmental_EnergyReportItem where x.EnergyReportId == EnergyReportId select x;
if (q != null)
{
Funs.DB.Environmental_EnergyReportItem.DeleteAllOnSubmit(q);
Funs.DB.SubmitChanges();
db.Environmental_EnergyReportItem.DeleteAllOnSubmit(q);
db.SubmitChanges();
}
}