2023-03-31 报表升级
This commit is contained in:
@@ -0,0 +1,307 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class ArchitectureReportItemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 建筑行业能源节约与生态环境保护汇总明细表
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportItemId">建筑行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>建筑行业能源节约与生态环境保护汇总明细表</returns>
|
||||
public static Model.Environmental_ArchitectureReportItem GetArchitectureReportItemByArchitectureReportItemId(string ArchitectureReportItemId)
|
||||
{
|
||||
return Funs.DB.Environmental_ArchitectureReportItem.FirstOrDefault(e => e.ArchitectureReportItemId == ArchitectureReportItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 建筑行业能源节约与生态环境保护汇总明细表
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportItemId">建筑行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>建筑行业能源节约与生态环境保护汇总明细表</returns>
|
||||
public static Model.Environmental_ArchitectureReportItem GetArchitectureReportItemByArchitectureReportIdAndTypeId(string ArchitectureReportId)
|
||||
{
|
||||
return Funs.DB.Environmental_ArchitectureReportItem.FirstOrDefault(e => e.ArchitectureReportId == ArchitectureReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id判断是否存在明细记录
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportItemId">企业安全数据统计月报表Id</param>
|
||||
/// <returns>是否存在明细记录</returns>
|
||||
public static bool IsExitItems(string ArchitectureReportId)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ArchitectureReportItem where x.ArchitectureReportId == ArchitectureReportId select x).Count() > 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportItemId">建筑行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Environmental_ArchitectureReportItem> GetItems(string ArchitectureReportId)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ArchitectureReportItem
|
||||
where x.ArchitectureReportId == ArchitectureReportId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportItemId">建筑行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Environmental_ArchitectureReportItem> GetYearSumItems(string unitId, int? year, int? Quarters)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ArchitectureReportItem
|
||||
join y in Funs.DB.Environmental_ArchitectureReport
|
||||
on x.ArchitectureReportId equals y.ArchitectureReportId
|
||||
where y.UnitId == unitId && y.Year == year && y.Quarters == Quarters
|
||||
orderby x.SortIndex
|
||||
select x).Distinct().ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取年度明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportItemId">建筑行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>年度明细记录集合</returns>
|
||||
public static List<Model.Environmental_ArchitectureReportItem> GetLastYearItems(int year)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ArchitectureReportItem
|
||||
join y in Funs.DB.Environmental_ArchitectureReport
|
||||
on x.ArchitectureReportId equals y.ArchitectureReportId
|
||||
where y.Year == year
|
||||
select x).Distinct().ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合(不包含本月合计行)
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportItemId">建筑行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.ArchitectureReportItem> GetShowItems(string ArchitectureReportId)
|
||||
{
|
||||
var q = (from x in Funs.DB.Environmental_ArchitectureReportItem
|
||||
where x.ArchitectureReportId == ArchitectureReportId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
List<Model.ArchitectureReportItem> newItems = new List<Model.ArchitectureReportItem>();
|
||||
var indexNames = GetIndexNames();
|
||||
var units = GetUnits();
|
||||
foreach (var item in q)
|
||||
{
|
||||
Model.ArchitectureReportItem newItem = new Model.ArchitectureReportItem();
|
||||
newItem.ArchitectureReportItemId = item.ArchitectureReportItemId;
|
||||
newItem.IndexName = indexNames.First(x => x.Value == item.SortIndex).Text;
|
||||
newItem.Unit = units.First(x => x.Value == item.SortIndex).Text;
|
||||
newItem.SortIndex = item.SortIndex;
|
||||
newItem.BaseNumber = item.BaseNumber;
|
||||
newItem.LastYearValue = item.LastYearValue;
|
||||
newItem.ThisYearValue = item.ThisYearValue;
|
||||
newItem.Rate = item.Rate;
|
||||
newItems.Add(newItem);
|
||||
}
|
||||
return newItems;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加建筑行业能源节约与生态环境保护汇总明细表
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportItem">建筑行业能源节约与生态环境保护汇总明细表实体</param>
|
||||
public static void AddArchitectureReportItem(Model.Environmental_ArchitectureReportItem ArchitectureReportItem)
|
||||
{
|
||||
Model.Environmental_ArchitectureReportItem newArchitectureReportItem = new Model.Environmental_ArchitectureReportItem
|
||||
{
|
||||
ArchitectureReportItemId = ArchitectureReportItem.ArchitectureReportItemId,
|
||||
ArchitectureReportId = ArchitectureReportItem.ArchitectureReportId,
|
||||
BaseNumber = ArchitectureReportItem.BaseNumber,
|
||||
SortIndex = ArchitectureReportItem.SortIndex,
|
||||
LastYearValue = ArchitectureReportItem.LastYearValue,
|
||||
ThisYearValue = ArchitectureReportItem.ThisYearValue,
|
||||
Rate = ArchitectureReportItem.Rate,
|
||||
};
|
||||
|
||||
Funs.DB.Environmental_ArchitectureReportItem.InsertOnSubmit(newArchitectureReportItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改建筑行业能源节约与生态环境保护汇总明细表
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportItem">建筑行业能源节约与生态环境保护汇总明细表实体</param>
|
||||
public static void UpdateArchitectureReportItem(Model.Environmental_ArchitectureReportItem ArchitectureReportItem)
|
||||
{
|
||||
Model.Environmental_ArchitectureReportItem newArchitectureReportItem = Funs.DB.Environmental_ArchitectureReportItem.FirstOrDefault(e => e.ArchitectureReportItemId == ArchitectureReportItem.ArchitectureReportItemId);
|
||||
newArchitectureReportItem.SortIndex = ArchitectureReportItem.SortIndex;
|
||||
newArchitectureReportItem.BaseNumber = ArchitectureReportItem.BaseNumber;
|
||||
newArchitectureReportItem.LastYearValue = ArchitectureReportItem.LastYearValue;
|
||||
newArchitectureReportItem.ThisYearValue = ArchitectureReportItem.ThisYearValue;
|
||||
newArchitectureReportItem.Rate = ArchitectureReportItem.Rate;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据Id删除所有数据
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportItemId"></param>
|
||||
public static void DeleteArchitectureReportItemByArchitectureReportId(string ArchitectureReportId)
|
||||
{
|
||||
var q = from x in Funs.DB.Environmental_ArchitectureReportItem where x.ArchitectureReportId == ArchitectureReportId select x;
|
||||
if (q != null)
|
||||
{
|
||||
Funs.DB.Environmental_ArchitectureReportItem.DeleteAllOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取指标名称集合
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetIndexNames()
|
||||
{
|
||||
ListItem[] list = new ListItem[61];
|
||||
list[0] = new ListItem("1.能源消费量", "01");
|
||||
list[1] = new ListItem("A其中:原煤(标准量)", "02");
|
||||
list[2] = new ListItem("B原煤(实物量)", "03");
|
||||
list[3] = new ListItem("C其中:发电用煤", "04");
|
||||
list[4] = new ListItem("B焦炭", "05");
|
||||
list[5] = new ListItem("B电力", "06");
|
||||
list[6] = new ListItem("B原油", "07");
|
||||
list[7] = new ListItem("B汽油", "08");
|
||||
list[8] = new ListItem("B煤油", "09");
|
||||
list[9] = new ListItem("B柴油", "10");
|
||||
list[10] = new ListItem("B燃料油", "11");
|
||||
list[11] = new ListItem("B天然气", "12");
|
||||
list[12] = new ListItem("B热力", "13");
|
||||
list[13] = new ListItem("B其他能源", "14");
|
||||
list[14] = new ListItem("2.万元营业收入综合能耗(现价)", "15");
|
||||
list[15] = new ListItem("A其中:营业收入(现价)", "16");
|
||||
list[16] = new ListItem("E万元营业收入综合能耗(可比价)", "17");
|
||||
list[17] = new ListItem("A其中:营业收入(可比价)", "18");
|
||||
list[18] = new ListItem("3.万元增加值综合能耗(现价)", "19");
|
||||
list[19] = new ListItem("A其中:增加值(现价)", "20");
|
||||
list[20] = new ListItem("E万元增加值综合能耗(可比价)", "21");
|
||||
list[21] = new ListItem("A其中:增加值(可比价)", "22");
|
||||
list[22] = new ListItem("4.万元营业收入用新水量(可比价)", "23");
|
||||
list[23] = new ListItem("A其中:用新水量", "24");
|
||||
list[24] = new ListItem("5.节能量", "25");
|
||||
list[25] = new ListItem("6.二氧化硫排放量", "26");
|
||||
list[26] = new ListItem("7.氮氧化物排放量", "27");
|
||||
list[27] = new ListItem("8.化学需氧量排放量", "28");
|
||||
list[28] = new ListItem("A其中:排入外环境", "29");
|
||||
list[29] = new ListItem("B排入市政管网或生活污水处理厂", "30");
|
||||
list[30] = new ListItem("9.氨氮排放量", "31");
|
||||
list[31] = new ListItem("A其中:排入外环境", "32");
|
||||
list[32] = new ListItem("B排入市政管网或生活污水处理厂", "33");
|
||||
list[33] = new ListItem("10.烟(粉)尘排放量", "34");
|
||||
list[34] = new ListItem("11.挥发性有机物排放量", "35");
|
||||
list[35] = new ListItem("12.废水排放量", "36");
|
||||
list[36] = new ListItem("13.万元收入二氧化碳排放(可比价)", "37");
|
||||
list[37] = new ListItem("A其中:二氧化碳排放量", "38");
|
||||
list[38] = new ListItem("14.一般固体废物综合利用率", "39");
|
||||
list[39] = new ListItem("A其中:一般固体废物综合利用量", "40");
|
||||
list[40] = new ListItem("B其中:综合利用往年贮存量", "41");
|
||||
list[41] = new ListItem("F一般固体废物产生量", "42");
|
||||
list[42] = new ListItem("15.危险废物处置率", "43");
|
||||
list[43] = new ListItem("A其中:危险废物处置量", "44");
|
||||
list[44] = new ListItem("B其中:处置往年贮存量", "45");
|
||||
list[45] = new ListItem("F危险废物产生量", "46");
|
||||
list[46] = new ListItem("16.土壤污染治理率", "47");
|
||||
list[47] = new ListItem("A其中:土壤污染治理面积", "48");
|
||||
list[48] = new ListItem("B土壤污染需要治理面积", "49");
|
||||
list[49] = new ListItem("17.矿山(或生态)修复治理率", "50");
|
||||
list[50] = new ListItem("A其中:矿山(或生态)修复治理面积", "51");
|
||||
list[51] = new ListItem("B矿山(或生态)需要修复治理面积", "52");
|
||||
list[52] = new ListItem("18.废气治理设施数", "53");
|
||||
list[53] = new ListItem("19.废气治理设施处理能力", "54");
|
||||
list[54] = new ListItem("20.废水治理设施数", "55");
|
||||
list[55] = new ListItem("21.废水治理设施处理能力", "56");
|
||||
list[56] = new ListItem("22.生态环境污染源", "57");
|
||||
list[57] = new ListItem("23.生态环境风险点", "58");
|
||||
list[58] = new ListItem("24.节能环保投入占收入比重", "59");
|
||||
list[59] = new ListItem("A其中:节能投入", "60");
|
||||
list[60] = new ListItem("B环保投入", "61");
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取计量单位集合
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetUnits()
|
||||
{
|
||||
ListItem[] list = new ListItem[61];
|
||||
list[0] = new ListItem("万吨标准煤", "01");
|
||||
list[1] = new ListItem("万吨标准煤", "02");
|
||||
list[2] = new ListItem("万吨", "03");
|
||||
list[3] = new ListItem("万吨", "04");
|
||||
list[4] = new ListItem("吨", "05");
|
||||
list[5] = new ListItem("万千瓦时", "06");
|
||||
list[6] = new ListItem("吨", "07");
|
||||
list[7] = new ListItem("吨", "08");
|
||||
list[8] = new ListItem("吨", "09");
|
||||
list[9] = new ListItem("吨", "10");
|
||||
list[10] = new ListItem("吨", "11");
|
||||
list[11] = new ListItem("万立方米", "12");
|
||||
list[12] = new ListItem("百万千焦", "13");
|
||||
list[13] = new ListItem("吨标准煤", "14");
|
||||
list[14] = new ListItem("吨标准煤/万元", "15");
|
||||
list[15] = new ListItem("万元", "16");
|
||||
list[16] = new ListItem("吨标准煤/万元", "17");
|
||||
list[17] = new ListItem("万元", "18");
|
||||
list[18] = new ListItem("吨标准煤/万元", "19");
|
||||
list[19] = new ListItem("万元", "20");
|
||||
list[20] = new ListItem("吨标准煤/万元", "21");
|
||||
list[21] = new ListItem("万元", "22");
|
||||
list[22] = new ListItem("吨/万元", "23");
|
||||
list[23] = new ListItem("万吨", "24");
|
||||
list[24] = new ListItem("吨标准煤", "25");
|
||||
list[25] = new ListItem("吨", "26");
|
||||
list[26] = new ListItem("吨", "27");
|
||||
list[27] = new ListItem("吨", "28");
|
||||
list[28] = new ListItem("吨", "29");
|
||||
list[29] = new ListItem("吨", "30");
|
||||
list[30] = new ListItem("吨", "31");
|
||||
list[31] = new ListItem("吨", "32");
|
||||
list[32] = new ListItem("吨", "33");
|
||||
list[33] = new ListItem("吨", "34");
|
||||
list[34] = new ListItem("吨", "35");
|
||||
list[35] = new ListItem("万吨", "36");
|
||||
list[36] = new ListItem("吨二氧化碳当量/万元", "37");
|
||||
list[37] = new ListItem("万吨二氧化碳当量", "38");
|
||||
list[38] = new ListItem("%", "39");
|
||||
list[39] = new ListItem("万吨", "40");
|
||||
list[40] = new ListItem("万吨", "41");
|
||||
list[41] = new ListItem("万吨", "42");
|
||||
list[42] = new ListItem("%", "43");
|
||||
list[43] = new ListItem("万吨", "44");
|
||||
list[44] = new ListItem("万吨", "45");
|
||||
list[45] = new ListItem("万吨", "46");
|
||||
list[46] = new ListItem("%", "47");
|
||||
list[47] = new ListItem("公顷", "48");
|
||||
list[48] = new ListItem("公顷", "49");
|
||||
list[49] = new ListItem("%", "50");
|
||||
list[50] = new ListItem("公顷", "51");
|
||||
list[51] = new ListItem("公顷", "52");
|
||||
list[52] = new ListItem("套", "53");
|
||||
list[53] = new ListItem("万立方米/年", "54");
|
||||
list[54] = new ListItem("套", "55");
|
||||
list[55] = new ListItem("万吨/年", "56");
|
||||
list[56] = new ListItem("个", "57");
|
||||
list[57] = new ListItem("个", "58");
|
||||
list[58] = new ListItem("%", "59");
|
||||
list[59] = new ListItem("万元", "60");
|
||||
list[60] = new ListItem("万元", "61");
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class ArchitectureReportService
|
||||
{
|
||||
/// <summary>
|
||||
/// 建筑行业能源节约与生态环境保护汇总表
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportId">建筑行业能源节约与生态环境保护汇总表Id</param>
|
||||
/// <returns>建筑行业能源节约与生态环境保护汇总表</returns>
|
||||
public static Model.Environmental_ArchitectureReport GetArchitectureReportByArchitectureReportId(string ArchitectureReportId)
|
||||
{
|
||||
return Funs.DB.Environmental_ArchitectureReport.FirstOrDefault(e => e.ArchitectureReportId == ArchitectureReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 建筑行业能源节约与生态环境保护汇总表
|
||||
/// </summary>
|
||||
/// <param name="unitId">单位Id</param>
|
||||
/// <param name = "year" > 年度 </ param >
|
||||
/// <param name="month">月份</param>
|
||||
/// <returns>建筑行业能源节约与生态环境保护汇总表</returns>
|
||||
public static Model.Environmental_ArchitectureReport GetArchitectureReportByUnitIdAndYearAndQuarters(string unitId, int year, int Quarters)
|
||||
{
|
||||
return Funs.DB.Environmental_ArchitectureReport.FirstOrDefault(e => e.UnitId == unitId && e.Quarters == Quarters && e.Year == year);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位Id获取建筑行业能源节约与生态环境保护汇总表集合
|
||||
/// </summary>
|
||||
/// <param name="UnitId">单位Id</param>
|
||||
/// <returns>建筑行业能源节约与生态环境保护汇总表集合</returns>
|
||||
public static List<Model.View_Environmental_ArchitectureReport> GetArchitectureReportsByUnitId(string UnitId)
|
||||
{
|
||||
return (from x in Funs.DB.View_Environmental_ArchitectureReport where x.UnitId == UnitId orderby x.FillingDate descending select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加建筑行业能源节约与生态环境保护汇总表
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReport">建筑行业能源节约与生态环境保护汇总表实体</param>
|
||||
public static void AddArchitectureReport(Model.Environmental_ArchitectureReport ArchitectureReport)
|
||||
{
|
||||
Model.Environmental_ArchitectureReport newArchitectureReport = new Model.Environmental_ArchitectureReport
|
||||
{
|
||||
ArchitectureReportId = ArchitectureReport.ArchitectureReportId,
|
||||
Year = ArchitectureReport.Year,
|
||||
Quarters = ArchitectureReport.Quarters,
|
||||
UnitId = ArchitectureReport.UnitId,
|
||||
FillingDate = ArchitectureReport.FillingDate,
|
||||
DutyPerson = ArchitectureReport.DutyPerson,
|
||||
FillingMan = ArchitectureReport.FillingMan,
|
||||
UpState = ArchitectureReport.UpState,
|
||||
};
|
||||
|
||||
Funs.DB.Environmental_ArchitectureReport.InsertOnSubmit(newArchitectureReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改建筑行业能源节约与生态环境保护汇总表
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReport">建筑行业能源节约与生态环境保护汇总表实体</param>
|
||||
public static void UpdateArchitectureReport(Model.Environmental_ArchitectureReport ArchitectureReport)
|
||||
{
|
||||
Model.Environmental_ArchitectureReport newArchitectureReport = Funs.DB.Environmental_ArchitectureReport.FirstOrDefault(e => e.ArchitectureReportId == ArchitectureReport.ArchitectureReportId);
|
||||
if (newArchitectureReport != null)
|
||||
{
|
||||
newArchitectureReport.Year = ArchitectureReport.Year;
|
||||
newArchitectureReport.Quarters = ArchitectureReport.Quarters;
|
||||
newArchitectureReport.UnitId = ArchitectureReport.UnitId;
|
||||
newArchitectureReport.FillingDate = ArchitectureReport.FillingDate;
|
||||
newArchitectureReport.DutyPerson = ArchitectureReport.DutyPerson;
|
||||
newArchitectureReport.UpState = ArchitectureReport.UpState;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据Id获取数据
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportId"></param>
|
||||
public static void DeleteArchitectureReportByArchitectureReportId(string ArchitectureReportId)
|
||||
{
|
||||
Model.Environmental_ArchitectureReport newArchitectureReport = Funs.DB.Environmental_ArchitectureReport.FirstOrDefault(e => e.ArchitectureReportId == ArchitectureReportId);
|
||||
if (newArchitectureReport != null)
|
||||
{
|
||||
Funs.DB.Environmental_ArchitectureReport.DeleteOnSubmit(newArchitectureReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据报表单位,报表时间判断是否存在
|
||||
/// </summary>
|
||||
/// <param name="Id">Id</param>
|
||||
/// <returns></returns>
|
||||
public static Model.Environmental_ArchitectureReport GetArchitectureReportByUnitIdDate(string unitId, int year, int Quarters)
|
||||
{
|
||||
return Funs.DB.Environmental_ArchitectureReport.FirstOrDefault(e => e.UnitId == unitId && e.Year == year && e.Quarters == Quarters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据报表单位,报表年份获取对应集合
|
||||
/// </summary>
|
||||
/// <param name="Id">Id</param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Environmental_ArchitectureReport> GetArchitectureReportByUnitIdYear(string unitId, int year)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ArchitectureReport where x.UnitId == unitId && x.Year == year select x).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,383 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class ChemicalReportItemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 化工行业能源节约与生态环境保护汇总明细表
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId">化工行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>化工行业能源节约与生态环境保护汇总明细表</returns>
|
||||
public static Model.Environmental_ChemicalReportItem GetChemicalReportItemByChemicalReportItemId(string ChemicalReportItemId)
|
||||
{
|
||||
return Funs.DB.Environmental_ChemicalReportItem.FirstOrDefault(e => e.ChemicalReportItemId == ChemicalReportItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 化工行业能源节约与生态环境保护汇总明细表
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId">化工行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>化工行业能源节约与生态环境保护汇总明细表</returns>
|
||||
public static Model.Environmental_ChemicalReportItem GetChemicalReportItemByChemicalReportIdAndTypeId(string ChemicalReportId)
|
||||
{
|
||||
return Funs.DB.Environmental_ChemicalReportItem.FirstOrDefault(e => e.ChemicalReportId == ChemicalReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id判断是否存在明细记录
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId">企业安全数据统计月报表Id</param>
|
||||
/// <returns>是否存在明细记录</returns>
|
||||
public static bool IsExitItems(string ChemicalReportId)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ChemicalReportItem where x.ChemicalReportId == ChemicalReportId select x).Count() > 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId">化工行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Environmental_ChemicalReportItem> GetItems(string ChemicalReportId)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ChemicalReportItem
|
||||
where x.ChemicalReportId == ChemicalReportId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId">化工行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Environmental_ChemicalReportItem> GetYearSumItems(string unitId, int? year, int? month)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ChemicalReportItem
|
||||
join y in Funs.DB.Environmental_ChemicalReport
|
||||
on x.ChemicalReportId equals y.ChemicalReportId
|
||||
where y.UnitId == unitId && y.Year == year && y.Month == month
|
||||
orderby x.SortIndex
|
||||
select x).Distinct().ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取年度明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId">化工行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>年度明细记录集合</returns>
|
||||
public static List<Model.Environmental_ChemicalReportItem> GetLastYearItems(int year)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ChemicalReportItem
|
||||
join y in Funs.DB.Environmental_ChemicalReport
|
||||
on x.ChemicalReportId equals y.ChemicalReportId
|
||||
where y.Year == year
|
||||
select x).Distinct().ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合(不包含本月合计行)
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId">化工行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.ChemicalReportItem> GetShowItems(string ChemicalReportId)
|
||||
{
|
||||
var q = (from x in Funs.DB.Environmental_ChemicalReportItem
|
||||
where x.ChemicalReportId == ChemicalReportId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
List<Model.ChemicalReportItem> newItems = new List<Model.ChemicalReportItem>();
|
||||
var indexNames = GetIndexNames();
|
||||
var units = GetUnits();
|
||||
foreach (var item in q)
|
||||
{
|
||||
Model.ChemicalReportItem newItem = new Model.ChemicalReportItem();
|
||||
newItem.ChemicalReportItemId = item.ChemicalReportItemId;
|
||||
newItem.IndexName = indexNames.First(x => x.Value == item.SortIndex).Text;
|
||||
newItem.Unit = units.First(x => x.Value == item.SortIndex).Text;
|
||||
newItem.SortIndex = item.SortIndex;
|
||||
newItem.BaseNumber = item.BaseNumber;
|
||||
newItem.LastYearValue = item.LastYearValue;
|
||||
newItem.ThisYearValue = item.ThisYearValue;
|
||||
newItem.Rate = item.Rate;
|
||||
newItems.Add(newItem);
|
||||
}
|
||||
return newItems;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加化工行业能源节约与生态环境保护汇总明细表
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItem">化工行业能源节约与生态环境保护汇总明细表实体</param>
|
||||
public static void AddChemicalReportItem(Model.Environmental_ChemicalReportItem ChemicalReportItem)
|
||||
{
|
||||
Model.Environmental_ChemicalReportItem newChemicalReportItem = new Model.Environmental_ChemicalReportItem
|
||||
{
|
||||
ChemicalReportItemId = ChemicalReportItem.ChemicalReportItemId,
|
||||
ChemicalReportId = ChemicalReportItem.ChemicalReportId,
|
||||
SortIndex = ChemicalReportItem.SortIndex,
|
||||
BaseNumber = ChemicalReportItem.BaseNumber,
|
||||
LastYearValue = ChemicalReportItem.LastYearValue,
|
||||
ThisYearValue = ChemicalReportItem.ThisYearValue,
|
||||
Rate = ChemicalReportItem.Rate,
|
||||
};
|
||||
|
||||
Funs.DB.Environmental_ChemicalReportItem.InsertOnSubmit(newChemicalReportItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改化工行业能源节约与生态环境保护汇总明细表
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItem">化工行业能源节约与生态环境保护汇总明细表实体</param>
|
||||
public static void UpdateChemicalReportItem(Model.Environmental_ChemicalReportItem ChemicalReportItem)
|
||||
{
|
||||
Model.Environmental_ChemicalReportItem newChemicalReportItem = Funs.DB.Environmental_ChemicalReportItem.FirstOrDefault(e => e.ChemicalReportItemId == ChemicalReportItem.ChemicalReportItemId);
|
||||
newChemicalReportItem.SortIndex = ChemicalReportItem.SortIndex;
|
||||
newChemicalReportItem.BaseNumber = ChemicalReportItem.BaseNumber;
|
||||
newChemicalReportItem.LastYearValue = ChemicalReportItem.LastYearValue;
|
||||
newChemicalReportItem.ThisYearValue = ChemicalReportItem.ThisYearValue;
|
||||
newChemicalReportItem.Rate = ChemicalReportItem.Rate;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据Id删除所有数据
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId"></param>
|
||||
public static void DeleteChemicalReportItemByChemicalReportId(string ChemicalReportId)
|
||||
{
|
||||
var q = from x in Funs.DB.Environmental_ChemicalReportItem where x.ChemicalReportId == ChemicalReportId select x;
|
||||
if (q != null)
|
||||
{
|
||||
Funs.DB.Environmental_ChemicalReportItem.DeleteAllOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取指标名称集合
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetIndexNames()
|
||||
{
|
||||
ListItem[] list = new ListItem[99];
|
||||
list[0] = new ListItem("1.能源消费量", "01");
|
||||
list[1] = new ListItem("A含:综合能源消费量", "02");
|
||||
list[2] = new ListItem("A其中:原煤(标准量)", "03");
|
||||
list[3] = new ListItem("B原煤(实物量)", "04");
|
||||
list[4] = new ListItem("C其中:发电用煤", "05");
|
||||
list[5] = new ListItem("B焦炭", "06");
|
||||
list[6] = new ListItem("B电力", "07");
|
||||
list[7] = new ListItem("B原油", "08");
|
||||
list[8] = new ListItem("B汽油", "09");
|
||||
list[9] = new ListItem("B煤油", "10");
|
||||
list[10] = new ListItem("B柴油", "11");
|
||||
list[11] = new ListItem("B燃料油", "12");
|
||||
list[12] = new ListItem("B天然气", "13");
|
||||
list[13] = new ListItem("B热力", "14");
|
||||
list[14] = new ListItem("B其他能源", "15");
|
||||
list[15] = new ListItem("2.万元产值综合能耗(现价)", "16");
|
||||
list[16] = new ListItem("A其中:工业总产值(现价)", "17");
|
||||
list[17] = new ListItem("E万元产值综合能耗(可比价)", "18");
|
||||
list[18] = new ListItem("A其中:工业总产值(可比价)", "19");
|
||||
list[19] = new ListItem("3.万元增加值综合能耗(现价)", "20");
|
||||
list[20] = new ListItem("A其中:增加值(现价)", "21");
|
||||
list[21] = new ListItem("E万元增加值综合能耗(可比价)", "22");
|
||||
list[22] = new ListItem("A其中:增加值(可比价)", "23");
|
||||
list[23] = new ListItem("4.万元产值用新水量(可比价)", "24");
|
||||
list[24] = new ListItem("A其中:用新水量", "25");
|
||||
list[25] = new ListItem("E重复用水率", "26");
|
||||
list[26] = new ListItem("A其中:重复用水量", "27");
|
||||
list[27] = new ListItem("5.单位乙烯能耗", "28");
|
||||
list[28] = new ListItem("A其中:乙烯装置能耗", "29");
|
||||
list[29] = new ListItem("B乙烯装置合格乙烯产品产量", "30");
|
||||
list[30] = new ListItem("6.合成氨单位产品综合能耗", "31");
|
||||
list[31] = new ListItem("A其中:合成氨综合能耗", "32");
|
||||
list[32] = new ListItem("B合成氨产量", "33");
|
||||
list[33] = new ListItem("7.节能量", "34");
|
||||
list[34] = new ListItem("8.电煤占煤炭消费比重", "35");
|
||||
list[35] = new ListItem("9.余热余能回收利用率", "36");
|
||||
list[36] = new ListItem("A其中:回收利用的余热余能", "37");
|
||||
list[37] = new ListItem("10.自备电厂发电装机容量", "38");
|
||||
list[38] = new ListItem("A其中:燃煤发电", "39");
|
||||
list[39] = new ListItem("C其中:燃煤热电", "40");
|
||||
list[40] = new ListItem("B清洁能源发电", "41");
|
||||
list[41] = new ListItem("C其中:天然气发电", "42");
|
||||
list[42] = new ListItem("D核能发电", "43");
|
||||
list[43] = new ListItem("D水力发电", "44");
|
||||
list[44] = new ListItem("D风力发电", "45");
|
||||
list[45] = new ListItem("D太阳能发电", "46");
|
||||
list[46] = new ListItem("D其他清洁能源发电", "47");
|
||||
list[47] = new ListItem("B生物质发电", "48");
|
||||
list[48] = new ListItem("B其他发电", "49");
|
||||
list[49] = new ListItem("11.燃煤热电机组装机容量占燃煤发电装机容量比重", "50");
|
||||
list[50] = new ListItem("12.自备电厂发电量", "51");
|
||||
list[51] = new ListItem("13.排污许可证许可的二氧化硫排放量", "52");
|
||||
list[52] = new ListItem("14.排污许可证许可的氮氧化物排放量", "53");
|
||||
list[53] = new ListItem("15.排污许可证许可的化学需氧量排放量", "54");
|
||||
list[54] = new ListItem("16.排污许可证许可的氨氮排放量", "55");
|
||||
list[55] = new ListItem("17.排污许可证许可的烟(粉)尘排放量", "56");
|
||||
list[56] = new ListItem("18.排污许可证许可的挥发性有机物排放量", "57");
|
||||
list[57] = new ListItem("19.二氧化硫排放量", "58");
|
||||
list[58] = new ListItem("20.氮氧化物排放量", "59");
|
||||
list[59] = new ListItem("21.化学需氧量排放量", "60");
|
||||
list[60] = new ListItem("A其中:排入外环境", "61");
|
||||
list[61] = new ListItem("B排入市政管网或生活污水处理厂", "62");
|
||||
list[62] = new ListItem("22.氨氮排放量", "63");
|
||||
list[63] = new ListItem("A其中:排入外环境", "64");
|
||||
list[64] = new ListItem("B排入市政管网或生活污水处理厂", "65");
|
||||
list[65] = new ListItem("23.烟(粉)尘排放量", "66");
|
||||
list[66] = new ListItem("24.挥发性有机物排放量", "67");
|
||||
list[67] = new ListItem("25.废水排放量", "68");
|
||||
list[68] = new ListItem("26.万元产值二氧化碳排放(可比价)", "69");
|
||||
list[69] = new ListItem("A其中:二氧化碳排放量", "70");
|
||||
list[70] = new ListItem("27.一般固体废物综合利用率", "71");
|
||||
list[71] = new ListItem("A其中:一般固体废物综合利用量", "72");
|
||||
list[72] = new ListItem("C其中:综合利用往年贮存量", "73");
|
||||
list[73] = new ListItem("F一般固体废物产生量", "74");
|
||||
list[74] = new ListItem("28.危险废物处置率", "75");
|
||||
list[75] = new ListItem("A其中:危险废物处置量", "76");
|
||||
list[76] = new ListItem("C其中:处置往年贮存量", "77");
|
||||
list[77] = new ListItem("F危险废物产生量", "78");
|
||||
list[78] = new ListItem("29.土壤污染治理率", "79");
|
||||
list[79] = new ListItem("A其中:土壤污染治理面积", "80");
|
||||
list[80] = new ListItem("B土壤污染需要治理面积", "81");
|
||||
list[81] = new ListItem("30.矿山(或生态)修复治理率", "82");
|
||||
list[82] = new ListItem("A其中:矿山(或生态)修复治理面积", "83");
|
||||
list[83] = new ListItem("B矿山(或生态)需要修复治理面积", "84");
|
||||
list[84] = new ListItem("31.烟气脱硫机组装机容量占燃煤发电机组的比例", "85");
|
||||
list[85] = new ListItem("A其中:配备烟气脱硫装置的机组装机容量", "86");
|
||||
list[86] = new ListItem("32.烟气脱硝机组装机容量占燃煤发电机组的比例", "87");
|
||||
list[87] = new ListItem("A其中:配备烟气脱硝装置的机组装机容量", "88");
|
||||
list[88] = new ListItem("33.超低排放限值的机组装机容量占燃煤发电机组的比例", "89");
|
||||
list[89] = new ListItem("A其中:执行超低排放限值的机组装机容量", "90");
|
||||
list[90] = new ListItem("34.废气治理设施数", "91");
|
||||
list[91] = new ListItem("35.废气治理设施处理能力", "92");
|
||||
list[92] = new ListItem("36.废水治理设施数", "93");
|
||||
list[93] = new ListItem("37.废水治理设施处理能力", "94");
|
||||
list[94] = new ListItem("38.生态环境污染源", "95");
|
||||
list[95] = new ListItem("39.生态环境风险点", "96");
|
||||
list[96] = new ListItem("40.节能环保投入占产值比重", "97");
|
||||
list[97] = new ListItem("A其中:节能投入", "98");
|
||||
list[98] = new ListItem("B环保投入", "99");
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取计量单位集合
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetUnits()
|
||||
{
|
||||
ListItem[] list = new ListItem[99];
|
||||
list[0] = new ListItem("万吨标准煤", "01");
|
||||
list[1] = new ListItem("万吨标准煤", "02");
|
||||
list[2] = new ListItem("万吨标准煤", "03");
|
||||
list[3] = new ListItem("万吨", "04");
|
||||
list[4] = new ListItem("万吨", "05");
|
||||
list[5] = new ListItem("吨", "06");
|
||||
list[6] = new ListItem("万千瓦时", "07");
|
||||
list[7] = new ListItem("吨", "08");
|
||||
list[8] = new ListItem("吨", "09");
|
||||
list[9] = new ListItem("吨", "10");
|
||||
list[10] = new ListItem("吨", "11");
|
||||
list[11] = new ListItem("吨", "12");
|
||||
list[12] = new ListItem("万立方米", "13");
|
||||
list[13] = new ListItem("百万千焦", "14");
|
||||
list[14] = new ListItem("吨标准煤", "15");
|
||||
list[15] = new ListItem("吨标准煤/万元", "16");
|
||||
list[16] = new ListItem("万元", "17");
|
||||
list[17] = new ListItem("吨标准煤/万元", "18");
|
||||
list[18] = new ListItem("万元", "19");
|
||||
list[19] = new ListItem("吨标准煤/万元", "20");
|
||||
list[20] = new ListItem("万元", "21");
|
||||
list[21] = new ListItem("吨标准煤/万元", "22");
|
||||
list[22] = new ListItem("万元", "23");
|
||||
list[23] = new ListItem("吨/万元", "24");
|
||||
list[24] = new ListItem("万吨", "25");
|
||||
list[25] = new ListItem("%", "26");
|
||||
list[26] = new ListItem("万吨", "27");
|
||||
list[27] = new ListItem("千克标准油/吨", "28");
|
||||
list[28] = new ListItem("千克标准油", "29");
|
||||
list[29] = new ListItem("吨", "30");
|
||||
list[30] = new ListItem("千克标准煤/吨", "31");
|
||||
list[31] = new ListItem("吨标准煤", "32");
|
||||
list[32] = new ListItem("吨", "33");
|
||||
list[33] = new ListItem("吨标准煤", "34");
|
||||
list[34] = new ListItem("%", "35");
|
||||
list[35] = new ListItem("%", "36");
|
||||
list[36] = new ListItem("百万千焦", "37");
|
||||
list[37] = new ListItem("万千瓦", "38");
|
||||
list[38] = new ListItem("万千瓦", "39");
|
||||
list[39] = new ListItem("万千瓦", "40");
|
||||
list[40] = new ListItem("万千瓦", "41");
|
||||
list[41] = new ListItem("万千瓦", "42");
|
||||
list[42] = new ListItem("万千瓦", "43");
|
||||
list[43] = new ListItem("万千瓦", "44");
|
||||
list[44] = new ListItem("万千瓦", "45");
|
||||
list[45] = new ListItem("万千瓦", "46");
|
||||
list[46] = new ListItem("万千瓦", "47");
|
||||
list[47] = new ListItem("万千瓦", "48");
|
||||
list[48] = new ListItem("万千瓦", "49");
|
||||
list[49] = new ListItem("%", "50");
|
||||
list[50] = new ListItem("万千瓦时", "51");
|
||||
list[51] = new ListItem("吨", "52");
|
||||
list[52] = new ListItem("吨", "53");
|
||||
list[53] = new ListItem("吨", "54");
|
||||
list[54] = new ListItem("吨", "55");
|
||||
list[55] = new ListItem("吨", "56");
|
||||
list[56] = new ListItem("吨", "57");
|
||||
list[57] = new ListItem("吨", "58");
|
||||
list[58] = new ListItem("吨", "59");
|
||||
list[59] = new ListItem("吨", "60");
|
||||
list[60] = new ListItem("吨", "61");
|
||||
list[61] = new ListItem("吨", "62");
|
||||
list[62] = new ListItem("吨", "63");
|
||||
list[63] = new ListItem("吨", "64");
|
||||
list[64] = new ListItem("吨", "65");
|
||||
list[65] = new ListItem("吨", "66");
|
||||
list[66] = new ListItem("吨", "67");
|
||||
list[67] = new ListItem("万吨", "68");
|
||||
list[68] = new ListItem("吨二氧化碳当量/万元", "69");
|
||||
list[69] = new ListItem("万吨二氧化碳当量", "70");
|
||||
list[70] = new ListItem("%", "71");
|
||||
list[71] = new ListItem("万吨", "72");
|
||||
list[72] = new ListItem("万吨", "73");
|
||||
list[73] = new ListItem("万吨", "74");
|
||||
list[74] = new ListItem("%", "75");
|
||||
list[75] = new ListItem("万吨", "76");
|
||||
list[76] = new ListItem("万吨", "77");
|
||||
list[77] = new ListItem("万吨", "78");
|
||||
list[78] = new ListItem("%", "79");
|
||||
list[79] = new ListItem("公顷", "80");
|
||||
list[80] = new ListItem("公顷", "81");
|
||||
list[81] = new ListItem("%", "82");
|
||||
list[82] = new ListItem("公顷", "83");
|
||||
list[83] = new ListItem("公顷", "84");
|
||||
list[84] = new ListItem("%", "85");
|
||||
list[85] = new ListItem("万千瓦", "86");
|
||||
list[86] = new ListItem("%", "87");
|
||||
list[87] = new ListItem("万千瓦", "88");
|
||||
list[88] = new ListItem("%", "89");
|
||||
list[89] = new ListItem("万千瓦", "90");
|
||||
list[90] = new ListItem("套", "91");
|
||||
list[91] = new ListItem("万立方米/年", "92");
|
||||
list[92] = new ListItem("套", "93");
|
||||
list[93] = new ListItem("万吨/年", "94");
|
||||
list[94] = new ListItem("个", "95");
|
||||
list[95] = new ListItem("个", "96");
|
||||
list[96] = new ListItem("%", "97");
|
||||
list[97] = new ListItem("万元", "98");
|
||||
list[98] = new ListItem("万元", "99");
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class ChemicalReportService
|
||||
{
|
||||
/// <summary>
|
||||
/// 化工行业能源节约与生态环境保护汇总表
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportId">化工行业能源节约与生态环境保护汇总表Id</param>
|
||||
/// <returns>化工行业能源节约与生态环境保护汇总表</returns>
|
||||
public static Model.Environmental_ChemicalReport GetChemicalReportByChemicalReportId(string ChemicalReportId)
|
||||
{
|
||||
return Funs.DB.Environmental_ChemicalReport.FirstOrDefault(e => e.ChemicalReportId == ChemicalReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 化工行业能源节约与生态环境保护汇总表
|
||||
/// </summary>
|
||||
/// <param name="unitId">单位Id</param>
|
||||
/// <param name = "year" > 年度 </ param >
|
||||
/// <param name="month">月份</param>
|
||||
/// <returns>化工行业能源节约与生态环境保护汇总表</returns>
|
||||
public static Model.Environmental_ChemicalReport GetChemicalReportByUnitIdAndYearAndMonth(string unitId, int year, int month)
|
||||
{
|
||||
return Funs.DB.Environmental_ChemicalReport.FirstOrDefault(e => e.UnitId == unitId && e.Month == month && e.Year == year);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位Id获取化工行业能源节约与生态环境保护汇总表集合
|
||||
/// </summary>
|
||||
/// <param name="UnitId">单位Id</param>
|
||||
/// <returns>化工行业能源节约与生态环境保护汇总表集合</returns>
|
||||
public static List<Model.View_Environmental_ChemicalReport> GetChemicalReportsByUnitId(string UnitId)
|
||||
{
|
||||
return (from x in Funs.DB.View_Environmental_ChemicalReport where x.UnitId == UnitId orderby x.FillingDate descending select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加化工行业能源节约与生态环境保护汇总表
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReport">化工行业能源节约与生态环境保护汇总表实体</param>
|
||||
public static void AddChemicalReport(Model.Environmental_ChemicalReport ChemicalReport)
|
||||
{
|
||||
Model.Environmental_ChemicalReport newChemicalReport = new Model.Environmental_ChemicalReport
|
||||
{
|
||||
ChemicalReportId = ChemicalReport.ChemicalReportId,
|
||||
Year = ChemicalReport.Year,
|
||||
Month = ChemicalReport.Month,
|
||||
UnitId = ChemicalReport.UnitId,
|
||||
FillingDate = ChemicalReport.FillingDate,
|
||||
DutyPerson = ChemicalReport.DutyPerson,
|
||||
FillingMan = ChemicalReport.FillingMan,
|
||||
UpState = ChemicalReport.UpState,
|
||||
};
|
||||
|
||||
Funs.DB.Environmental_ChemicalReport.InsertOnSubmit(newChemicalReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改化工行业能源节约与生态环境保护汇总表
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReport">化工行业能源节约与生态环境保护汇总表实体</param>
|
||||
public static void UpdateChemicalReport(Model.Environmental_ChemicalReport ChemicalReport)
|
||||
{
|
||||
Model.Environmental_ChemicalReport newChemicalReport = Funs.DB.Environmental_ChemicalReport.FirstOrDefault(e => e.ChemicalReportId == ChemicalReport.ChemicalReportId);
|
||||
if (newChemicalReport != null)
|
||||
{
|
||||
newChemicalReport.Year = ChemicalReport.Year;
|
||||
newChemicalReport.Month = ChemicalReport.Month;
|
||||
newChemicalReport.UnitId = ChemicalReport.UnitId;
|
||||
newChemicalReport.FillingDate = ChemicalReport.FillingDate;
|
||||
newChemicalReport.DutyPerson = ChemicalReport.DutyPerson;
|
||||
newChemicalReport.UpState = ChemicalReport.UpState;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据Id获取数据
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportId"></param>
|
||||
public static void DeleteChemicalReportByChemicalReportId(string ChemicalReportId)
|
||||
{
|
||||
Model.Environmental_ChemicalReport newChemicalReport = Funs.DB.Environmental_ChemicalReport.FirstOrDefault(e => e.ChemicalReportId == ChemicalReportId);
|
||||
if (newChemicalReport != null)
|
||||
{
|
||||
Funs.DB.Environmental_ChemicalReport.DeleteOnSubmit(newChemicalReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据报表单位,报表时间判断是否存在
|
||||
/// </summary>
|
||||
/// <param name="Id">Id</param>
|
||||
/// <returns></returns>
|
||||
public static Model.Environmental_ChemicalReport GetChemicalReportByUnitIdDate(string unitId, int year, int Month)
|
||||
{
|
||||
return Funs.DB.Environmental_ChemicalReport.FirstOrDefault(e => e.UnitId == unitId && e.Year == year && e.Month == Month);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据报表单位,报表年份获取对应集合
|
||||
/// </summary>
|
||||
/// <param name="Id">Id</param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Environmental_ChemicalReport> GetChemicalReportByUnitIdYear(string unitId, int year)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ChemicalReport where x.UnitId == unitId && x.Year == year select x).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,165 @@
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class EnergyReportService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.Environmental_EnergyReport> GetEnvironmental_EnergyReportByModle(Model.Environmental_EnergyReport table)
|
||||
{
|
||||
var q = from x in db.Environmental_EnergyReport
|
||||
where
|
||||
(string.IsNullOrEmpty(table.EnergyReportId) || x.EnergyReportId.Contains(table.EnergyReportId)) &&
|
||||
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
|
||||
(string.IsNullOrEmpty(table.FillingMan) || x.FillingMan.Contains(table.FillingMan)) &&
|
||||
(string.IsNullOrEmpty(table.DutyPerson) || x.DutyPerson.Contains(table.DutyPerson)) &&
|
||||
(string.IsNullOrEmpty(table.UpState) || x.UpState.Contains(table.UpState))
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
}
|
||||
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="PageIndex">页码</param>
|
||||
/// <param name="PageSize">每页数量</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(Model.Environmental_EnergyReport table, Grid Grid1)
|
||||
{
|
||||
var q = GetEnvironmental_EnergyReportByModle(table);
|
||||
count = q.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
// q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList();
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.EnergyReportId,
|
||||
x.UnitId,
|
||||
x.Year,
|
||||
x.Quarters,
|
||||
x.FillingMan,
|
||||
x.FillingDate,
|
||||
x.DutyPerson,
|
||||
x.UpState,
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static Model.Environmental_EnergyReport GetEnvironmental_EnergyReportById(string EnergyReportId)
|
||||
{
|
||||
return db.Environmental_EnergyReport.FirstOrDefault(x => x.EnergyReportId == EnergyReportId);
|
||||
}
|
||||
|
||||
public static Model.Environmental_EnergyReport GetEnvironmental_EnergyReportByUnitIdAndYearAndQuarters(string unitId, int year, int Quarters)
|
||||
{
|
||||
return Funs.DB.Environmental_EnergyReport.FirstOrDefault(e => e.UnitId == unitId && e.Quarters == Quarters && e.Year == year);
|
||||
}
|
||||
public static void AddEnvironmental_EnergyReport(Model.Environmental_EnergyReport newtable)
|
||||
{
|
||||
|
||||
Model.Environmental_EnergyReport table = new Model.Environmental_EnergyReport
|
||||
{
|
||||
EnergyReportId = newtable.EnergyReportId,
|
||||
UnitId = newtable.UnitId,
|
||||
Year = newtable.Year,
|
||||
Quarters = newtable.Quarters,
|
||||
FillingMan = newtable.FillingMan,
|
||||
FillingDate = newtable.FillingDate,
|
||||
DutyPerson = newtable.DutyPerson,
|
||||
UpState = newtable.UpState,
|
||||
};
|
||||
db.Environmental_EnergyReport.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void AddBulkEnvironmental_EnergyReport(List<Model.Environmental_EnergyReport> newtables)
|
||||
{
|
||||
|
||||
db.Environmental_EnergyReport.InsertAllOnSubmit(newtables);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据报表单位,报表时间判断是否存在
|
||||
/// </summary>
|
||||
/// <param name="Id">Id</param>
|
||||
/// <returns></returns>
|
||||
public static Model.Environmental_EnergyReport GetEnergyReportByUnitIdDate(string unitId, int year, int Quarters)
|
||||
{
|
||||
return Funs.DB.Environmental_EnergyReport.FirstOrDefault(e => e.UnitId == unitId && e.Year == year && e.Quarters == Quarters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据报表单位,报表年份获取对应集合
|
||||
/// </summary>
|
||||
/// <param name="Id">Id</param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Environmental_EnergyReport> GetEnergyReportByUnitIdYear(string unitId, int year)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_EnergyReport where x.UnitId == unitId && x.Year == year select x).ToList();
|
||||
}
|
||||
public static void UpdateEnvironmental_EnergyReport(Model.Environmental_EnergyReport newtable)
|
||||
{
|
||||
|
||||
Model.Environmental_EnergyReport table = db.Environmental_EnergyReport.FirstOrDefault(x => x.EnergyReportId == newtable.EnergyReportId);
|
||||
if (table != null)
|
||||
{
|
||||
table.EnergyReportId = newtable.EnergyReportId;
|
||||
table.UnitId = newtable.UnitId;
|
||||
table.Year = newtable.Year;
|
||||
table.Quarters = newtable.Quarters;
|
||||
table.FillingMan = newtable.FillingMan;
|
||||
table.FillingDate = newtable.FillingDate;
|
||||
table.DutyPerson = newtable.DutyPerson;
|
||||
table.UpState = newtable.UpState;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteEnvironmental_EnergyReportById(string EnergyReportId)
|
||||
{
|
||||
|
||||
Model.Environmental_EnergyReport table = db.Environmental_EnergyReport.FirstOrDefault(x => x.EnergyReportId == EnergyReportId);
|
||||
if (table != null)
|
||||
{
|
||||
db.Environmental_EnergyReport.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void DeleteALLEnvironmental_EnergyReport()
|
||||
{
|
||||
if (db.Environmental_EnergyReport != null)
|
||||
{
|
||||
db.Environmental_EnergyReport.DeleteAllOnSubmit(db.Environmental_EnergyReport);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,281 @@
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class EnergyreportItemService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.Environmental_EnergyReportItem> GetEnvironmental_EnergyReportItemByModle(Model.Environmental_EnergyReportItem table)
|
||||
{
|
||||
var q = from x in db.Environmental_EnergyReportItem
|
||||
where
|
||||
(string.IsNullOrEmpty(table.EnergyReportItemId) || x.EnergyReportItemId.Contains(table.EnergyReportItemId)) &&
|
||||
(string.IsNullOrEmpty(table.EnergyReportId) || x.EnergyReportId.Contains(table.EnergyReportId)) &&
|
||||
(string.IsNullOrEmpty(table.SortIndex) || x.SortIndex.Contains(table.SortIndex)) &&
|
||||
(string.IsNullOrEmpty(table.BusinessCategory) || x.BusinessCategory.Contains(table.BusinessCategory)) &&
|
||||
(string.IsNullOrEmpty(table.Throughput_UnitOfMeasurement) || x.Throughput_UnitOfMeasurement.Contains(table.Throughput_UnitOfMeasurement)) &&
|
||||
(string.IsNullOrEmpty(table.Yield_UnitOfMeasurement) || x.Yield_UnitOfMeasurement.Contains(table.Yield_UnitOfMeasurement)) &&
|
||||
(string.IsNullOrEmpty(table.OperationScale_UnitOfMeasurement) || x.OperationScale_UnitOfMeasurement.Contains(table.OperationScale_UnitOfMeasurement))
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
}
|
||||
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="PageIndex">页码</param>
|
||||
/// <param name="PageSize">每页数量</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(Model.Environmental_EnergyReportItem table, Grid Grid1)
|
||||
{
|
||||
var q = GetEnvironmental_EnergyReportItemByModle(table);
|
||||
count = q.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
// q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList();
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.EnergyReportItemId,
|
||||
x.EnergyReportId,
|
||||
x.SortIndex,
|
||||
x.BusinessCategory,
|
||||
x.Throughput_BasePeriod,
|
||||
x.Throughput_LastPeriod,
|
||||
x.Throughput_ThisPeriod,
|
||||
x.Throughput_UnitOfMeasurement,
|
||||
x.Yield_BasePeriod,
|
||||
x.Yield_LastPeriod,
|
||||
x.Yield_ThisPeriod,
|
||||
x.Yield_UnitOfMeasurement,
|
||||
x.OutputValue_BasePeriod,
|
||||
x.OutputValue_LastYear,
|
||||
x.OutputValue_ThisYear,
|
||||
x.OperationScale_BasePeriod,
|
||||
x.OperationScale_LastYear,
|
||||
x.OperationScale_ThisYear,
|
||||
x.OperationScale_UnitOfMeasurement,
|
||||
x.ServiceOperatingIncome_BasePeriod,
|
||||
x.ServiceOperatingIncome_LastYear,
|
||||
x.ServiceOperatingIncome_ThisYear,
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static Model.Environmental_EnergyReportItem GetEnvironmental_EnergyReportItemById(string EnergyReportItemId)
|
||||
{
|
||||
return db.Environmental_EnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == EnergyReportItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId"></param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Environmental_EnergyReportItem> GetItems(string EnergyReportId)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_EnergyReportItem
|
||||
where x.EnergyReportId == EnergyReportId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId">化工行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Environmental_EnergyReportItem> GetYearSumItems(string unitId, int? year, int? Quarters)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_EnergyReportItem
|
||||
join y in Funs.DB.Environmental_EnergyReport
|
||||
on x.EnergyReportId equals y.EnergyReportId
|
||||
where y.UnitId == unitId && y.Year == year && y.Quarters == Quarters
|
||||
orderby x.SortIndex
|
||||
select x).Distinct().ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取年度明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId">化工行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>年度明细记录集合</returns>
|
||||
public static List<Model.Environmental_EnergyReportItem> GetLastYearItems(int year)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_EnergyReportItem
|
||||
join y in Funs.DB.Environmental_EnergyReport
|
||||
on x.EnergyReportId equals y.EnergyReportId
|
||||
where y.Year == year
|
||||
select x).Distinct().ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合(不包含本月合计行)
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId">化工行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Environmental_EnergyReportItem> GetShowItems(string EnergyReportId)
|
||||
{
|
||||
var q = (from x in Funs.DB.Environmental_EnergyReportItem
|
||||
where x.EnergyReportId == EnergyReportId
|
||||
orderby x.SortIndex
|
||||
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();
|
||||
|
||||
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;
|
||||
}
|
||||
public static void AddEnvironmental_EnergyReportItem(Model.Environmental_EnergyReportItem newtable)
|
||||
{
|
||||
|
||||
Model.Environmental_EnergyReportItem table = new Model.Environmental_EnergyReportItem
|
||||
{
|
||||
EnergyReportItemId = newtable.EnergyReportItemId,
|
||||
EnergyReportId = newtable.EnergyReportId,
|
||||
SortIndex = newtable.SortIndex,
|
||||
BusinessCategory = newtable.BusinessCategory,
|
||||
Throughput_BasePeriod = newtable.Throughput_BasePeriod,
|
||||
Throughput_LastPeriod = newtable.Throughput_LastPeriod,
|
||||
Throughput_ThisPeriod = newtable.Throughput_ThisPeriod,
|
||||
Throughput_UnitOfMeasurement = newtable.Throughput_UnitOfMeasurement,
|
||||
Yield_BasePeriod = newtable.Yield_BasePeriod,
|
||||
Yield_LastPeriod = newtable.Yield_LastPeriod,
|
||||
Yield_ThisPeriod = newtable.Yield_ThisPeriod,
|
||||
Yield_UnitOfMeasurement = newtable.Yield_UnitOfMeasurement,
|
||||
OutputValue_BasePeriod = newtable.OutputValue_BasePeriod,
|
||||
OutputValue_LastYear = newtable.OutputValue_LastYear,
|
||||
OutputValue_ThisYear = newtable.OutputValue_ThisYear,
|
||||
OperationScale_BasePeriod = newtable.OperationScale_BasePeriod,
|
||||
OperationScale_LastYear = newtable.OperationScale_LastYear,
|
||||
OperationScale_ThisYear = newtable.OperationScale_ThisYear,
|
||||
OperationScale_UnitOfMeasurement = newtable.OperationScale_UnitOfMeasurement,
|
||||
ServiceOperatingIncome_BasePeriod = newtable.ServiceOperatingIncome_BasePeriod,
|
||||
ServiceOperatingIncome_LastYear = newtable.ServiceOperatingIncome_LastYear,
|
||||
ServiceOperatingIncome_ThisYear = newtable.ServiceOperatingIncome_ThisYear,
|
||||
};
|
||||
db.Environmental_EnergyReportItem.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void AddBulkEnvironmental_EnergyReportItem(List<Model.Environmental_EnergyReportItem> newtables)
|
||||
{
|
||||
|
||||
db.Environmental_EnergyReportItem.InsertAllOnSubmit(newtables);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
public static void UpdateEnvironmental_EnergyReportItem(Model.Environmental_EnergyReportItem newtable)
|
||||
{
|
||||
|
||||
Model.Environmental_EnergyReportItem table = db.Environmental_EnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == newtable.EnergyReportItemId);
|
||||
if (table != null)
|
||||
{
|
||||
table.EnergyReportItemId = newtable.EnergyReportItemId;
|
||||
table.EnergyReportId = newtable.EnergyReportId;
|
||||
table.SortIndex = newtable.SortIndex;
|
||||
table.BusinessCategory = newtable.BusinessCategory;
|
||||
table.Throughput_BasePeriod = newtable.Throughput_BasePeriod;
|
||||
table.Throughput_LastPeriod = newtable.Throughput_LastPeriod;
|
||||
table.Throughput_ThisPeriod = newtable.Throughput_ThisPeriod;
|
||||
table.Throughput_UnitOfMeasurement = newtable.Throughput_UnitOfMeasurement;
|
||||
table.Yield_BasePeriod = newtable.Yield_BasePeriod;
|
||||
table.Yield_LastPeriod = newtable.Yield_LastPeriod;
|
||||
table.Yield_ThisPeriod = newtable.Yield_ThisPeriod;
|
||||
table.Yield_UnitOfMeasurement = newtable.Yield_UnitOfMeasurement;
|
||||
table.OutputValue_BasePeriod = newtable.OutputValue_BasePeriod;
|
||||
table.OutputValue_LastYear = newtable.OutputValue_LastYear;
|
||||
table.OutputValue_ThisYear = newtable.OutputValue_ThisYear;
|
||||
table.OperationScale_BasePeriod = newtable.OperationScale_BasePeriod;
|
||||
table.OperationScale_LastYear = newtable.OperationScale_LastYear;
|
||||
table.OperationScale_ThisYear = newtable.OperationScale_ThisYear;
|
||||
table.OperationScale_UnitOfMeasurement = newtable.OperationScale_UnitOfMeasurement;
|
||||
table.ServiceOperatingIncome_BasePeriod = newtable.ServiceOperatingIncome_BasePeriod;
|
||||
table.ServiceOperatingIncome_LastYear = newtable.ServiceOperatingIncome_LastYear;
|
||||
table.ServiceOperatingIncome_ThisYear = newtable.ServiceOperatingIncome_ThisYear;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteEnvironmental_EnergyReportItemById(string EnergyReportItemId)
|
||||
{
|
||||
|
||||
Model.Environmental_EnergyReportItem table = db.Environmental_EnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == EnergyReportItemId);
|
||||
if (table != null)
|
||||
{
|
||||
db.Environmental_EnergyReportItem.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void DeleteALLEnvironmental_EnergyReportItem()
|
||||
{
|
||||
if (db.Environmental_EnergyReportItem != null)
|
||||
{
|
||||
db.Environmental_EnergyReportItem.DeleteAllOnSubmit(db.Environmental_EnergyReportItem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
public static void DeleteEnergyReportItemByChemicalReportId(string EnergyReportId)
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,307 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class ProjectArchitectureReportItemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 建筑行业能源节约与生态环境保护汇总明细表
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportItemId">建筑行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>建筑行业能源节约与生态环境保护汇总明细表</returns>
|
||||
public static Model.Environmental_ProjectArchitectureReportItem GetArchitectureReportItemByArchitectureReportItemId(string ArchitectureReportItemId)
|
||||
{
|
||||
return Funs.DB.Environmental_ProjectArchitectureReportItem.FirstOrDefault(e => e.ArchitectureReportItemId == ArchitectureReportItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 建筑行业能源节约与生态环境保护汇总明细表
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportItemId">建筑行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>建筑行业能源节约与生态环境保护汇总明细表</returns>
|
||||
public static Model.Environmental_ProjectArchitectureReportItem GetArchitectureReportItemByArchitectureReportIdAndTypeId(string ArchitectureReportId)
|
||||
{
|
||||
return Funs.DB.Environmental_ProjectArchitectureReportItem.FirstOrDefault(e => e.ArchitectureReportId == ArchitectureReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id判断是否存在明细记录
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportItemId">企业安全数据统计月报表Id</param>
|
||||
/// <returns>是否存在明细记录</returns>
|
||||
public static bool IsExitItems(string ArchitectureReportId)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ProjectArchitectureReportItem where x.ArchitectureReportId == ArchitectureReportId select x).Count() > 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportItemId">建筑行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Environmental_ProjectArchitectureReportItem> GetItems(string ArchitectureReportId)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ProjectArchitectureReportItem
|
||||
where x.ArchitectureReportId == ArchitectureReportId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportItemId">建筑行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Environmental_ProjectArchitectureReportItem> GetYearSumItems(string projectId, int? year, int? Quarters)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ProjectArchitectureReportItem
|
||||
join y in Funs.DB.Environmental_ProjectArchitectureReport
|
||||
on x.ArchitectureReportId equals y.ArchitectureReportId
|
||||
where y.ProjectId == projectId && y.Year == year && y.Quarters == Quarters
|
||||
orderby x.SortIndex
|
||||
select x).Distinct().ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取年度明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportItemId">建筑行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>年度明细记录集合</returns>
|
||||
public static List<Model.Environmental_ProjectArchitectureReportItem> GetLastYearItems(int year)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ProjectArchitectureReportItem
|
||||
join y in Funs.DB.Environmental_ProjectArchitectureReport
|
||||
on x.ArchitectureReportId equals y.ArchitectureReportId
|
||||
where y.Year == year
|
||||
select x).Distinct().ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合(不包含本月合计行)
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportItemId">建筑行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.ArchitectureReportItem> GetShowItems(string ArchitectureReportId)
|
||||
{
|
||||
var q = (from x in Funs.DB.Environmental_ProjectArchitectureReportItem
|
||||
where x.ArchitectureReportId == ArchitectureReportId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
List<Model.ArchitectureReportItem> newItems = new List<Model.ArchitectureReportItem>();
|
||||
var indexNames = GetIndexNames();
|
||||
var units = GetUnits();
|
||||
foreach (var item in q)
|
||||
{
|
||||
Model.ArchitectureReportItem newItem = new Model.ArchitectureReportItem();
|
||||
newItem.ArchitectureReportItemId = item.ArchitectureReportItemId;
|
||||
newItem.IndexName = indexNames.First(x => x.Value == item.SortIndex).Text;
|
||||
newItem.Unit = units.First(x => x.Value == item.SortIndex).Text;
|
||||
newItem.SortIndex = item.SortIndex;
|
||||
newItem.BaseNumber = item.BaseNumber;
|
||||
newItem.LastYearValue = item.LastYearValue;
|
||||
newItem.ThisYearValue = item.ThisYearValue;
|
||||
newItem.Rate = item.Rate;
|
||||
newItems.Add(newItem);
|
||||
}
|
||||
return newItems;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加建筑行业能源节约与生态环境保护汇总明细表
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportItem">建筑行业能源节约与生态环境保护汇总明细表实体</param>
|
||||
public static void AddArchitectureReportItem(Model.Environmental_ProjectArchitectureReportItem ArchitectureReportItem)
|
||||
{
|
||||
Model.Environmental_ProjectArchitectureReportItem newArchitectureReportItem = new Model.Environmental_ProjectArchitectureReportItem
|
||||
{
|
||||
ArchitectureReportItemId = ArchitectureReportItem.ArchitectureReportItemId,
|
||||
ArchitectureReportId = ArchitectureReportItem.ArchitectureReportId,
|
||||
BaseNumber = ArchitectureReportItem.BaseNumber,
|
||||
SortIndex = ArchitectureReportItem.SortIndex,
|
||||
LastYearValue = ArchitectureReportItem.LastYearValue,
|
||||
ThisYearValue = ArchitectureReportItem.ThisYearValue,
|
||||
Rate = ArchitectureReportItem.Rate,
|
||||
};
|
||||
|
||||
Funs.DB.Environmental_ProjectArchitectureReportItem.InsertOnSubmit(newArchitectureReportItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改建筑行业能源节约与生态环境保护汇总明细表
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportItem">建筑行业能源节约与生态环境保护汇总明细表实体</param>
|
||||
public static void UpdateArchitectureReportItem(Model.Environmental_ProjectArchitectureReportItem ArchitectureReportItem)
|
||||
{
|
||||
Model.Environmental_ProjectArchitectureReportItem newArchitectureReportItem = Funs.DB.Environmental_ProjectArchitectureReportItem.FirstOrDefault(e => e.ArchitectureReportItemId == ArchitectureReportItem.ArchitectureReportItemId);
|
||||
newArchitectureReportItem.SortIndex = ArchitectureReportItem.SortIndex;
|
||||
newArchitectureReportItem.BaseNumber = ArchitectureReportItem.BaseNumber;
|
||||
newArchitectureReportItem.LastYearValue = ArchitectureReportItem.LastYearValue;
|
||||
newArchitectureReportItem.ThisYearValue = ArchitectureReportItem.ThisYearValue;
|
||||
newArchitectureReportItem.Rate = ArchitectureReportItem.Rate;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据Id删除所有数据
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportItemId"></param>
|
||||
public static void DeleteArchitectureReportItemByArchitectureReportId(string ArchitectureReportId)
|
||||
{
|
||||
var q = from x in Funs.DB.Environmental_ProjectArchitectureReportItem where x.ArchitectureReportId == ArchitectureReportId select x;
|
||||
if (q != null)
|
||||
{
|
||||
Funs.DB.Environmental_ProjectArchitectureReportItem.DeleteAllOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取指标名称集合
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetIndexNames()
|
||||
{
|
||||
ListItem[] list = new ListItem[61];
|
||||
list[0] = new ListItem("1.能源消费量", "01");
|
||||
list[1] = new ListItem("A其中:原煤(标准量)", "02");
|
||||
list[2] = new ListItem("B原煤(实物量)", "03");
|
||||
list[3] = new ListItem("C其中:发电用煤", "04");
|
||||
list[4] = new ListItem("B焦炭", "05");
|
||||
list[5] = new ListItem("B电力", "06");
|
||||
list[6] = new ListItem("B原油", "07");
|
||||
list[7] = new ListItem("B汽油", "08");
|
||||
list[8] = new ListItem("B煤油", "09");
|
||||
list[9] = new ListItem("B柴油", "10");
|
||||
list[10] = new ListItem("B燃料油", "11");
|
||||
list[11] = new ListItem("B天然气", "12");
|
||||
list[12] = new ListItem("B热力", "13");
|
||||
list[13] = new ListItem("B其他能源", "14");
|
||||
list[14] = new ListItem("2.万元营业收入综合能耗(现价)", "15");
|
||||
list[15] = new ListItem("A其中:营业收入(现价)", "16");
|
||||
list[16] = new ListItem("E万元营业收入综合能耗(可比价)", "17");
|
||||
list[17] = new ListItem("A其中:营业收入(可比价)", "18");
|
||||
list[18] = new ListItem("3.万元增加值综合能耗(现价)", "19");
|
||||
list[19] = new ListItem("A其中:增加值(现价)", "20");
|
||||
list[20] = new ListItem("E万元增加值综合能耗(可比价)", "21");
|
||||
list[21] = new ListItem("A其中:增加值(可比价)", "22");
|
||||
list[22] = new ListItem("4.万元营业收入用新水量(可比价)", "23");
|
||||
list[23] = new ListItem("A其中:用新水量", "24");
|
||||
list[24] = new ListItem("5.节能量", "25");
|
||||
list[25] = new ListItem("6.二氧化硫排放量", "26");
|
||||
list[26] = new ListItem("7.氮氧化物排放量", "27");
|
||||
list[27] = new ListItem("8.化学需氧量排放量", "28");
|
||||
list[28] = new ListItem("A其中:排入外环境", "29");
|
||||
list[29] = new ListItem("B排入市政管网或生活污水处理厂", "30");
|
||||
list[30] = new ListItem("9.氨氮排放量", "31");
|
||||
list[31] = new ListItem("A其中:排入外环境", "32");
|
||||
list[32] = new ListItem("B排入市政管网或生活污水处理厂", "33");
|
||||
list[33] = new ListItem("10.烟(粉)尘排放量", "34");
|
||||
list[34] = new ListItem("11.挥发性有机物排放量", "35");
|
||||
list[35] = new ListItem("12.废水排放量", "36");
|
||||
list[36] = new ListItem("13.万元收入二氧化碳排放(可比价)", "37");
|
||||
list[37] = new ListItem("A其中:二氧化碳排放量", "38");
|
||||
list[38] = new ListItem("14.一般固体废物综合利用率", "39");
|
||||
list[39] = new ListItem("A其中:一般固体废物综合利用量", "40");
|
||||
list[40] = new ListItem("B其中:综合利用往年贮存量", "41");
|
||||
list[41] = new ListItem("F一般固体废物产生量", "42");
|
||||
list[42] = new ListItem("15.危险废物处置率", "43");
|
||||
list[43] = new ListItem("A其中:危险废物处置量", "44");
|
||||
list[44] = new ListItem("B其中:处置往年贮存量", "45");
|
||||
list[45] = new ListItem("F危险废物产生量", "46");
|
||||
list[46] = new ListItem("16.土壤污染治理率", "47");
|
||||
list[47] = new ListItem("A其中:土壤污染治理面积", "48");
|
||||
list[48] = new ListItem("B土壤污染需要治理面积", "49");
|
||||
list[49] = new ListItem("17.矿山(或生态)修复治理率", "50");
|
||||
list[50] = new ListItem("A其中:矿山(或生态)修复治理面积", "51");
|
||||
list[51] = new ListItem("B矿山(或生态)需要修复治理面积", "52");
|
||||
list[52] = new ListItem("18.废气治理设施数", "53");
|
||||
list[53] = new ListItem("19.废气治理设施处理能力", "54");
|
||||
list[54] = new ListItem("20.废水治理设施数", "55");
|
||||
list[55] = new ListItem("21.废水治理设施处理能力", "56");
|
||||
list[56] = new ListItem("22.生态环境污染源", "57");
|
||||
list[57] = new ListItem("23.生态环境风险点", "58");
|
||||
list[58] = new ListItem("24.节能环保投入占收入比重", "59");
|
||||
list[59] = new ListItem("A其中:节能投入", "60");
|
||||
list[60] = new ListItem("B环保投入", "61");
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取计量单位集合
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetUnits()
|
||||
{
|
||||
ListItem[] list = new ListItem[61];
|
||||
list[0] = new ListItem("万吨标准煤", "01");
|
||||
list[1] = new ListItem("万吨标准煤", "02");
|
||||
list[2] = new ListItem("万吨", "03");
|
||||
list[3] = new ListItem("万吨", "04");
|
||||
list[4] = new ListItem("吨", "05");
|
||||
list[5] = new ListItem("万千瓦时", "06");
|
||||
list[6] = new ListItem("吨", "07");
|
||||
list[7] = new ListItem("吨", "08");
|
||||
list[8] = new ListItem("吨", "09");
|
||||
list[9] = new ListItem("吨", "10");
|
||||
list[10] = new ListItem("吨", "11");
|
||||
list[11] = new ListItem("万立方米", "12");
|
||||
list[12] = new ListItem("百万千焦", "13");
|
||||
list[13] = new ListItem("吨标准煤", "14");
|
||||
list[14] = new ListItem("吨标准煤/万元", "15");
|
||||
list[15] = new ListItem("万元", "16");
|
||||
list[16] = new ListItem("吨标准煤/万元", "17");
|
||||
list[17] = new ListItem("万元", "18");
|
||||
list[18] = new ListItem("吨标准煤/万元", "19");
|
||||
list[19] = new ListItem("万元", "20");
|
||||
list[20] = new ListItem("吨标准煤/万元", "21");
|
||||
list[21] = new ListItem("万元", "22");
|
||||
list[22] = new ListItem("吨/万元", "23");
|
||||
list[23] = new ListItem("万吨", "24");
|
||||
list[24] = new ListItem("吨标准煤", "25");
|
||||
list[25] = new ListItem("吨", "26");
|
||||
list[26] = new ListItem("吨", "27");
|
||||
list[27] = new ListItem("吨", "28");
|
||||
list[28] = new ListItem("吨", "29");
|
||||
list[29] = new ListItem("吨", "30");
|
||||
list[30] = new ListItem("吨", "31");
|
||||
list[31] = new ListItem("吨", "32");
|
||||
list[32] = new ListItem("吨", "33");
|
||||
list[33] = new ListItem("吨", "34");
|
||||
list[34] = new ListItem("吨", "35");
|
||||
list[35] = new ListItem("万吨", "36");
|
||||
list[36] = new ListItem("吨二氧化碳当量/万元", "37");
|
||||
list[37] = new ListItem("万吨二氧化碳当量", "38");
|
||||
list[38] = new ListItem("%", "39");
|
||||
list[39] = new ListItem("万吨", "40");
|
||||
list[40] = new ListItem("万吨", "41");
|
||||
list[41] = new ListItem("万吨", "42");
|
||||
list[42] = new ListItem("%", "43");
|
||||
list[43] = new ListItem("万吨", "44");
|
||||
list[44] = new ListItem("万吨", "45");
|
||||
list[45] = new ListItem("万吨", "46");
|
||||
list[46] = new ListItem("%", "47");
|
||||
list[47] = new ListItem("公顷", "48");
|
||||
list[48] = new ListItem("公顷", "49");
|
||||
list[49] = new ListItem("%", "50");
|
||||
list[50] = new ListItem("公顷", "51");
|
||||
list[51] = new ListItem("公顷", "52");
|
||||
list[52] = new ListItem("套", "53");
|
||||
list[53] = new ListItem("万立方米/年", "54");
|
||||
list[54] = new ListItem("套", "55");
|
||||
list[55] = new ListItem("万吨/年", "56");
|
||||
list[56] = new ListItem("个", "57");
|
||||
list[57] = new ListItem("个", "58");
|
||||
list[58] = new ListItem("%", "59");
|
||||
list[59] = new ListItem("万元", "60");
|
||||
list[60] = new ListItem("万元", "61");
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,119 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class ProjectArchitectureReportService
|
||||
{
|
||||
/// <summary>
|
||||
/// 建筑行业能源节约与生态环境保护汇总表
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportId">建筑行业能源节约与生态环境保护汇总表Id</param>
|
||||
/// <returns>建筑行业能源节约与生态环境保护汇总表</returns>
|
||||
public static Model.Environmental_ProjectArchitectureReport GetArchitectureReportByArchitectureReportId(string ArchitectureReportId)
|
||||
{
|
||||
return Funs.DB.Environmental_ProjectArchitectureReport.FirstOrDefault(e => e.ArchitectureReportId == ArchitectureReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 建筑行业能源节约与生态环境保护汇总表
|
||||
/// </summary>
|
||||
/// <param name="unitId">单位Id</param>
|
||||
/// <param name = "year" > 年度 </ param >
|
||||
/// <param name="month">月份</param>
|
||||
/// <returns>建筑行业能源节约与生态环境保护汇总表</returns>
|
||||
public static Model.Environmental_ProjectArchitectureReport GetArchitectureReportByProjectIdAndYearAndQuarters(string projectId, int year, int Quarters)
|
||||
{
|
||||
return Funs.DB.Environmental_ProjectArchitectureReport.FirstOrDefault(e => e.ProjectId == projectId && e.Quarters == Quarters && e.Year == year);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位Id获取建筑行业能源节约与生态环境保护汇总表集合
|
||||
/// </summary>
|
||||
/// <param name="UnitId">单位Id</param>
|
||||
/// <returns>建筑行业能源节约与生态环境保护汇总表集合</returns>
|
||||
public static List<Model.View_Environmental_ProjectArchitectureReport> GetArchitectureReportsByProjectId(string ProjectId)
|
||||
{
|
||||
return (from x in Funs.DB.View_Environmental_ProjectArchitectureReport where x.ProjectId == ProjectId orderby x.FillingDate descending select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加建筑行业能源节约与生态环境保护汇总表
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReport">建筑行业能源节约与生态环境保护汇总表实体</param>
|
||||
public static void AddArchitectureReport(Model.Environmental_ProjectArchitectureReport ArchitectureReport)
|
||||
{
|
||||
Model.Environmental_ProjectArchitectureReport newArchitectureReport = new Model.Environmental_ProjectArchitectureReport
|
||||
{
|
||||
ArchitectureReportId = ArchitectureReport.ArchitectureReportId,
|
||||
Year = ArchitectureReport.Year,
|
||||
Quarters = ArchitectureReport.Quarters,
|
||||
ProjectId = ArchitectureReport.ProjectId,
|
||||
FillingDate = ArchitectureReport.FillingDate,
|
||||
DutyPerson = ArchitectureReport.DutyPerson,
|
||||
FillingMan = ArchitectureReport.FillingMan,
|
||||
UpState = ArchitectureReport.UpState,
|
||||
};
|
||||
|
||||
Funs.DB.Environmental_ProjectArchitectureReport.InsertOnSubmit(newArchitectureReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改建筑行业能源节约与生态环境保护汇总表
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReport">建筑行业能源节约与生态环境保护汇总表实体</param>
|
||||
public static void UpdateArchitectureReport(Model.Environmental_ProjectArchitectureReport ArchitectureReport)
|
||||
{
|
||||
Model.Environmental_ProjectArchitectureReport newArchitectureReport = Funs.DB.Environmental_ProjectArchitectureReport.FirstOrDefault(e => e.ArchitectureReportId == ArchitectureReport.ArchitectureReportId);
|
||||
if (newArchitectureReport != null)
|
||||
{
|
||||
newArchitectureReport.Year = ArchitectureReport.Year;
|
||||
newArchitectureReport.Quarters = ArchitectureReport.Quarters;
|
||||
newArchitectureReport.ProjectId = ArchitectureReport.ProjectId;
|
||||
newArchitectureReport.FillingDate = ArchitectureReport.FillingDate;
|
||||
newArchitectureReport.DutyPerson = ArchitectureReport.DutyPerson;
|
||||
newArchitectureReport.UpState = ArchitectureReport.UpState;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据Id获取数据
|
||||
/// </summary>
|
||||
/// <param name="ArchitectureReportId"></param>
|
||||
public static void DeleteArchitectureReportByArchitectureReportId(string ArchitectureReportId)
|
||||
{
|
||||
Model.Environmental_ProjectArchitectureReport newArchitectureReport = Funs.DB.Environmental_ProjectArchitectureReport.FirstOrDefault(e => e.ArchitectureReportId == ArchitectureReportId);
|
||||
if (newArchitectureReport != null)
|
||||
{
|
||||
Funs.DB.Environmental_ProjectArchitectureReport.DeleteOnSubmit(newArchitectureReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据报表单位,报表时间判断是否存在
|
||||
/// </summary>
|
||||
/// <param name="Id">Id</param>
|
||||
/// <returns></returns>
|
||||
public static Model.Environmental_ProjectArchitectureReport GetArchitectureReportByProjectIdDate(string ProjectId, int year, int Quarters)
|
||||
{
|
||||
return Funs.DB.Environmental_ProjectArchitectureReport.FirstOrDefault(e => e.ProjectId == ProjectId && e.Year == year && e.Quarters == Quarters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据报表单位,报表年份获取对应集合
|
||||
/// </summary>
|
||||
/// <param name="Id">Id</param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Environmental_ProjectArchitectureReport> GetArchitectureReportByProjectIdYear(string ProjectId, int year)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ProjectArchitectureReport where x.ProjectId == ProjectId && x.Year == year select x).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,383 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class ProjectChemicalReportItemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 化工行业能源节约与生态环境保护汇总明细表
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId">化工行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>化工行业能源节约与生态环境保护汇总明细表</returns>
|
||||
public static Model.Environmental_ProjectChemicalReportItem GetChemicalReportItemByChemicalReportItemId(string ChemicalReportItemId)
|
||||
{
|
||||
return Funs.DB.Environmental_ProjectChemicalReportItem.FirstOrDefault(e => e.ChemicalReportItemId == ChemicalReportItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 化工行业能源节约与生态环境保护汇总明细表
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId">化工行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>化工行业能源节约与生态环境保护汇总明细表</returns>
|
||||
public static Model.Environmental_ProjectChemicalReportItem GetChemicalReportItemByChemicalReportIdAndTypeId(string ChemicalReportId)
|
||||
{
|
||||
return Funs.DB.Environmental_ProjectChemicalReportItem.FirstOrDefault(e => e.ChemicalReportId == ChemicalReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id判断是否存在明细记录
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId">企业安全数据统计月报表Id</param>
|
||||
/// <returns>是否存在明细记录</returns>
|
||||
public static bool IsExitItems(string ChemicalReportId)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ProjectChemicalReportItem where x.ChemicalReportId == ChemicalReportId select x).Count() > 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId">化工行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Environmental_ProjectChemicalReportItem> GetItems(string ChemicalReportId)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ProjectChemicalReportItem
|
||||
where x.ChemicalReportId == ChemicalReportId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId">化工行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Environmental_ProjectChemicalReportItem> GetYearSumItems(string projectId, int? year, int? month)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ProjectChemicalReportItem
|
||||
join y in Funs.DB.Environmental_ProjectChemicalReport
|
||||
on x.ChemicalReportId equals y.ChemicalReportId
|
||||
where y.ProjectId == projectId && y.Year == year && y.Month == month
|
||||
orderby x.SortIndex
|
||||
select x).Distinct().ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取年度明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId">化工行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>年度明细记录集合</returns>
|
||||
public static List<Model.Environmental_ProjectChemicalReportItem> GetLastYearItems(int year)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ProjectChemicalReportItem
|
||||
join y in Funs.DB.Environmental_ProjectChemicalReport
|
||||
on x.ChemicalReportId equals y.ChemicalReportId
|
||||
where y.Year == year
|
||||
select x).Distinct().ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合(不包含本月合计行)
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId">化工行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.ChemicalReportItem> GetShowItems(string ChemicalReportId)
|
||||
{
|
||||
var q = (from x in Funs.DB.Environmental_ProjectChemicalReportItem
|
||||
where x.ChemicalReportId == ChemicalReportId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
List<Model.ChemicalReportItem> newItems = new List<Model.ChemicalReportItem>();
|
||||
var indexNames = GetIndexNames();
|
||||
var units = GetUnits();
|
||||
foreach (var item in q)
|
||||
{
|
||||
Model.ChemicalReportItem newItem = new Model.ChemicalReportItem();
|
||||
newItem.ChemicalReportItemId = item.ChemicalReportItemId;
|
||||
newItem.IndexName = indexNames.First(x => x.Value == item.SortIndex).Text;
|
||||
newItem.Unit = units.First(x => x.Value == item.SortIndex).Text;
|
||||
newItem.SortIndex = item.SortIndex;
|
||||
newItem.BaseNumber = item.BaseNumber;
|
||||
newItem.LastYearValue = item.LastYearValue;
|
||||
newItem.ThisYearValue = item.ThisYearValue;
|
||||
newItem.Rate = item.Rate;
|
||||
newItems.Add(newItem);
|
||||
}
|
||||
return newItems;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加化工行业能源节约与生态环境保护汇总明细表
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItem">化工行业能源节约与生态环境保护汇总明细表实体</param>
|
||||
public static void AddChemicalReportItem(Model.Environmental_ProjectChemicalReportItem ChemicalReportItem)
|
||||
{
|
||||
Model.Environmental_ProjectChemicalReportItem newChemicalReportItem = new Model.Environmental_ProjectChemicalReportItem
|
||||
{
|
||||
ChemicalReportItemId = ChemicalReportItem.ChemicalReportItemId,
|
||||
ChemicalReportId = ChemicalReportItem.ChemicalReportId,
|
||||
SortIndex = ChemicalReportItem.SortIndex,
|
||||
BaseNumber = ChemicalReportItem.BaseNumber,
|
||||
LastYearValue = ChemicalReportItem.LastYearValue,
|
||||
ThisYearValue = ChemicalReportItem.ThisYearValue,
|
||||
Rate = ChemicalReportItem.Rate,
|
||||
};
|
||||
|
||||
Funs.DB.Environmental_ProjectChemicalReportItem.InsertOnSubmit(newChemicalReportItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改化工行业能源节约与生态环境保护汇总明细表
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItem">化工行业能源节约与生态环境保护汇总明细表实体</param>
|
||||
public static void UpdateChemicalReportItem(Model.Environmental_ProjectChemicalReportItem ChemicalReportItem)
|
||||
{
|
||||
Model.Environmental_ProjectChemicalReportItem newChemicalReportItem = Funs.DB.Environmental_ProjectChemicalReportItem.FirstOrDefault(e => e.ChemicalReportItemId == ChemicalReportItem.ChemicalReportItemId);
|
||||
newChemicalReportItem.SortIndex = ChemicalReportItem.SortIndex;
|
||||
newChemicalReportItem.BaseNumber = ChemicalReportItem.BaseNumber;
|
||||
newChemicalReportItem.LastYearValue = ChemicalReportItem.LastYearValue;
|
||||
newChemicalReportItem.ThisYearValue = ChemicalReportItem.ThisYearValue;
|
||||
newChemicalReportItem.Rate = ChemicalReportItem.Rate;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据Id删除所有数据
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId"></param>
|
||||
public static void DeleteChemicalReportItemByChemicalReportId(string ChemicalReportId)
|
||||
{
|
||||
var q = from x in Funs.DB.Environmental_ProjectChemicalReportItem where x.ChemicalReportId == ChemicalReportId select x;
|
||||
if (q != null)
|
||||
{
|
||||
Funs.DB.Environmental_ProjectChemicalReportItem.DeleteAllOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取指标名称集合
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetIndexNames()
|
||||
{
|
||||
ListItem[] list = new ListItem[99];
|
||||
list[0] = new ListItem("1.能源消费量", "01");
|
||||
list[1] = new ListItem("A含:综合能源消费量", "02");
|
||||
list[2] = new ListItem("A其中:原煤(标准量)", "03");
|
||||
list[3] = new ListItem("B原煤(实物量)", "04");
|
||||
list[4] = new ListItem("C其中:发电用煤", "05");
|
||||
list[5] = new ListItem("B焦炭", "06");
|
||||
list[6] = new ListItem("B电力", "07");
|
||||
list[7] = new ListItem("B原油", "08");
|
||||
list[8] = new ListItem("B汽油", "09");
|
||||
list[9] = new ListItem("B煤油", "10");
|
||||
list[10] = new ListItem("B柴油", "11");
|
||||
list[11] = new ListItem("B燃料油", "12");
|
||||
list[12] = new ListItem("B天然气", "13");
|
||||
list[13] = new ListItem("B热力", "14");
|
||||
list[14] = new ListItem("B其他能源", "15");
|
||||
list[15] = new ListItem("2.万元产值综合能耗(现价)", "16");
|
||||
list[16] = new ListItem("A其中:工业总产值(现价)", "17");
|
||||
list[17] = new ListItem("E万元产值综合能耗(可比价)", "18");
|
||||
list[18] = new ListItem("A其中:工业总产值(可比价)", "19");
|
||||
list[19] = new ListItem("3.万元增加值综合能耗(现价)", "20");
|
||||
list[20] = new ListItem("A其中:增加值(现价)", "21");
|
||||
list[21] = new ListItem("E万元增加值综合能耗(可比价)", "22");
|
||||
list[22] = new ListItem("A其中:增加值(可比价)", "23");
|
||||
list[23] = new ListItem("4.万元产值用新水量(可比价)", "24");
|
||||
list[24] = new ListItem("A其中:用新水量", "25");
|
||||
list[25] = new ListItem("E重复用水率", "26");
|
||||
list[26] = new ListItem("A其中:重复用水量", "27");
|
||||
list[27] = new ListItem("5.单位乙烯能耗", "28");
|
||||
list[28] = new ListItem("A其中:乙烯装置能耗", "29");
|
||||
list[29] = new ListItem("B乙烯装置合格乙烯产品产量", "30");
|
||||
list[30] = new ListItem("6.合成氨单位产品综合能耗", "31");
|
||||
list[31] = new ListItem("A其中:合成氨综合能耗", "32");
|
||||
list[32] = new ListItem("B合成氨产量", "33");
|
||||
list[33] = new ListItem("7.节能量", "34");
|
||||
list[34] = new ListItem("8.电煤占煤炭消费比重", "35");
|
||||
list[35] = new ListItem("9.余热余能回收利用率", "36");
|
||||
list[36] = new ListItem("A其中:回收利用的余热余能", "37");
|
||||
list[37] = new ListItem("10.自备电厂发电装机容量", "38");
|
||||
list[38] = new ListItem("A其中:燃煤发电", "39");
|
||||
list[39] = new ListItem("C其中:燃煤热电", "40");
|
||||
list[40] = new ListItem("B清洁能源发电", "41");
|
||||
list[41] = new ListItem("C其中:天然气发电", "42");
|
||||
list[42] = new ListItem("D核能发电", "43");
|
||||
list[43] = new ListItem("D水力发电", "44");
|
||||
list[44] = new ListItem("D风力发电", "45");
|
||||
list[45] = new ListItem("D太阳能发电", "46");
|
||||
list[46] = new ListItem("D其他清洁能源发电", "47");
|
||||
list[47] = new ListItem("B生物质发电", "48");
|
||||
list[48] = new ListItem("B其他发电", "49");
|
||||
list[49] = new ListItem("11.燃煤热电机组装机容量占燃煤发电装机容量比重", "50");
|
||||
list[50] = new ListItem("12.自备电厂发电量", "51");
|
||||
list[51] = new ListItem("13.排污许可证许可的二氧化硫排放量", "52");
|
||||
list[52] = new ListItem("14.排污许可证许可的氮氧化物排放量", "53");
|
||||
list[53] = new ListItem("15.排污许可证许可的化学需氧量排放量", "54");
|
||||
list[54] = new ListItem("16.排污许可证许可的氨氮排放量", "55");
|
||||
list[55] = new ListItem("17.排污许可证许可的烟(粉)尘排放量", "56");
|
||||
list[56] = new ListItem("18.排污许可证许可的挥发性有机物排放量", "57");
|
||||
list[57] = new ListItem("19.二氧化硫排放量", "58");
|
||||
list[58] = new ListItem("20.氮氧化物排放量", "59");
|
||||
list[59] = new ListItem("21.化学需氧量排放量", "60");
|
||||
list[60] = new ListItem("A其中:排入外环境", "61");
|
||||
list[61] = new ListItem("B排入市政管网或生活污水处理厂", "62");
|
||||
list[62] = new ListItem("22.氨氮排放量", "63");
|
||||
list[63] = new ListItem("A其中:排入外环境", "64");
|
||||
list[64] = new ListItem("B排入市政管网或生活污水处理厂", "65");
|
||||
list[65] = new ListItem("23.烟(粉)尘排放量", "66");
|
||||
list[66] = new ListItem("24.挥发性有机物排放量", "67");
|
||||
list[67] = new ListItem("25.废水排放量", "68");
|
||||
list[68] = new ListItem("26.万元产值二氧化碳排放(可比价)", "69");
|
||||
list[69] = new ListItem("A其中:二氧化碳排放量", "70");
|
||||
list[70] = new ListItem("27.一般固体废物综合利用率", "71");
|
||||
list[71] = new ListItem("A其中:一般固体废物综合利用量", "72");
|
||||
list[72] = new ListItem("C其中:综合利用往年贮存量", "73");
|
||||
list[73] = new ListItem("F一般固体废物产生量", "74");
|
||||
list[74] = new ListItem("28.危险废物处置率", "75");
|
||||
list[75] = new ListItem("A其中:危险废物处置量", "76");
|
||||
list[76] = new ListItem("C其中:处置往年贮存量", "77");
|
||||
list[77] = new ListItem("F危险废物产生量", "78");
|
||||
list[78] = new ListItem("29.土壤污染治理率", "79");
|
||||
list[79] = new ListItem("A其中:土壤污染治理面积", "80");
|
||||
list[80] = new ListItem("B土壤污染需要治理面积", "81");
|
||||
list[81] = new ListItem("30.矿山(或生态)修复治理率", "82");
|
||||
list[82] = new ListItem("A其中:矿山(或生态)修复治理面积", "83");
|
||||
list[83] = new ListItem("B矿山(或生态)需要修复治理面积", "84");
|
||||
list[84] = new ListItem("31.烟气脱硫机组装机容量占燃煤发电机组的比例", "85");
|
||||
list[85] = new ListItem("A其中:配备烟气脱硫装置的机组装机容量", "86");
|
||||
list[86] = new ListItem("32.烟气脱硝机组装机容量占燃煤发电机组的比例", "87");
|
||||
list[87] = new ListItem("A其中:配备烟气脱硝装置的机组装机容量", "88");
|
||||
list[88] = new ListItem("33.超低排放限值的机组装机容量占燃煤发电机组的比例", "89");
|
||||
list[89] = new ListItem("A其中:执行超低排放限值的机组装机容量", "90");
|
||||
list[90] = new ListItem("34.废气治理设施数", "91");
|
||||
list[91] = new ListItem("35.废气治理设施处理能力", "92");
|
||||
list[92] = new ListItem("36.废水治理设施数", "93");
|
||||
list[93] = new ListItem("37.废水治理设施处理能力", "94");
|
||||
list[94] = new ListItem("38.生态环境污染源", "95");
|
||||
list[95] = new ListItem("39.生态环境风险点", "96");
|
||||
list[96] = new ListItem("40.节能环保投入占产值比重", "97");
|
||||
list[97] = new ListItem("A其中:节能投入", "98");
|
||||
list[98] = new ListItem("B环保投入", "99");
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取计量单位集合
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ListItem[] GetUnits()
|
||||
{
|
||||
ListItem[] list = new ListItem[99];
|
||||
list[0] = new ListItem("万吨标准煤", "01");
|
||||
list[1] = new ListItem("万吨标准煤", "02");
|
||||
list[2] = new ListItem("万吨标准煤", "03");
|
||||
list[3] = new ListItem("万吨", "04");
|
||||
list[4] = new ListItem("万吨", "05");
|
||||
list[5] = new ListItem("吨", "06");
|
||||
list[6] = new ListItem("万千瓦时", "07");
|
||||
list[7] = new ListItem("吨", "08");
|
||||
list[8] = new ListItem("吨", "09");
|
||||
list[9] = new ListItem("吨", "10");
|
||||
list[10] = new ListItem("吨", "11");
|
||||
list[11] = new ListItem("吨", "12");
|
||||
list[12] = new ListItem("万立方米", "13");
|
||||
list[13] = new ListItem("百万千焦", "14");
|
||||
list[14] = new ListItem("吨标准煤", "15");
|
||||
list[15] = new ListItem("吨标准煤/万元", "16");
|
||||
list[16] = new ListItem("万元", "17");
|
||||
list[17] = new ListItem("吨标准煤/万元", "18");
|
||||
list[18] = new ListItem("万元", "19");
|
||||
list[19] = new ListItem("吨标准煤/万元", "20");
|
||||
list[20] = new ListItem("万元", "21");
|
||||
list[21] = new ListItem("吨标准煤/万元", "22");
|
||||
list[22] = new ListItem("万元", "23");
|
||||
list[23] = new ListItem("吨/万元", "24");
|
||||
list[24] = new ListItem("万吨", "25");
|
||||
list[25] = new ListItem("%", "26");
|
||||
list[26] = new ListItem("万吨", "27");
|
||||
list[27] = new ListItem("千克标准油/吨", "28");
|
||||
list[28] = new ListItem("千克标准油", "29");
|
||||
list[29] = new ListItem("吨", "30");
|
||||
list[30] = new ListItem("千克标准煤/吨", "31");
|
||||
list[31] = new ListItem("吨标准煤", "32");
|
||||
list[32] = new ListItem("吨", "33");
|
||||
list[33] = new ListItem("吨标准煤", "34");
|
||||
list[34] = new ListItem("%", "35");
|
||||
list[35] = new ListItem("%", "36");
|
||||
list[36] = new ListItem("百万千焦", "37");
|
||||
list[37] = new ListItem("万千瓦", "38");
|
||||
list[38] = new ListItem("万千瓦", "39");
|
||||
list[39] = new ListItem("万千瓦", "40");
|
||||
list[40] = new ListItem("万千瓦", "41");
|
||||
list[41] = new ListItem("万千瓦", "42");
|
||||
list[42] = new ListItem("万千瓦", "43");
|
||||
list[43] = new ListItem("万千瓦", "44");
|
||||
list[44] = new ListItem("万千瓦", "45");
|
||||
list[45] = new ListItem("万千瓦", "46");
|
||||
list[46] = new ListItem("万千瓦", "47");
|
||||
list[47] = new ListItem("万千瓦", "48");
|
||||
list[48] = new ListItem("万千瓦", "49");
|
||||
list[49] = new ListItem("%", "50");
|
||||
list[50] = new ListItem("万千瓦时", "51");
|
||||
list[51] = new ListItem("吨", "52");
|
||||
list[52] = new ListItem("吨", "53");
|
||||
list[53] = new ListItem("吨", "54");
|
||||
list[54] = new ListItem("吨", "55");
|
||||
list[55] = new ListItem("吨", "56");
|
||||
list[56] = new ListItem("吨", "57");
|
||||
list[57] = new ListItem("吨", "58");
|
||||
list[58] = new ListItem("吨", "59");
|
||||
list[59] = new ListItem("吨", "60");
|
||||
list[60] = new ListItem("吨", "61");
|
||||
list[61] = new ListItem("吨", "62");
|
||||
list[62] = new ListItem("吨", "63");
|
||||
list[63] = new ListItem("吨", "64");
|
||||
list[64] = new ListItem("吨", "65");
|
||||
list[65] = new ListItem("吨", "66");
|
||||
list[66] = new ListItem("吨", "67");
|
||||
list[67] = new ListItem("万吨", "68");
|
||||
list[68] = new ListItem("吨二氧化碳当量/万元", "69");
|
||||
list[69] = new ListItem("万吨二氧化碳当量", "70");
|
||||
list[70] = new ListItem("%", "71");
|
||||
list[71] = new ListItem("万吨", "72");
|
||||
list[72] = new ListItem("万吨", "73");
|
||||
list[73] = new ListItem("万吨", "74");
|
||||
list[74] = new ListItem("%", "75");
|
||||
list[75] = new ListItem("万吨", "76");
|
||||
list[76] = new ListItem("万吨", "77");
|
||||
list[77] = new ListItem("万吨", "78");
|
||||
list[78] = new ListItem("%", "79");
|
||||
list[79] = new ListItem("公顷", "80");
|
||||
list[80] = new ListItem("公顷", "81");
|
||||
list[81] = new ListItem("%", "82");
|
||||
list[82] = new ListItem("公顷", "83");
|
||||
list[83] = new ListItem("公顷", "84");
|
||||
list[84] = new ListItem("%", "85");
|
||||
list[85] = new ListItem("万千瓦", "86");
|
||||
list[86] = new ListItem("%", "87");
|
||||
list[87] = new ListItem("万千瓦", "88");
|
||||
list[88] = new ListItem("%", "89");
|
||||
list[89] = new ListItem("万千瓦", "90");
|
||||
list[90] = new ListItem("套", "91");
|
||||
list[91] = new ListItem("万立方米/年", "92");
|
||||
list[92] = new ListItem("套", "93");
|
||||
list[93] = new ListItem("万吨/年", "94");
|
||||
list[94] = new ListItem("个", "95");
|
||||
list[95] = new ListItem("个", "96");
|
||||
list[96] = new ListItem("%", "97");
|
||||
list[97] = new ListItem("万元", "98");
|
||||
list[98] = new ListItem("万元", "99");
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class ProjectChemicalReportService
|
||||
{
|
||||
/// <summary>
|
||||
/// 化工行业能源节约与生态环境保护汇总表
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportId">化工行业能源节约与生态环境保护汇总表Id</param>
|
||||
/// <returns>化工行业能源节约与生态环境保护汇总表</returns>
|
||||
public static Model.Environmental_ProjectChemicalReport GetChemicalReportByChemicalReportId(string ChemicalReportId)
|
||||
{
|
||||
return Funs.DB.Environmental_ProjectChemicalReport.FirstOrDefault(e => e.ChemicalReportId == ChemicalReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 化工行业能源节约与生态环境保护汇总表
|
||||
/// </summary>
|
||||
/// <param name="unitId">单位Id</param>
|
||||
/// <param name = "year" > 年度 </ param >
|
||||
/// <param name="month">月份</param>
|
||||
/// <returns>化工行业能源节约与生态环境保护汇总表</returns>
|
||||
public static Model.Environmental_ProjectChemicalReport GetChemicalReportByProjectIdAndYearAndMonth(string projectId, int year, int month)
|
||||
{
|
||||
return Funs.DB.Environmental_ProjectChemicalReport.FirstOrDefault(e => e.ProjectId == projectId && e.Month == month && e.Year == year);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加化工行业能源节约与生态环境保护汇总表
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReport">化工行业能源节约与生态环境保护汇总表实体</param>
|
||||
public static void AddChemicalReport(Model.Environmental_ProjectChemicalReport ChemicalReport)
|
||||
{
|
||||
Model.Environmental_ProjectChemicalReport newChemicalReport = new Model.Environmental_ProjectChemicalReport
|
||||
{
|
||||
ChemicalReportId = ChemicalReport.ChemicalReportId,
|
||||
Year = ChemicalReport.Year,
|
||||
Month = ChemicalReport.Month,
|
||||
ProjectId = ChemicalReport.ProjectId,
|
||||
FillingDate = ChemicalReport.FillingDate,
|
||||
DutyPerson = ChemicalReport.DutyPerson,
|
||||
FillingMan = ChemicalReport.FillingMan,
|
||||
UpState = ChemicalReport.UpState,
|
||||
};
|
||||
|
||||
Funs.DB.Environmental_ProjectChemicalReport.InsertOnSubmit(newChemicalReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改化工行业能源节约与生态环境保护汇总表
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReport">化工行业能源节约与生态环境保护汇总表实体</param>
|
||||
public static void UpdateChemicalReport(Model.Environmental_ProjectChemicalReport ChemicalReport)
|
||||
{
|
||||
Model.Environmental_ProjectChemicalReport newChemicalReport = Funs.DB.Environmental_ProjectChemicalReport.FirstOrDefault(e => e.ChemicalReportId == ChemicalReport.ChemicalReportId);
|
||||
if (newChemicalReport != null)
|
||||
{
|
||||
newChemicalReport.Year = ChemicalReport.Year;
|
||||
newChemicalReport.Month = ChemicalReport.Month;
|
||||
newChemicalReport.ProjectId = ChemicalReport.ProjectId;
|
||||
newChemicalReport.FillingDate = ChemicalReport.FillingDate;
|
||||
newChemicalReport.DutyPerson = ChemicalReport.DutyPerson;
|
||||
newChemicalReport.UpState = ChemicalReport.UpState;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据Id获取数据
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportId"></param>
|
||||
public static void DeleteChemicalReportByChemicalReportId(string ChemicalReportId)
|
||||
{
|
||||
Model.Environmental_ProjectChemicalReport newChemicalReport = Funs.DB.Environmental_ProjectChemicalReport.FirstOrDefault(e => e.ChemicalReportId == ChemicalReportId);
|
||||
if (newChemicalReport != null)
|
||||
{
|
||||
Funs.DB.Environmental_ProjectChemicalReport.DeleteOnSubmit(newChemicalReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据报表单位,报表时间判断是否存在
|
||||
/// </summary>
|
||||
/// <param name="Id">Id</param>
|
||||
/// <returns></returns>
|
||||
public static Model.Environmental_ProjectChemicalReport GetChemicalReportByProjectIdDate(string projectId, int year, int Month)
|
||||
{
|
||||
return Funs.DB.Environmental_ProjectChemicalReport.FirstOrDefault(e => e.ProjectId == projectId && e.Year == year && e.Month == Month);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据报表单位,报表年份获取对应集合
|
||||
/// </summary>
|
||||
/// <param name="Id">Id</param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Environmental_ProjectChemicalReport> GetChemicalReportByProjectIdYear(string projectId, int year)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ProjectChemicalReport where x.ProjectId == projectId && x.Year == year select x).ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,174 @@
|
||||
using FineUIPro;
|
||||
using Microsoft.SqlServer.Dts.Runtime;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class ProjectEnergyReportService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.Environmental_ProjectEnergyReport> GetEnvironmental_ProjectEnergyReportByModle(Model.Environmental_ProjectEnergyReport table)
|
||||
{
|
||||
var q = from x in db.Environmental_ProjectEnergyReport
|
||||
where
|
||||
(string.IsNullOrEmpty(table.EnergyReportId) || x.EnergyReportId.Contains(table.EnergyReportId)) &&
|
||||
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
|
||||
(string.IsNullOrEmpty(table.FillingMan) || x.FillingMan.Contains(table.FillingMan)) &&
|
||||
(string.IsNullOrEmpty(table.DutyPerson) || x.DutyPerson.Contains(table.DutyPerson)) &&
|
||||
(string.IsNullOrEmpty(table.UpState) || x.UpState.Contains(table.UpState))
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
}
|
||||
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="PageIndex">页码</param>
|
||||
/// <param name="PageSize">每页数量</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(Model.Environmental_ProjectEnergyReport table, Grid Grid1)
|
||||
{
|
||||
var q = GetEnvironmental_ProjectEnergyReportByModle(table);
|
||||
count = q.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
// q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList();
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.EnergyReportId,
|
||||
x.UnitId,
|
||||
x.Year,
|
||||
x.Quarters,
|
||||
x.FillingMan,
|
||||
x.FillingDate,
|
||||
x.DutyPerson,
|
||||
x.UpState,
|
||||
x.ProjectId
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static Model.Environmental_ProjectEnergyReport GetEnvironmental_ProjectEnergyReportById(string EnergyReportId)
|
||||
{
|
||||
return db.Environmental_ProjectEnergyReport.FirstOrDefault(x => x.EnergyReportId == EnergyReportId);
|
||||
}
|
||||
|
||||
public static Model.Environmental_ProjectEnergyReport GetEnvironmental_ProjectEnergyReportByProjectIdAndYearAndQuarters(string ProjectId, int year, int Quarters)
|
||||
{
|
||||
return Funs.DB.Environmental_ProjectEnergyReport.FirstOrDefault(e => e.ProjectId == ProjectId && e.Quarters == Quarters && e.Year == year);
|
||||
}
|
||||
public static void AddEnvironmental_ProjectEnergyReport(Model.Environmental_ProjectEnergyReport newtable)
|
||||
{
|
||||
|
||||
Model.Environmental_ProjectEnergyReport table = new Model.Environmental_ProjectEnergyReport
|
||||
{
|
||||
EnergyReportId = newtable.EnergyReportId,
|
||||
UnitId = newtable.UnitId,
|
||||
Year = newtable.Year,
|
||||
Quarters = newtable.Quarters,
|
||||
FillingMan = newtable.FillingMan,
|
||||
FillingDate = newtable.FillingDate,
|
||||
DutyPerson = newtable.DutyPerson,
|
||||
UpState = newtable.UpState,
|
||||
ProjectId=newtable.ProjectId,
|
||||
};
|
||||
db.Environmental_ProjectEnergyReport.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void AddBulkEnvironmental_ProjectEnergyReport(List<Model.Environmental_ProjectEnergyReport> newtables)
|
||||
{
|
||||
|
||||
db.Environmental_ProjectEnergyReport.InsertAllOnSubmit(newtables);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据报表单位,报表时间判断是否存在
|
||||
/// </summary>
|
||||
/// <param name="Id">Id</param>
|
||||
/// <returns></returns>
|
||||
public static Model.Environmental_ProjectEnergyReport GetEnergyReportByProjectIdDate(string ProjectId, int year, int Quarters)
|
||||
{
|
||||
return Funs.DB.Environmental_ProjectEnergyReport.FirstOrDefault(e => e.ProjectId == ProjectId && e.Year == year && e.Quarters == Quarters);
|
||||
}
|
||||
public static List<Model.Environmental_ProjectEnergyReport> GetEnergyReportByDate(int year, int Quarters)
|
||||
{
|
||||
var q = (from x in Funs.DB.Environmental_ProjectEnergyReport where x.Year == year && x.Quarters == Quarters select x).ToList();
|
||||
return q;
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据报表单位,报表年份获取对应集合
|
||||
/// </summary>
|
||||
/// <param name="Id">Id</param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Environmental_ProjectEnergyReport> GetEnergyReportByProjectIdYear(string ProjectId, int year)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ProjectEnergyReport where x.ProjectId == ProjectId && x.Year == year select x).ToList();
|
||||
}
|
||||
public static void UpdateEnvironmental_ProjectEnergyReport(Model.Environmental_ProjectEnergyReport newtable)
|
||||
{
|
||||
|
||||
Model.Environmental_ProjectEnergyReport table = db.Environmental_ProjectEnergyReport.FirstOrDefault(x => x.EnergyReportId == newtable.EnergyReportId);
|
||||
if (table != null)
|
||||
{
|
||||
table.EnergyReportId = newtable.EnergyReportId;
|
||||
table.UnitId = newtable.UnitId;
|
||||
table.Year = newtable.Year;
|
||||
table.Quarters = newtable.Quarters;
|
||||
table.FillingMan = newtable.FillingMan;
|
||||
table.FillingDate = newtable.FillingDate;
|
||||
table.DutyPerson = newtable.DutyPerson;
|
||||
table.UpState = newtable.UpState;
|
||||
table.ProjectId=newtable.ProjectId;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteEnvironmental_ProjectEnergyReportById(string EnergyReportId)
|
||||
{
|
||||
|
||||
Model.Environmental_ProjectEnergyReport table = db.Environmental_ProjectEnergyReport.FirstOrDefault(x => x.EnergyReportId == EnergyReportId);
|
||||
if (table != null)
|
||||
{
|
||||
db.Environmental_ProjectEnergyReport.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void DeleteALLEnvironmental_ProjectEnergyReport()
|
||||
{
|
||||
if (db.Environmental_ProjectEnergyReport != null)
|
||||
{
|
||||
db.Environmental_ProjectEnergyReport.DeleteAllOnSubmit(db.Environmental_ProjectEnergyReport);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,289 @@
|
||||
using FineUIPro;
|
||||
using Microsoft.SqlServer.Dts.Runtime;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class ProjectEnergyreportItemService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.Environmental_ProjectEnergyReportItem> GetEnvironmental_ProjectEnergyReportItemByModle(Model.Environmental_ProjectEnergyReportItem table)
|
||||
{
|
||||
var q = from x in db.Environmental_ProjectEnergyReportItem
|
||||
where
|
||||
(string.IsNullOrEmpty(table.EnergyReportItemId) || x.EnergyReportItemId.Contains(table.EnergyReportItemId)) &&
|
||||
(string.IsNullOrEmpty(table.EnergyReportId) || x.EnergyReportId.Contains(table.EnergyReportId)) &&
|
||||
(string.IsNullOrEmpty(table.SortIndex) || x.SortIndex.Contains(table.SortIndex)) &&
|
||||
(string.IsNullOrEmpty(table.BusinessCategory) || x.BusinessCategory.Contains(table.BusinessCategory)) &&
|
||||
(string.IsNullOrEmpty(table.Throughput_UnitOfMeasurement) || x.Throughput_UnitOfMeasurement.Contains(table.Throughput_UnitOfMeasurement)) &&
|
||||
(string.IsNullOrEmpty(table.Yield_UnitOfMeasurement) || x.Yield_UnitOfMeasurement.Contains(table.Yield_UnitOfMeasurement)) &&
|
||||
(string.IsNullOrEmpty(table.OperationScale_UnitOfMeasurement) || x.OperationScale_UnitOfMeasurement.Contains(table.OperationScale_UnitOfMeasurement))
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
}
|
||||
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="PageIndex">页码</param>
|
||||
/// <param name="PageSize">每页数量</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(Model.Environmental_ProjectEnergyReportItem table, Grid Grid1)
|
||||
{
|
||||
var q = GetEnvironmental_ProjectEnergyReportItemByModle(table);
|
||||
count = q.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
// q= q.Take(Grid1.PageSize * Grid1.PageIndex).Skip(Grid1.PageSize * (Grid1.PageIndex)).ToList();
|
||||
// q = SortConditionHelper.SortingAndPaging(q, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in q
|
||||
select new
|
||||
{
|
||||
x.EnergyReportItemId,
|
||||
x.EnergyReportId,
|
||||
x.SortIndex,
|
||||
x.BusinessCategory,
|
||||
x.Throughput_BasePeriod,
|
||||
x.Throughput_LastPeriod,
|
||||
x.Throughput_ThisPeriod,
|
||||
x.Throughput_UnitOfMeasurement,
|
||||
x.Yield_BasePeriod,
|
||||
x.Yield_LastPeriod,
|
||||
x.Yield_ThisPeriod,
|
||||
x.Yield_UnitOfMeasurement,
|
||||
x.OutputValue_BasePeriod,
|
||||
x.OutputValue_LastYear,
|
||||
x.OutputValue_ThisYear,
|
||||
x.OperationScale_BasePeriod,
|
||||
x.OperationScale_LastYear,
|
||||
x.OperationScale_ThisYear,
|
||||
x.OperationScale_UnitOfMeasurement,
|
||||
x.ServiceOperatingIncome_BasePeriod,
|
||||
x.ServiceOperatingIncome_LastYear,
|
||||
x.ServiceOperatingIncome_ThisYear,
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static Model.Environmental_ProjectEnergyReportItem GetEnvironmental_ProjectEnergyReportItemById(string EnergyReportItemId)
|
||||
{
|
||||
return db.Environmental_ProjectEnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == EnergyReportItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId"></param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Environmental_ProjectEnergyReportItem> GetItems(string EnergyReportId)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ProjectEnergyReportItem
|
||||
where x.EnergyReportId == EnergyReportId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId">化工行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Environmental_ProjectEnergyReportItem> GetYearSumItems(string ProjectId, int? year, int? Quarters)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ProjectEnergyReportItem
|
||||
join y in Funs.DB.Environmental_ProjectEnergyReport
|
||||
on x.EnergyReportId equals y.EnergyReportId
|
||||
where y.ProjectId == ProjectId && y.Year == year && y.Quarters == Quarters
|
||||
orderby x.SortIndex
|
||||
select x).Distinct().ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取年度明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId">化工行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>年度明细记录集合</returns>
|
||||
public static List<Model.Environmental_ProjectEnergyReportItem> GetItemsByDate(int year, int Quarters)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ProjectEnergyReportItem
|
||||
join y in Funs.DB.Environmental_ProjectEnergyReport
|
||||
on x.EnergyReportId equals y.EnergyReportId
|
||||
where y.Year == year && y.Quarters== Quarters
|
||||
select x).Distinct().ToList();
|
||||
}
|
||||
public static List<Model.Environmental_ProjectEnergyReportItem> GetLastYearItems(int year)
|
||||
{
|
||||
return (from x in Funs.DB.Environmental_ProjectEnergyReportItem
|
||||
join y in Funs.DB.Environmental_ProjectEnergyReport
|
||||
on x.EnergyReportId equals y.EnergyReportId
|
||||
where y.Year == year
|
||||
select x).Distinct().ToList();
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合(不包含本月合计行)
|
||||
/// </summary>
|
||||
/// <param name="ChemicalReportItemId">化工行业能源节约与生态环境保护汇总明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Environmental_ProjectEnergyReportItem> GetShowItems(string EnergyReportId)
|
||||
{
|
||||
var q = (from x in Funs.DB.Environmental_ProjectEnergyReportItem
|
||||
where x.EnergyReportId == EnergyReportId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
List<Model.Environmental_ProjectEnergyReportItem> newItems = new List<Model.Environmental_ProjectEnergyReportItem>();
|
||||
foreach (var item in q)
|
||||
{
|
||||
Model.Environmental_ProjectEnergyReportItem newItem = new Model.Environmental_ProjectEnergyReportItem();
|
||||
|
||||
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;
|
||||
}
|
||||
public static void AddEnvironmental_ProjectEnergyReportItem(Model.Environmental_ProjectEnergyReportItem newtable)
|
||||
{
|
||||
|
||||
Model.Environmental_ProjectEnergyReportItem table = new Model.Environmental_ProjectEnergyReportItem
|
||||
{
|
||||
EnergyReportItemId = newtable.EnergyReportItemId,
|
||||
EnergyReportId = newtable.EnergyReportId,
|
||||
SortIndex = newtable.SortIndex,
|
||||
BusinessCategory = newtable.BusinessCategory,
|
||||
Throughput_BasePeriod = newtable.Throughput_BasePeriod,
|
||||
Throughput_LastPeriod = newtable.Throughput_LastPeriod,
|
||||
Throughput_ThisPeriod = newtable.Throughput_ThisPeriod,
|
||||
Throughput_UnitOfMeasurement = newtable.Throughput_UnitOfMeasurement,
|
||||
Yield_BasePeriod = newtable.Yield_BasePeriod,
|
||||
Yield_LastPeriod = newtable.Yield_LastPeriod,
|
||||
Yield_ThisPeriod = newtable.Yield_ThisPeriod,
|
||||
Yield_UnitOfMeasurement = newtable.Yield_UnitOfMeasurement,
|
||||
OutputValue_BasePeriod = newtable.OutputValue_BasePeriod,
|
||||
OutputValue_LastYear = newtable.OutputValue_LastYear,
|
||||
OutputValue_ThisYear = newtable.OutputValue_ThisYear,
|
||||
OperationScale_BasePeriod = newtable.OperationScale_BasePeriod,
|
||||
OperationScale_LastYear = newtable.OperationScale_LastYear,
|
||||
OperationScale_ThisYear = newtable.OperationScale_ThisYear,
|
||||
OperationScale_UnitOfMeasurement = newtable.OperationScale_UnitOfMeasurement,
|
||||
ServiceOperatingIncome_BasePeriod = newtable.ServiceOperatingIncome_BasePeriod,
|
||||
ServiceOperatingIncome_LastYear = newtable.ServiceOperatingIncome_LastYear,
|
||||
ServiceOperatingIncome_ThisYear = newtable.ServiceOperatingIncome_ThisYear,
|
||||
};
|
||||
db.Environmental_ProjectEnergyReportItem.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void AddBulkEnvironmental_ProjectEnergyReportItem(List<Model.Environmental_ProjectEnergyReportItem> newtables)
|
||||
{
|
||||
|
||||
db.Environmental_ProjectEnergyReportItem.InsertAllOnSubmit(newtables);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
public static void UpdateEnvironmental_ProjectEnergyReportItem(Model.Environmental_ProjectEnergyReportItem newtable)
|
||||
{
|
||||
|
||||
Model.Environmental_ProjectEnergyReportItem table = db.Environmental_ProjectEnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == newtable.EnergyReportItemId);
|
||||
if (table != null)
|
||||
{
|
||||
table.EnergyReportItemId = newtable.EnergyReportItemId;
|
||||
table.EnergyReportId = newtable.EnergyReportId;
|
||||
table.SortIndex = newtable.SortIndex;
|
||||
table.BusinessCategory = newtable.BusinessCategory;
|
||||
table.Throughput_BasePeriod = newtable.Throughput_BasePeriod;
|
||||
table.Throughput_LastPeriod = newtable.Throughput_LastPeriod;
|
||||
table.Throughput_ThisPeriod = newtable.Throughput_ThisPeriod;
|
||||
table.Throughput_UnitOfMeasurement = newtable.Throughput_UnitOfMeasurement;
|
||||
table.Yield_BasePeriod = newtable.Yield_BasePeriod;
|
||||
table.Yield_LastPeriod = newtable.Yield_LastPeriod;
|
||||
table.Yield_ThisPeriod = newtable.Yield_ThisPeriod;
|
||||
table.Yield_UnitOfMeasurement = newtable.Yield_UnitOfMeasurement;
|
||||
table.OutputValue_BasePeriod = newtable.OutputValue_BasePeriod;
|
||||
table.OutputValue_LastYear = newtable.OutputValue_LastYear;
|
||||
table.OutputValue_ThisYear = newtable.OutputValue_ThisYear;
|
||||
table.OperationScale_BasePeriod = newtable.OperationScale_BasePeriod;
|
||||
table.OperationScale_LastYear = newtable.OperationScale_LastYear;
|
||||
table.OperationScale_ThisYear = newtable.OperationScale_ThisYear;
|
||||
table.OperationScale_UnitOfMeasurement = newtable.OperationScale_UnitOfMeasurement;
|
||||
table.ServiceOperatingIncome_BasePeriod = newtable.ServiceOperatingIncome_BasePeriod;
|
||||
table.ServiceOperatingIncome_LastYear = newtable.ServiceOperatingIncome_LastYear;
|
||||
table.ServiceOperatingIncome_ThisYear = newtable.ServiceOperatingIncome_ThisYear;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteEnvironmental_ProjectEnergyReportItemById(string EnergyReportItemId)
|
||||
{
|
||||
|
||||
Model.Environmental_ProjectEnergyReportItem table = db.Environmental_ProjectEnergyReportItem.FirstOrDefault(x => x.EnergyReportItemId == EnergyReportItemId);
|
||||
if (table != null)
|
||||
{
|
||||
db.Environmental_ProjectEnergyReportItem.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void DeleteALLEnvironmental_ProjectEnergyReportItem()
|
||||
{
|
||||
if (db.Environmental_ProjectEnergyReportItem != null)
|
||||
{
|
||||
db.Environmental_ProjectEnergyReportItem.DeleteAllOnSubmit(db.Environmental_ProjectEnergyReportItem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
public static void DeleteEnergyReportItemByChemicalReportId(string EnergyReportId)
|
||||
{
|
||||
var q = from x in Funs.DB.Environmental_ProjectEnergyReportItem where x.EnergyReportId == EnergyReportId select x;
|
||||
if (q != null)
|
||||
{
|
||||
Funs.DB.Environmental_ProjectEnergyReportItem.DeleteAllOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user