120 lines
5.9 KiB
C#
120 lines
5.9 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BLL
|
|
{
|
|
public static class IndustryOtherReportService
|
|
{
|
|
/// <summary>
|
|
/// 工业其他行业能源节约与生态环境保护汇总表
|
|
/// </summary>
|
|
/// <param name="IndustryOtherReportId">工业其他行业能源节约与生态环境保护汇总表Id</param>
|
|
/// <returns>工业其他行业能源节约与生态环境保护汇总表</returns>
|
|
public static Model.Environmental_IndustryOtherReport GetIndustryOtherReportByIndustryOtherReportId(string IndustryOtherReportId)
|
|
{
|
|
return Funs.DB.Environmental_IndustryOtherReport.FirstOrDefault(e => e.IndustryOtherReportId == IndustryOtherReportId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 工业其他行业能源节约与生态环境保护汇总表
|
|
/// </summary>
|
|
/// <param name="unitId">单位Id</param>
|
|
/// <param name = "year" > 年度 </ param >
|
|
/// <param name="month">月份</param>
|
|
/// <returns>工业其他行业能源节约与生态环境保护汇总表</returns>
|
|
public static Model.Environmental_IndustryOtherReport GetIndustryOtherReportByUnitIdAndYearAndQuarters(string unitId, int year, int Quarters)
|
|
{
|
|
return Funs.DB.Environmental_IndustryOtherReport.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_IndustryOtherReport> GetIndustryOtherReportsByUnitId(string UnitId)
|
|
{
|
|
return (from x in Funs.DB.View_Environmental_IndustryOtherReport where x.UnitId == UnitId orderby x.FillingDate descending select x).ToList();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 增加工业其他行业能源节约与生态环境保护汇总表
|
|
/// </summary>
|
|
/// <param name="IndustryOtherReport">工业其他行业能源节约与生态环境保护汇总表实体</param>
|
|
public static void AddIndustryOtherReport(Model.Environmental_IndustryOtherReport IndustryOtherReport)
|
|
{
|
|
Model.Environmental_IndustryOtherReport newIndustryOtherReport = new Model.Environmental_IndustryOtherReport
|
|
{
|
|
IndustryOtherReportId = IndustryOtherReport.IndustryOtherReportId,
|
|
Year = IndustryOtherReport.Year,
|
|
Quarters = IndustryOtherReport.Quarters,
|
|
UnitId = IndustryOtherReport.UnitId,
|
|
FillingDate = IndustryOtherReport.FillingDate,
|
|
DutyPerson = IndustryOtherReport.DutyPerson,
|
|
FillingMan = IndustryOtherReport.FillingMan,
|
|
UpState = IndustryOtherReport.UpState,
|
|
};
|
|
|
|
Funs.DB.Environmental_IndustryOtherReport.InsertOnSubmit(newIndustryOtherReport);
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改工业其他行业能源节约与生态环境保护汇总表
|
|
/// </summary>
|
|
/// <param name="IndustryOtherReport">工业其他行业能源节约与生态环境保护汇总表实体</param>
|
|
public static void UpdateIndustryOtherReport(Model.Environmental_IndustryOtherReport IndustryOtherReport)
|
|
{
|
|
Model.Environmental_IndustryOtherReport newIndustryOtherReport = Funs.DB.Environmental_IndustryOtherReport.FirstOrDefault(e => e.IndustryOtherReportId == IndustryOtherReport.IndustryOtherReportId);
|
|
if (newIndustryOtherReport != null)
|
|
{
|
|
newIndustryOtherReport.Year = IndustryOtherReport.Year;
|
|
newIndustryOtherReport.Quarters = IndustryOtherReport.Quarters;
|
|
newIndustryOtherReport.UnitId = IndustryOtherReport.UnitId;
|
|
newIndustryOtherReport.FillingDate = IndustryOtherReport.FillingDate;
|
|
newIndustryOtherReport.DutyPerson = IndustryOtherReport.DutyPerson;
|
|
newIndustryOtherReport.UpState = IndustryOtherReport.UpState;
|
|
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据Id删除数据
|
|
/// </summary>
|
|
/// <param name="IndustryOtherReportId"></param>
|
|
public static void DeleteIndustryOtherReportByIndustryOtherReportId(string IndustryOtherReportId)
|
|
{
|
|
Model.Environmental_IndustryOtherReport newIndustryOtherReport = Funs.DB.Environmental_IndustryOtherReport.FirstOrDefault(e => e.IndustryOtherReportId == IndustryOtherReportId);
|
|
if (newIndustryOtherReport != null)
|
|
{
|
|
Funs.DB.Environmental_IndustryOtherReport.DeleteOnSubmit(newIndustryOtherReport);
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据报表单位,报表时间判断是否存在
|
|
/// </summary>
|
|
/// <param name="Id">Id</param>
|
|
/// <returns></returns>
|
|
public static Model.Environmental_IndustryOtherReport GetIndustryOtherReportByUnitIdDate(string unitId, int year, int Quarters)
|
|
{
|
|
return Funs.DB.Environmental_IndustryOtherReport.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_IndustryOtherReport> GetIndustryOtherReportByUnitIdYear(string unitId, int year)
|
|
{
|
|
return (from x in Funs.DB.Environmental_IndustryOtherReport where x.UnitId == unitId && x.Year == year select x).ToList();
|
|
}
|
|
}
|
|
}
|