hb
This commit is contained in:
@@ -95,7 +95,7 @@ namespace BLL
|
||||
Telephone = x.Telephone,
|
||||
PhotoUrl = x.PhotoUrl,
|
||||
DepartName = x.DepartName,
|
||||
IsUsed = x.IsUsed == 1 ? true : false,
|
||||
IsUsed = x.IsUsed .HasValue?x.IsUsed.Value.ToString():"",
|
||||
IsUsedName = x.IsUsed == 0 ? "不启用" : "启用",
|
||||
AuditorId = x.AuditorId,
|
||||
AuditorName = db.Sys_User.First(z => z.UserId == x.AuditorId).UserName,
|
||||
@@ -202,7 +202,7 @@ namespace BLL
|
||||
Telephone = x.Telephone,
|
||||
PhotoUrl = x.PhotoUrl,
|
||||
DepartName = x.DepartName,
|
||||
IsUsed = x.IsUsed==1?true:false,
|
||||
IsUsed = x.IsUsed.HasValue?x.IsUsed.Value.ToString():"",
|
||||
IsUsedName = x.IsUsed == 0 ? "不启用" : "启用",
|
||||
AuditorId = x.AuditorId,
|
||||
AuditorName = db.Sys_User.First(z => z.UserId == x.AuditorId).UserName,
|
||||
@@ -400,7 +400,7 @@ namespace BLL
|
||||
OutResult = x.OutResult,
|
||||
Telephone = x.Telephone,
|
||||
PhotoUrl = x.PhotoUrl,
|
||||
IsUsed = x.IsUsed==1?true:false,
|
||||
IsUsed = x.IsUsed.HasValue?x.IsUsed.ToString():"",
|
||||
IsUsedName = (x.IsUsed == 1 ? "启用" : "未启用"),
|
||||
WorkAreaId = x.WorkAreaId,
|
||||
WorkAreaName = UnitWorkService.GetUnitWorkName(x.WorkAreaId),
|
||||
@@ -567,13 +567,19 @@ namespace BLL
|
||||
/// <param name="workPostIds">培训岗位ID</param>
|
||||
/// <param name="trainTypeId">培训类型ID</param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.PersonItem> getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string departIds, string trainTypeId)
|
||||
public static List<Model.PersonItem> getTrainingPersonListByTrainTypeId(string projectId, string unitIds, string workPostIds, string departIds, string trainTypeId,string InTime,string strParam)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
DateTime inDateTime=DateTime.Now;
|
||||
if (!string.IsNullOrEmpty(InTime))
|
||||
{
|
||||
inDateTime = DateTime.Parse(InTime);
|
||||
}
|
||||
|
||||
List<string> unitIdList = Funs.GetStrListByStr(unitIds, ',');
|
||||
var getPersons = from x in db.View_SitePerson_Person
|
||||
where x.ProjectId == projectId && unitIdList.Contains(x.UnitId) && x.IsUsed == 1
|
||||
where x.ProjectId == projectId && unitIdList.Contains(x.UnitId) && x.IsUsed == 1 &&(string.IsNullOrEmpty(strParam)||x.PersonName.Contains(strParam)) && (string.IsNullOrEmpty(InTime) || x.InTime < inDateTime)
|
||||
&& x.InTime <= DateTime.Now && (!x.OutTime.HasValue || x.OutTime >= DateTime.Now)
|
||||
select new Model.PersonItem
|
||||
{
|
||||
@@ -723,13 +729,9 @@ namespace BLL
|
||||
{
|
||||
newPerson.ViceCNProfessionalId = person.ViceCNProfessionalId;
|
||||
}
|
||||
if (person.IsUsed == true)
|
||||
if (!string.IsNullOrEmpty(person.IsUsed))
|
||||
{
|
||||
newPerson.IsUsed = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
newPerson.IsUsed = 0;
|
||||
newPerson.IsUsed = int.Parse(person.IsUsed);
|
||||
}
|
||||
newPerson.Password = PersonService.GetPersonPassWord(person.IdentityCard);
|
||||
string rootUrl = ConfigurationManager.AppSettings["localRoot"];
|
||||
@@ -808,7 +810,10 @@ namespace BLL
|
||||
}
|
||||
else
|
||||
{
|
||||
getPerson.IsUsed = person.IsUsed?1:0;
|
||||
if (!string.IsNullOrEmpty(person.IsUsed))
|
||||
{
|
||||
getPerson.IsUsed = int.Parse(person.IsUsed);
|
||||
}
|
||||
getPerson.AuditorDate = DateTime.Now;
|
||||
}
|
||||
getPerson.AuditorId = person.AuditorId;
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace BLL
|
||||
TestScores = x.TestScores ?? 0,
|
||||
TestType = x.TestType,
|
||||
TemporaryUser = x.TemporaryUser,
|
||||
Signature= x.Signature
|
||||
}).ToList();
|
||||
|
||||
foreach(var item in getDataLists)
|
||||
@@ -90,6 +91,7 @@ namespace BLL
|
||||
TestScores = x.TestScores ?? 0,
|
||||
TestType = x.TestType,
|
||||
TemporaryUser = x.TemporaryUser,
|
||||
Signature= x.Signature
|
||||
};
|
||||
var res = getDataLists.FirstOrDefault();
|
||||
if (res != null)
|
||||
@@ -845,5 +847,29 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 修改考试记录信息
|
||||
/// </summary>
|
||||
/// <param name="Training"></param>
|
||||
public static void updateTestRecord(Model.Training_TestRecord testRecord)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
Model.Training_TestRecord newTestRecord = db.Training_TestRecord.FirstOrDefault(e => e.TestRecordId == testRecord.TestRecordId);
|
||||
if (newTestRecord != null)
|
||||
{
|
||||
newTestRecord.TestScores = testRecord.TestScores;
|
||||
newTestRecord.TestEndTime = testRecord.TestEndTime;
|
||||
newTestRecord.IsFiled = testRecord.IsFiled;
|
||||
newTestRecord.Signature = testRecord.Signature;
|
||||
newTestRecord.Fingerprint = testRecord.Fingerprint;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class Base_FactoryService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.Base_Factory> GetBase_FactoryByModle(Model.Base_Factory table)
|
||||
{
|
||||
var q = from x in db.Base_Factory
|
||||
where
|
||||
(string.IsNullOrEmpty(table.FactoryId) || x.FactoryId.Contains(table.FactoryId)) &&
|
||||
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
|
||||
(string.IsNullOrEmpty(table.FactoryCode) || x.FactoryCode.Contains(table.FactoryCode)) &&
|
||||
(string.IsNullOrEmpty(table.FactoryName) || x.FactoryName.Contains(table.FactoryName)) &&
|
||||
(string.IsNullOrEmpty(table.Address) || x.Address.Contains(table.Address))
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
}
|
||||
public static List<Model.Base_Factory> GetBase_FactoryList()
|
||||
{
|
||||
var q = (from x in db.Base_Factory orderby x.FactoryCode select x).ToList();
|
||||
|
||||
|
||||
return q;
|
||||
}
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="PageIndex">页码</param>
|
||||
/// <param name="PageSize">每页数量</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(Model.Base_Factory table, Grid Grid1)
|
||||
{
|
||||
var q = GetBase_FactoryByModle(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.FactoryId,
|
||||
x.UnitId,
|
||||
x.FactoryCode,
|
||||
x.FactoryName,
|
||||
x.Address,
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static Model.Base_Factory GetBase_FactoryById(string FactoryId)
|
||||
{
|
||||
return db.Base_Factory.FirstOrDefault(x => x.FactoryId == FactoryId);
|
||||
}
|
||||
public static string GetBase_FactoryNameById(object FactoryId)
|
||||
{
|
||||
string name = string.Empty;
|
||||
if (FactoryId!=null)
|
||||
{
|
||||
var model = db.Base_Factory.FirstOrDefault(x => x.FactoryId == FactoryId.ToString());
|
||||
if (model != null)
|
||||
{
|
||||
name = model.FactoryName;
|
||||
}
|
||||
|
||||
}
|
||||
return name;
|
||||
}
|
||||
public static Model.Base_Factory GetBase_FactoryByCode(string FactoryCode)
|
||||
{
|
||||
return db.Base_Factory.FirstOrDefault(x => x.FactoryCode == FactoryCode);
|
||||
}
|
||||
public static void AddBase_Factory(Model.Base_Factory newtable)
|
||||
{
|
||||
|
||||
Model.Base_Factory table = new Model.Base_Factory
|
||||
{
|
||||
FactoryId = newtable.FactoryId,
|
||||
UnitId = newtable.UnitId,
|
||||
FactoryCode = newtable.FactoryCode,
|
||||
FactoryName = newtable.FactoryName,
|
||||
Address = newtable.Address,
|
||||
MapCoordinates= newtable.MapCoordinates,
|
||||
};
|
||||
db.Base_Factory.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void AddBulkBase_Factory(List<Model.Base_Factory> newtables)
|
||||
{
|
||||
|
||||
db.Base_Factory.InsertAllOnSubmit(newtables);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
public static void UpdateBase_Factory(Model.Base_Factory newtable)
|
||||
{
|
||||
|
||||
Model.Base_Factory table = db.Base_Factory.FirstOrDefault(x => x.FactoryId == newtable.FactoryId);
|
||||
if (table != null)
|
||||
{
|
||||
table.FactoryId = newtable.FactoryId;
|
||||
table.UnitId = newtable.UnitId;
|
||||
table.FactoryCode = newtable.FactoryCode;
|
||||
table.FactoryName = newtable.FactoryName;
|
||||
table.Address = newtable.Address;
|
||||
table.MapCoordinates = newtable.MapCoordinates;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteBase_FactoryById(string FactoryId)
|
||||
{
|
||||
|
||||
Model.Base_Factory table = db.Base_Factory.FirstOrDefault(x => x.FactoryId == FactoryId);
|
||||
if (table != null)
|
||||
{
|
||||
db.Base_Factory.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void DeleteALLBase_Factory()
|
||||
{
|
||||
if (db.Base_Factory != null)
|
||||
{
|
||||
db.Base_Factory.DeleteAllOnSubmit(db.Base_Factory);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
public static void InitBase_FactoryDownList(FineUIPro.DropDownList dropName, bool isShowPlease)
|
||||
{
|
||||
dropName.DataValueField = "FactoryId";
|
||||
dropName.DataTextField = "FactoryName";
|
||||
dropName.DataSource = GetBase_FactoryList();
|
||||
dropName.DataBind();
|
||||
if (isShowPlease)
|
||||
{
|
||||
Funs.FineUIPleaseSelect(dropName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量管理工作总结报告
|
||||
/// </summary>
|
||||
public static class ProjectQualityWorkSummaryReportService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取质量管理工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="qualityWorkSummaryReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.InformationProject_QualityWorkSummaryReport GetQualityWorkSummaryReportById(string qualityWorkSummaryReportId)
|
||||
{
|
||||
return Funs.DB.InformationProject_QualityWorkSummaryReport.FirstOrDefault(e => e.QualityWorkSummaryReportId == qualityWorkSummaryReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 质量管理工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="unitId">单位Id</param>
|
||||
/// <param name="year">年度</param>
|
||||
/// <returns>质量管理工作总结报告</returns>
|
||||
public static Model.InformationProject_QualityWorkSummaryReport GetQualityWorkSummaryReportByUnitIdAndYear(string unitId, int year)
|
||||
{
|
||||
return Funs.DB.InformationProject_QualityWorkSummaryReport.FirstOrDefault(e => e.UnitId == unitId && e.YearId == year);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加质量管理工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="qualityWorkSummaryReport"></param>
|
||||
public static void AddQualityWorkSummaryReport(Model.InformationProject_QualityWorkSummaryReport qualityWorkSummaryReport)
|
||||
{
|
||||
Model.InformationProject_QualityWorkSummaryReport newQualityWorkSummaryReport = new Model.InformationProject_QualityWorkSummaryReport
|
||||
{
|
||||
QualityWorkSummaryReportId = qualityWorkSummaryReport.QualityWorkSummaryReportId,
|
||||
ProjectId = qualityWorkSummaryReport.ProjectId,
|
||||
YearId = qualityWorkSummaryReport.YearId,
|
||||
UnitId = qualityWorkSummaryReport.UnitId,
|
||||
ResponsiblePerson = qualityWorkSummaryReport.ResponsiblePerson,
|
||||
ResponsiblePersonTel = qualityWorkSummaryReport.ResponsiblePersonTel,
|
||||
ContactPerson = qualityWorkSummaryReport.ContactPerson,
|
||||
ContactPersonTel = qualityWorkSummaryReport.ContactPersonTel,
|
||||
ReportDate = qualityWorkSummaryReport.ReportDate,
|
||||
Performance = qualityWorkSummaryReport.Performance,
|
||||
AccidentSituation = qualityWorkSummaryReport.AccidentSituation,
|
||||
Awards = qualityWorkSummaryReport.Awards,
|
||||
WorkDevelopment = qualityWorkSummaryReport.WorkDevelopment,
|
||||
PersonnelTraining = qualityWorkSummaryReport.PersonnelTraining,
|
||||
CheckSituation = qualityWorkSummaryReport.CheckSituation,
|
||||
ManagementActivity = qualityWorkSummaryReport.ManagementActivity,
|
||||
WorkExperience = qualityWorkSummaryReport.WorkExperience,
|
||||
Countermeasures = qualityWorkSummaryReport.Countermeasures,
|
||||
NextYearWorkPlan = qualityWorkSummaryReport.NextYearWorkPlan,
|
||||
JobSuggestion = qualityWorkSummaryReport.JobSuggestion,
|
||||
CompileMan = qualityWorkSummaryReport.CompileMan,
|
||||
CompileDate = qualityWorkSummaryReport.CompileDate
|
||||
};
|
||||
Funs.DB.InformationProject_QualityWorkSummaryReport.InsertOnSubmit(newQualityWorkSummaryReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改质量管理工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="qualityWorkSummaryReport"></param>
|
||||
public static void UpdateQualityWorkSummaryReport(Model.InformationProject_QualityWorkSummaryReport qualityWorkSummaryReport)
|
||||
{
|
||||
Model.InformationProject_QualityWorkSummaryReport newQualityWorkSummaryReport = Funs.DB.InformationProject_QualityWorkSummaryReport.FirstOrDefault(e => e.QualityWorkSummaryReportId == qualityWorkSummaryReport.QualityWorkSummaryReportId);
|
||||
if (newQualityWorkSummaryReport != null)
|
||||
{
|
||||
newQualityWorkSummaryReport.UnitId = qualityWorkSummaryReport.UnitId;
|
||||
newQualityWorkSummaryReport.YearId = qualityWorkSummaryReport.YearId;
|
||||
newQualityWorkSummaryReport.ResponsiblePerson = qualityWorkSummaryReport.ResponsiblePerson;
|
||||
newQualityWorkSummaryReport.ResponsiblePersonTel = qualityWorkSummaryReport.ResponsiblePersonTel;
|
||||
newQualityWorkSummaryReport.ContactPerson = qualityWorkSummaryReport.ContactPerson;
|
||||
newQualityWorkSummaryReport.ContactPersonTel = qualityWorkSummaryReport.ContactPersonTel;
|
||||
newQualityWorkSummaryReport.ReportDate = qualityWorkSummaryReport.ReportDate;
|
||||
newQualityWorkSummaryReport.Performance = qualityWorkSummaryReport.Performance;
|
||||
newQualityWorkSummaryReport.AccidentSituation = qualityWorkSummaryReport.AccidentSituation;
|
||||
newQualityWorkSummaryReport.Awards = qualityWorkSummaryReport.Awards;
|
||||
newQualityWorkSummaryReport.WorkDevelopment = qualityWorkSummaryReport.WorkDevelopment;
|
||||
newQualityWorkSummaryReport.PersonnelTraining = qualityWorkSummaryReport.PersonnelTraining;
|
||||
newQualityWorkSummaryReport.CheckSituation = qualityWorkSummaryReport.CheckSituation;
|
||||
newQualityWorkSummaryReport.ManagementActivity = qualityWorkSummaryReport.ManagementActivity;
|
||||
newQualityWorkSummaryReport.WorkExperience = qualityWorkSummaryReport.WorkExperience;
|
||||
newQualityWorkSummaryReport.Countermeasures = qualityWorkSummaryReport.Countermeasures;
|
||||
newQualityWorkSummaryReport.NextYearWorkPlan = qualityWorkSummaryReport.NextYearWorkPlan;
|
||||
newQualityWorkSummaryReport.JobSuggestion = qualityWorkSummaryReport.JobSuggestion;
|
||||
newQualityWorkSummaryReport.CompileMan = qualityWorkSummaryReport.CompileMan;
|
||||
newQualityWorkSummaryReport.CompileDate = qualityWorkSummaryReport.CompileDate;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除质量管理工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="QualityWorkSummaryReportId"></param>
|
||||
public static void DeleteQualityWorkSummaryReportById(string QualityWorkSummaryReportId)
|
||||
{
|
||||
Model.InformationProject_QualityWorkSummaryReport qualityWorkSummaryReport = Funs.DB.InformationProject_QualityWorkSummaryReport.FirstOrDefault(e => e.QualityWorkSummaryReportId == QualityWorkSummaryReportId);
|
||||
if (qualityWorkSummaryReport != null)
|
||||
{
|
||||
Funs.DB.InformationProject_QualityWorkSummaryReport.DeleteOnSubmit(qualityWorkSummaryReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 季度工程项目质量信息表
|
||||
/// </summary>
|
||||
public static class ProjectQuarterlyProjectQualityService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取季度工程项目质量信息表
|
||||
/// </summary>
|
||||
/// <param name="quarterlyProjectQualityId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.InformationProject_QuarterlyProjectQuality GetQuarterlyProjectQualityById(string quarterlyProjectQualityId)
|
||||
{
|
||||
return Funs.DB.InformationProject_QuarterlyProjectQuality.FirstOrDefault(e => e.QuarterlyProjectQualityId == quarterlyProjectQualityId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 季度工程项目质量信息表
|
||||
/// </summary>
|
||||
/// <param name="unitId">单位Id</param>
|
||||
/// <param name="year">年度</param>
|
||||
/// <returns>季度工程项目质量信息表</returns>
|
||||
public static Model.InformationProject_QuarterlyProjectQuality GetQuarterlyProjectQualityByUnitIdAndYearAndQuarter(string unitId, int year,int quarter)
|
||||
{
|
||||
return Funs.DB.InformationProject_QuarterlyProjectQuality.FirstOrDefault(e => e.UnitId == unitId && e.Year == year && e.Quarter == quarter);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加季度工程项目质量信息表
|
||||
/// </summary>
|
||||
/// <param name="quarterlyProjectQuality"></param>
|
||||
public static void AddQuarterlyProjectQuality(Model.InformationProject_QuarterlyProjectQuality quarterlyProjectQuality)
|
||||
{
|
||||
Model.InformationProject_QuarterlyProjectQuality newQuarterlyProjectQuality = new Model.InformationProject_QuarterlyProjectQuality
|
||||
{
|
||||
QuarterlyProjectQualityId = quarterlyProjectQuality.QuarterlyProjectQualityId,
|
||||
ProjectId = quarterlyProjectQuality.ProjectId,
|
||||
UnitId = quarterlyProjectQuality.UnitId,
|
||||
Year=quarterlyProjectQuality.Year,
|
||||
Quarter = quarterlyProjectQuality.Quarter,
|
||||
QualityManagePersonNum=quarterlyProjectQuality.QualityManagePersonNum,
|
||||
AdvancedTitlePersonNum=quarterlyProjectQuality.AdvancedTitlePersonNum,
|
||||
IntermediateTitlePersonNum=quarterlyProjectQuality.IntermediateTitlePersonNum,
|
||||
BeImplementedProjectNum=quarterlyProjectQuality.BeImplementedProjectNum,
|
||||
StartImplementedProjectNum=quarterlyProjectQuality.StartImplementedProjectNum,
|
||||
AccumulativeStartImplemented=quarterlyProjectQuality.AccumulativeStartImplemented,
|
||||
CompleteProjectNum=quarterlyProjectQuality.CompleteProjectNum,
|
||||
YearCompleteProjectNum = quarterlyProjectQuality.YearCompleteProjectNum,
|
||||
QuarterTotal= quarterlyProjectQuality.QuarterTotal,
|
||||
QuarterFirstPassNum=quarterlyProjectQuality.QuarterFirstPassNum,
|
||||
QuarterFirstPassRate=quarterlyProjectQuality.QuarterFirstPassRate,
|
||||
YearTotal=quarterlyProjectQuality.YearTotal,
|
||||
YearFirstPassNum=quarterlyProjectQuality.YearFirstPassNum,
|
||||
YearFirstPassRate=quarterlyProjectQuality.YearFirstPassRate,
|
||||
QuaterCheckSuperviseNum=quarterlyProjectQuality.QuaterCheckSuperviseNum,
|
||||
QuaterCorrectiveNoticeNum=quarterlyProjectQuality.QuaterCorrectiveNoticeNum,
|
||||
QuaterQualityProblemNum=quarterlyProjectQuality.QuaterQualityProblemNum,
|
||||
QuaterClosedQualityProblemNum=quarterlyProjectQuality.QuaterClosedQualityProblemNum,
|
||||
YearCheckSuperviseNum = quarterlyProjectQuality.YearCheckSuperviseNum,
|
||||
YearCorrectiveNoticeNum=quarterlyProjectQuality.YearCorrectiveNoticeNum,
|
||||
YearQualityProblemNum = quarterlyProjectQuality.YearQualityProblemNum,
|
||||
YearClosedQualityProblemNum=quarterlyProjectQuality.YearClosedQualityProblemNum,
|
||||
QuaterQualityAccidentNum = quarterlyProjectQuality.QuaterQualityAccidentNum,
|
||||
QuaterDirectEconomicLoss = quarterlyProjectQuality.QuaterDirectEconomicLoss,
|
||||
YearQualityAccidentNum = quarterlyProjectQuality.YearQualityAccidentNum,
|
||||
YearDirectEconomicLoss=quarterlyProjectQuality.YearDirectEconomicLoss,
|
||||
ResponsiblePerson=quarterlyProjectQuality.ResponsiblePerson,
|
||||
CompileMan = quarterlyProjectQuality.CompileMan,
|
||||
CompileDate = quarterlyProjectQuality.CompileDate,
|
||||
Tel=quarterlyProjectQuality.Tel
|
||||
};
|
||||
Funs.DB.InformationProject_QuarterlyProjectQuality.InsertOnSubmit(newQuarterlyProjectQuality);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改季度工程项目质量信息表
|
||||
/// </summary>
|
||||
/// <param name="quarterlyProjectQuality"></param>
|
||||
public static void UpdateQuarterlyProjectQuality(Model.InformationProject_QuarterlyProjectQuality quarterlyProjectQuality)
|
||||
{
|
||||
Model.InformationProject_QuarterlyProjectQuality newQuarterlyProjectQuality = Funs.DB.InformationProject_QuarterlyProjectQuality.FirstOrDefault(e => e.QuarterlyProjectQualityId == quarterlyProjectQuality.QuarterlyProjectQualityId);
|
||||
if (newQuarterlyProjectQuality != null)
|
||||
{
|
||||
newQuarterlyProjectQuality.UnitId = quarterlyProjectQuality.UnitId;
|
||||
newQuarterlyProjectQuality.Year = quarterlyProjectQuality.Year;
|
||||
newQuarterlyProjectQuality.Quarter = quarterlyProjectQuality.Quarter;
|
||||
newQuarterlyProjectQuality.QualityManagePersonNum = quarterlyProjectQuality.QualityManagePersonNum;
|
||||
newQuarterlyProjectQuality.AdvancedTitlePersonNum = quarterlyProjectQuality.AdvancedTitlePersonNum;
|
||||
newQuarterlyProjectQuality.IntermediateTitlePersonNum = quarterlyProjectQuality.IntermediateTitlePersonNum;
|
||||
newQuarterlyProjectQuality.BeImplementedProjectNum = quarterlyProjectQuality.BeImplementedProjectNum;
|
||||
newQuarterlyProjectQuality.StartImplementedProjectNum = quarterlyProjectQuality.StartImplementedProjectNum;
|
||||
newQuarterlyProjectQuality.AccumulativeStartImplemented = quarterlyProjectQuality.AccumulativeStartImplemented;
|
||||
newQuarterlyProjectQuality.CompleteProjectNum = quarterlyProjectQuality.CompleteProjectNum;
|
||||
newQuarterlyProjectQuality.YearCompleteProjectNum = quarterlyProjectQuality.YearCompleteProjectNum;
|
||||
newQuarterlyProjectQuality.QuarterTotal = quarterlyProjectQuality.QuarterTotal;
|
||||
newQuarterlyProjectQuality.QuarterFirstPassNum = quarterlyProjectQuality.QuarterFirstPassNum;
|
||||
newQuarterlyProjectQuality.QuarterFirstPassRate = quarterlyProjectQuality.QuarterFirstPassRate;
|
||||
newQuarterlyProjectQuality.YearTotal = quarterlyProjectQuality.YearTotal;
|
||||
newQuarterlyProjectQuality.YearFirstPassNum = quarterlyProjectQuality.YearFirstPassNum;
|
||||
newQuarterlyProjectQuality.YearFirstPassRate = quarterlyProjectQuality.YearFirstPassRate;
|
||||
newQuarterlyProjectQuality.QuaterCheckSuperviseNum = quarterlyProjectQuality.QuaterCheckSuperviseNum;
|
||||
newQuarterlyProjectQuality.QuaterCorrectiveNoticeNum = quarterlyProjectQuality.QuaterCorrectiveNoticeNum;
|
||||
newQuarterlyProjectQuality.QuaterQualityProblemNum = quarterlyProjectQuality.QuaterQualityProblemNum;
|
||||
newQuarterlyProjectQuality.QuaterClosedQualityProblemNum = quarterlyProjectQuality.QuaterClosedQualityProblemNum;
|
||||
newQuarterlyProjectQuality.YearCheckSuperviseNum = quarterlyProjectQuality.YearCheckSuperviseNum;
|
||||
newQuarterlyProjectQuality.YearCorrectiveNoticeNum = quarterlyProjectQuality.YearCorrectiveNoticeNum;
|
||||
newQuarterlyProjectQuality.YearQualityProblemNum = quarterlyProjectQuality.YearQualityProblemNum;
|
||||
newQuarterlyProjectQuality.YearClosedQualityProblemNum = quarterlyProjectQuality.YearClosedQualityProblemNum;
|
||||
newQuarterlyProjectQuality.QuaterQualityAccidentNum = quarterlyProjectQuality.QuaterQualityAccidentNum;
|
||||
newQuarterlyProjectQuality.QuaterDirectEconomicLoss = quarterlyProjectQuality.QuaterDirectEconomicLoss;
|
||||
newQuarterlyProjectQuality.YearQualityAccidentNum = quarterlyProjectQuality.YearQualityAccidentNum;
|
||||
newQuarterlyProjectQuality.YearDirectEconomicLoss = quarterlyProjectQuality.YearDirectEconomicLoss;
|
||||
newQuarterlyProjectQuality.ResponsiblePerson = quarterlyProjectQuality.ResponsiblePerson;
|
||||
newQuarterlyProjectQuality.CompileMan = quarterlyProjectQuality.CompileMan;
|
||||
newQuarterlyProjectQuality.CompileDate = quarterlyProjectQuality.CompileDate;
|
||||
newQuarterlyProjectQuality.Tel = quarterlyProjectQuality.Tel;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除季度工程项目质量信息表
|
||||
/// </summary>
|
||||
/// <param name="QuarterlyProjectQualityId"></param>
|
||||
public static void DeleteQuarterlyProjectQualityById(string QuarterlyProjectQualityId)
|
||||
{
|
||||
Model.InformationProject_QuarterlyProjectQuality quarterlyProjectQuality = Funs.DB.InformationProject_QuarterlyProjectQuality.FirstOrDefault(e => e.QuarterlyProjectQualityId == QuarterlyProjectQualityId);
|
||||
if (quarterlyProjectQuality != null)
|
||||
{
|
||||
Funs.DB.InformationProject_QuarterlyProjectQuality.DeleteOnSubmit(quarterlyProjectQuality);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -637,6 +637,9 @@ namespace BLL
|
||||
/// <returns></returns>
|
||||
public static string CreateGetHttpResponse(string url)
|
||||
{
|
||||
ServicePointManager.Expect100Continue = true;
|
||||
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;
|
||||
ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;
|
||||
HttpWebRequest request = WebRequest.Create(url) as HttpWebRequest;//创建请求对象
|
||||
request.Method = "Get";//请求方式
|
||||
request.ContentType = "application/x-www-form-urlencoded";//链接类型
|
||||
|
||||
@@ -344,6 +344,8 @@ namespace BLL
|
||||
/// 温度设置
|
||||
/// </summary>
|
||||
public const string HJGL_TemperatureSetMenuId = "A083BF37-745F-409F-9C3A-BC2FBC755757";
|
||||
|
||||
public const string Base_FactoryMenuId = "CD167198-1667-4552-9876-E768C2542C30";
|
||||
#endregion
|
||||
|
||||
#region 人员管理
|
||||
@@ -922,6 +924,16 @@ namespace BLL
|
||||
#endregion
|
||||
|
||||
#region 内置岗位
|
||||
/// <summary>
|
||||
/// 安全总监岗位Id
|
||||
/// </summary>
|
||||
public static string WorkPost_HSSEDirector = "8A7C2CDF-AFB5-4826-9951-343253342DAC";
|
||||
|
||||
/// <summary>
|
||||
/// 项目安全总监岗位Id
|
||||
/// </summary>
|
||||
public static string WorkPost_ProjectHSSEDirector = "5e6e259e-ea0a-4a63-8f52-df4a19a6c9fa";
|
||||
|
||||
/// <summary>
|
||||
/// HSE工程师岗位Id
|
||||
/// </summary>
|
||||
@@ -2315,6 +2327,11 @@ namespace BLL
|
||||
/// 人员信息
|
||||
/// </summary>
|
||||
public const string PersonListMenuId = "AD6FC259-CF40-41C7-BA3F-15AC50C1DD20";
|
||||
/// <summary>
|
||||
/// 人员请假信息
|
||||
/// </summary>
|
||||
public const string PersonAskForLeaveListMenuId = "1D9BC5A9-6CFF-4C38-BA69-D48BFAE6DDB3";
|
||||
|
||||
/// <summary>
|
||||
/// 人员项目转换
|
||||
/// </summary>
|
||||
@@ -3236,6 +3253,115 @@ namespace BLL
|
||||
/// 同步记录
|
||||
/// </summary>
|
||||
public const string RealNameSynchroRecordMenuId = "F36E6C54-E39F-4032-874D-548EE090A35B";
|
||||
/// <summary>
|
||||
/// 安全管理工作总结报告
|
||||
/// </summary>
|
||||
public const string ReportType_6 = "11";
|
||||
|
||||
/// <summary>
|
||||
/// 质量管理工作总结报告
|
||||
/// </summary>
|
||||
public const string ReportType_7 = "12";
|
||||
|
||||
/// <summary>
|
||||
/// 实业安全简报
|
||||
/// </summary>
|
||||
public const string ReportType_8 = "13";
|
||||
|
||||
/// <summary>
|
||||
/// 季度工程项目质量信息表
|
||||
/// </summary>
|
||||
public const string ReportType_9 = "14";
|
||||
|
||||
/// <summary>
|
||||
/// 生态环保工作总结报告
|
||||
/// </summary>
|
||||
public const string ReportType_10 = "15";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 化工行业能源节约与生态环境保护汇总表
|
||||
/// </summary>
|
||||
public const string ChemicalReportMenuId = "ECDD89AC-1E16-4D82-B3BE-5D62F31B7A14";
|
||||
|
||||
/// <summary>
|
||||
/// 建筑行业能源节约与生态环境保护汇总表
|
||||
/// </summary>
|
||||
public const string ArchitectureReportMenuId = "7C47F078-D4C9-40D9-BEEF-E657EAFEC650";
|
||||
|
||||
public const string ProjectOperationReportMenuId = "EFA6E45F-1267-4804-BEE7-41E0C5461204";
|
||||
public const string OperationReportMenuId = "7652D239-1897-4886-8DF2-B71E3B060D21";
|
||||
|
||||
/// <summary>
|
||||
/// 节能环保产业企业生产和服务业务情况报表
|
||||
/// </summary>
|
||||
public const string EnergyReportMenuId = "30579BFE-AB4B-49A7-A73D-B7CE902A8B69";
|
||||
|
||||
/// <summary>
|
||||
/// 安全管理工作总结报告
|
||||
/// </summary>
|
||||
public const string WorkSummaryReportMenuId = "07FEEC9D-09C1-4C19-9269-62F69532086C";
|
||||
|
||||
/// <summary>
|
||||
/// 质量管理工作总结报告
|
||||
/// </summary>
|
||||
public const string QualityWorkSummaryReportMenuId = "12941594-2171-411A-8CC8-32E3BD9FCDDF";
|
||||
|
||||
/// <summary>
|
||||
/// 实业安全简报
|
||||
/// </summary>
|
||||
public const string SafetyBriefingMenuId = "AAC7C263-6E25-49DC-985B-DC3FA7AAF3A1";
|
||||
|
||||
/// <summary>
|
||||
/// 季度工程项目质量信息表
|
||||
/// </summary>
|
||||
public const string QuarterlyProjectQualityMenuId = "CF9C1F00-34B8-42E5-B2D1-704094169CA3";
|
||||
|
||||
/// <summary>
|
||||
/// 生态环保工作总结报告
|
||||
/// </summary>
|
||||
public const string EPSummaryReportMenuId = "5B344750-79DD-40AA-8AA7-34B04E41FA72";
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 安全管理工作总结报告
|
||||
/// </summary>
|
||||
public const string ProjectWorkSummaryReportMenuId = "FB174DD6-CBAE-43AF-9356-B098A17B719D";
|
||||
|
||||
/// <summary>
|
||||
/// 质量管理工作总结报告
|
||||
/// </summary>
|
||||
public const string ProjectQualitySummaryReportMenuId = "1443C901-A9C3-4CCC-B858-55512DE8C5CA";
|
||||
|
||||
/// <summary>
|
||||
/// 季度工程项目质量信息表
|
||||
/// </summary>
|
||||
public const string ProjectQuarterlyProjectQualityMenuId = "267064F1-88F7-4468-998A-49A1A2F25BB8";
|
||||
|
||||
/// <summary>
|
||||
/// 实业安全简报
|
||||
/// </summary>
|
||||
public const string ProjectSafetyBriefingMenuId = "86F71934-7149-470E-BEAB-FFDC5BF3C0F2";
|
||||
|
||||
/// 化工行业能源节约与生态环境保护汇总表
|
||||
/// </summary>
|
||||
public const string ProjectChemicalReportMenuId = "A44E98F6-E9FE-43F8-8349-C166263BF608";
|
||||
|
||||
/// <summary>
|
||||
/// 建筑行业能源节约与生态环境保护汇总表
|
||||
/// </summary>
|
||||
public const string ProjectArchitectureReportMenuId = "25CE6894-2840-4DC4-AD2E-D72292849CEE";
|
||||
|
||||
/// <summary>
|
||||
/// 生态环保工作总结报告
|
||||
/// </summary>
|
||||
public const string ProjectEPSummaryReportMenuId = "FD572EFA-8E87-43D1-B514-25A39768106F";
|
||||
|
||||
/// <summary>
|
||||
/// 节能环保产业企业生产和服务业务情况报表(项目级)
|
||||
/// </summary>
|
||||
public const string ProjectEnergyReportMenuId = "9DE996D9-A2CF-40C8-86D3-6A472AB30E5D";
|
||||
|
||||
#endregion
|
||||
|
||||
#region 劳务实名制
|
||||
@@ -5784,6 +5910,12 @@ namespace BLL
|
||||
/// 实业数据
|
||||
/// </summary>
|
||||
public const string SYHSEData_SYHSEMenuId = "64EE5EC2-F725-4656-9110-5AF83C18FB6C";
|
||||
/// <summary>
|
||||
/// 实业
|
||||
/// </summary>
|
||||
public const string SYHSEData_DataMenuId = "S89E5EC2-F725-4656-9110-5AF83C18FB6C";
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 数据同步状态
|
||||
|
||||
@@ -32,6 +32,7 @@ namespace BLL
|
||||
newFile.Remark = file.Remark;
|
||||
newFile.AttachUrl = file.AttachUrl;
|
||||
newFile.ToMenu = file.ToMenu;
|
||||
newFile.ProjectId = file.ProjectId;
|
||||
Funs.DB.Common_FileManager.InsertOnSubmit(newFile);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
@@ -50,6 +51,7 @@ namespace BLL
|
||||
newFile.UploadDate = file.UploadDate;
|
||||
newFile.ToMenu = file.ToMenu;
|
||||
newFile.Remark = file.Remark;
|
||||
newFile.ProjectId = file.ProjectId;
|
||||
newFile.AttachUrl = file.AttachUrl;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
@@ -1451,7 +1451,14 @@
|
||||
|
||||
sb.Append("<table width=\"100% \" cellspacing=\"0\" rules=\"all\" border=\"0\" style=\"border-collapse:collapse;font-size: 10.5pt;\">");
|
||||
sb.Append("<tr style=\"height: 35px\">");
|
||||
sb.AppendFormat("<td align=\"left\" style=\"width:25%; \">{0}</td> ", "姓名:" + testName);
|
||||
if (!string.IsNullOrEmpty(getTestRecord.Signature))
|
||||
{
|
||||
sb.AppendFormat("<td align=\"left\" style=\"width:25%; \"><img width='91' height='30' src='" + (Funs.SGGLUrl + getTestRecord.Signature).Replace('\\', '/') + "'></img></td> ");
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendFormat("<td align=\"left\" style=\"width:25%; \">{0}</td> ", "姓名:" + testName);
|
||||
}
|
||||
sb.AppendFormat("<td align=\"left\" style=\"width:50%;\">{0}</td> ", "身份证号:" + idCard);
|
||||
sb.AppendFormat("<td align=\"left\" style=\"width:25%;\">{0}</td> ", "分数:" + (getTestRecord.TestScores ?? 0).ToString());
|
||||
sb.Append("</tr>");
|
||||
@@ -1493,6 +1500,10 @@
|
||||
|
||||
}
|
||||
sb.AppendFormat("<td align=\"left\" style=\"width:100%; \">{0}</td> ", str);
|
||||
|
||||
sb.Append("</tr>");
|
||||
sb.Append("<tr style=\"height: 30px\">");
|
||||
sb.AppendFormat("<td align=\"right\" style=\"width:100%; \">正确答案:{0}</td> ", item.AnswerItems);
|
||||
sb.Append("</tr>");
|
||||
num++;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,10 @@ namespace BLL
|
||||
{
|
||||
return Funs.DB.HSSE_Hazard_HazardRegister.FirstOrDefault(x => x.HazardRegisterId == hazardRegisterId);
|
||||
}
|
||||
|
||||
public static Model.HSSE_Hazard_HazardRegister GetHazardRegisterByCheckItemDetailId(string hazardRegisterId)
|
||||
{
|
||||
return Funs.DB.HSSE_Hazard_HazardRegister.FirstOrDefault(x => x.CheckItemDetailId == hazardRegisterId);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取项目风险列表
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 生态环保工作总结报告
|
||||
/// </summary>
|
||||
public static class ProjectEPSummaryReportService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取生态环保工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="ePSummaryReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.InformationProject_EPSummaryReport GetEPSummaryReportById(string ePSummaryReportId)
|
||||
{
|
||||
return Funs.DB.InformationProject_EPSummaryReport.FirstOrDefault(e => e.EPSummaryReportId == ePSummaryReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加生态环保工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="ePSummaryReport"></param>
|
||||
public static void AddEPSummaryReport(Model.InformationProject_EPSummaryReport ePSummaryReport)
|
||||
{
|
||||
Model.InformationProject_EPSummaryReport newReport = new Model.InformationProject_EPSummaryReport
|
||||
{
|
||||
EPSummaryReportId = ePSummaryReport.EPSummaryReportId,
|
||||
ProjectId = ePSummaryReport.ProjectId,
|
||||
UnitId = ePSummaryReport.UnitId,
|
||||
YearId = ePSummaryReport.YearId,
|
||||
ResponsiblePerson = ePSummaryReport.ResponsiblePerson,
|
||||
ResponsiblePersonTel = ePSummaryReport.ResponsiblePersonTel,
|
||||
ContactPerson = ePSummaryReport.ContactPerson,
|
||||
ContactPersonTel = ePSummaryReport.ContactPersonTel,
|
||||
ReportDate = ePSummaryReport.ReportDate,
|
||||
Description1 = ePSummaryReport.Description1,
|
||||
Description2 = ePSummaryReport.Description2,
|
||||
Description3 = ePSummaryReport.Description3,
|
||||
Description4 = ePSummaryReport.Description4,
|
||||
Description5 = ePSummaryReport.Description5,
|
||||
Description6 = ePSummaryReport.Description6,
|
||||
Description7 = ePSummaryReport.Description7,
|
||||
Description8 = ePSummaryReport.Description8,
|
||||
Description9 = ePSummaryReport.Description9
|
||||
};
|
||||
Funs.DB.InformationProject_EPSummaryReport.InsertOnSubmit(newReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改生态环保工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="ePSummaryReport"></param>
|
||||
public static void UpdateEPSummaryReport(Model.InformationProject_EPSummaryReport ePSummaryReport)
|
||||
{
|
||||
Model.InformationProject_EPSummaryReport newReport = Funs.DB.InformationProject_EPSummaryReport.FirstOrDefault(e => e.EPSummaryReportId == ePSummaryReport.EPSummaryReportId);
|
||||
if (newReport != null)
|
||||
{
|
||||
newReport.UnitId = ePSummaryReport.UnitId;
|
||||
newReport.YearId = ePSummaryReport.YearId;
|
||||
newReport.ResponsiblePerson = ePSummaryReport.ResponsiblePerson;
|
||||
newReport.ResponsiblePersonTel = ePSummaryReport.ResponsiblePersonTel;
|
||||
newReport.ContactPerson = ePSummaryReport.ContactPerson;
|
||||
newReport.ContactPersonTel = ePSummaryReport.ContactPersonTel;
|
||||
newReport.ReportDate = ePSummaryReport.ReportDate;
|
||||
newReport.Description1 = ePSummaryReport.Description1;
|
||||
newReport.Description2 = ePSummaryReport.Description2;
|
||||
newReport.Description3 = ePSummaryReport.Description3;
|
||||
newReport.Description4 = ePSummaryReport.Description4;
|
||||
newReport.Description5 = ePSummaryReport.Description5;
|
||||
newReport.Description6 = ePSummaryReport.Description6;
|
||||
newReport.Description7 = ePSummaryReport.Description7;
|
||||
newReport.Description8 = ePSummaryReport.Description8;
|
||||
newReport.Description9 = ePSummaryReport.Description9;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除生态环保工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="ePSummaryReportId"></param>
|
||||
public static void DeleteEPSummaryReportById(string ePSummaryReportId)
|
||||
{
|
||||
Model.InformationProject_EPSummaryReport ePSummaryReport = Funs.DB.InformationProject_EPSummaryReport.FirstOrDefault(e => e.EPSummaryReportId == ePSummaryReportId);
|
||||
if (ePSummaryReport != null)
|
||||
{
|
||||
Funs.DB.InformationProject_EPSummaryReport.DeleteOnSubmit(ePSummaryReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,14 +6,14 @@ using System.Text;
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 百万工时安全统计月报
|
||||
/// 企业安全数据统计月报
|
||||
/// </summary>
|
||||
public static class ProjectMillionsMonthlyReportService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取百万工时安全统计月报
|
||||
/// 根据主键获取企业安全数据统计月报
|
||||
/// </summary>
|
||||
/// <param name="millionsMonthlyReport"></param>
|
||||
/// <returns></returns>
|
||||
@@ -23,7 +23,7 @@ namespace BLL
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加百万工时安全统计月报
|
||||
/// 添加企业安全数据统计月报
|
||||
/// </summary>
|
||||
/// <param name="millionsMonthlyReport"></param>
|
||||
public static void AddMillionsMonthlyReport(Model.InformationProject_MillionsMonthlyReport millionsMonthlyReport)
|
||||
@@ -45,6 +45,9 @@ namespace BLL
|
||||
ContractorNum = millionsMonthlyReport.ContractorNum,
|
||||
SumPersonNum = millionsMonthlyReport.SumPersonNum,
|
||||
TotalWorkNum = millionsMonthlyReport.TotalWorkNum,
|
||||
DeathAccidentNum = millionsMonthlyReport.DeathAccidentNum,
|
||||
DeathAccidentPersonNum = millionsMonthlyReport.DeathAccidentPersonNum,
|
||||
DeathAccidentLossHour = millionsMonthlyReport.DeathAccidentLossHour,
|
||||
SeriousInjuriesNum = millionsMonthlyReport.SeriousInjuriesNum,
|
||||
SeriousInjuriesPersonNum = millionsMonthlyReport.SeriousInjuriesPersonNum,
|
||||
SeriousInjuriesLossHour = millionsMonthlyReport.SeriousInjuriesLossHour,
|
||||
@@ -60,20 +63,37 @@ namespace BLL
|
||||
MedicalTreatmentLossHour = millionsMonthlyReport.MedicalTreatmentLossHour,
|
||||
FireNum = millionsMonthlyReport.FireNum,
|
||||
ExplosionNum = millionsMonthlyReport.ExplosionNum,
|
||||
EnvironmenNum = millionsMonthlyReport.EnvironmenNum,
|
||||
TrafficNum = millionsMonthlyReport.TrafficNum,
|
||||
EquipmentNum = millionsMonthlyReport.EquipmentNum,
|
||||
QualityNum = millionsMonthlyReport.QualityNum,
|
||||
OtherNum = millionsMonthlyReport.OtherNum,
|
||||
FirstAidDressingsNum = millionsMonthlyReport.FirstAidDressingsNum,
|
||||
AttemptedEventNum = millionsMonthlyReport.AttemptedEventNum,
|
||||
LossDayNum = millionsMonthlyReport.LossDayNum
|
||||
LossDayNum = millionsMonthlyReport.LossDayNum,
|
||||
InputCosts = millionsMonthlyReport.InputCosts,
|
||||
TrainNum = millionsMonthlyReport.TrainNum,
|
||||
GeneralHazardNum = millionsMonthlyReport.GeneralHazardNum,
|
||||
MajorHazardNum = millionsMonthlyReport.MajorHazardNum,
|
||||
NotProofLargeProjectNum = millionsMonthlyReport.NotProofLargeProjectNum,
|
||||
ProofLargeProjectNum = millionsMonthlyReport.ProofLargeProjectNum,
|
||||
FireLicenseNum = millionsMonthlyReport.FireLicenseNum,
|
||||
LimitLicenseNum = millionsMonthlyReport.LimitLicenseNum,
|
||||
HighLicenseNum = millionsMonthlyReport.HighLicenseNum,
|
||||
HoistingLicenseNum = millionsMonthlyReport.HoistingLicenseNum,
|
||||
BreakGroundLicenseNum = millionsMonthlyReport.BreakGroundLicenseNum,
|
||||
ElectricityLicenseNum = millionsMonthlyReport.ElectricityLicenseNum,
|
||||
RTLicenseNum = millionsMonthlyReport.RTLicenseNum,
|
||||
NightLicenseNum = millionsMonthlyReport.NightLicenseNum,
|
||||
CommissionerNum = millionsMonthlyReport.CommissionerNum,
|
||||
SoleDutyNum = millionsMonthlyReport.SoleDutyNum,
|
||||
};
|
||||
db.InformationProject_MillionsMonthlyReport.InsertOnSubmit(newMillionsMonthlyReport);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改百万工时安全统计月报
|
||||
/// 修改企业安全数据统计月报
|
||||
/// </summary>
|
||||
/// <param name="millionsMonthlyReport"></param>
|
||||
public static void UpdateMillionsMonthlyReport(Model.InformationProject_MillionsMonthlyReport millionsMonthlyReport)
|
||||
@@ -95,6 +115,9 @@ namespace BLL
|
||||
newMillionsMonthlyReport.ContractorNum = millionsMonthlyReport.ContractorNum;
|
||||
newMillionsMonthlyReport.SumPersonNum = millionsMonthlyReport.SumPersonNum;
|
||||
newMillionsMonthlyReport.TotalWorkNum = millionsMonthlyReport.TotalWorkNum;
|
||||
newMillionsMonthlyReport.DeathAccidentNum = millionsMonthlyReport.DeathAccidentNum;
|
||||
newMillionsMonthlyReport.DeathAccidentPersonNum = millionsMonthlyReport.DeathAccidentPersonNum;
|
||||
newMillionsMonthlyReport.DeathAccidentLossHour = millionsMonthlyReport.DeathAccidentLossHour;
|
||||
newMillionsMonthlyReport.SeriousInjuriesNum = millionsMonthlyReport.SeriousInjuriesNum;
|
||||
newMillionsMonthlyReport.SeriousInjuriesPersonNum = millionsMonthlyReport.SeriousInjuriesPersonNum;
|
||||
newMillionsMonthlyReport.SeriousInjuriesLossHour = millionsMonthlyReport.SeriousInjuriesLossHour;
|
||||
@@ -110,6 +133,7 @@ namespace BLL
|
||||
newMillionsMonthlyReport.MedicalTreatmentLossHour = millionsMonthlyReport.MedicalTreatmentLossHour;
|
||||
newMillionsMonthlyReport.FireNum = millionsMonthlyReport.FireNum;
|
||||
newMillionsMonthlyReport.ExplosionNum = millionsMonthlyReport.ExplosionNum;
|
||||
newMillionsMonthlyReport.EnvironmenNum = millionsMonthlyReport.EnvironmenNum;
|
||||
newMillionsMonthlyReport.TrafficNum = millionsMonthlyReport.TrafficNum;
|
||||
newMillionsMonthlyReport.EquipmentNum = millionsMonthlyReport.EquipmentNum;
|
||||
newMillionsMonthlyReport.QualityNum = millionsMonthlyReport.QualityNum;
|
||||
@@ -117,12 +141,29 @@ namespace BLL
|
||||
newMillionsMonthlyReport.FirstAidDressingsNum = millionsMonthlyReport.FirstAidDressingsNum;
|
||||
newMillionsMonthlyReport.AttemptedEventNum = millionsMonthlyReport.AttemptedEventNum;
|
||||
newMillionsMonthlyReport.LossDayNum = millionsMonthlyReport.LossDayNum;
|
||||
newMillionsMonthlyReport.InputCosts = millionsMonthlyReport.InputCosts;
|
||||
newMillionsMonthlyReport.TrainNum = millionsMonthlyReport.TrainNum;
|
||||
newMillionsMonthlyReport.GeneralHazardNum = millionsMonthlyReport.GeneralHazardNum;
|
||||
newMillionsMonthlyReport.MajorHazardNum = millionsMonthlyReport.MajorHazardNum;
|
||||
newMillionsMonthlyReport.NotProofLargeProjectNum = millionsMonthlyReport.NotProofLargeProjectNum;
|
||||
newMillionsMonthlyReport.ProofLargeProjectNum = millionsMonthlyReport.ProofLargeProjectNum;
|
||||
newMillionsMonthlyReport.FireLicenseNum = millionsMonthlyReport.FireLicenseNum;
|
||||
newMillionsMonthlyReport.LimitLicenseNum = millionsMonthlyReport.LimitLicenseNum;
|
||||
newMillionsMonthlyReport.HighLicenseNum = millionsMonthlyReport.HighLicenseNum;
|
||||
newMillionsMonthlyReport.HoistingLicenseNum = millionsMonthlyReport.HoistingLicenseNum;
|
||||
newMillionsMonthlyReport.BreakGroundLicenseNum = millionsMonthlyReport.BreakGroundLicenseNum;
|
||||
newMillionsMonthlyReport.ElectricityLicenseNum = millionsMonthlyReport.ElectricityLicenseNum;
|
||||
newMillionsMonthlyReport.RTLicenseNum = millionsMonthlyReport.RTLicenseNum;
|
||||
newMillionsMonthlyReport.NightLicenseNum = millionsMonthlyReport.NightLicenseNum;
|
||||
newMillionsMonthlyReport.CommissionerNum = millionsMonthlyReport.CommissionerNum;
|
||||
newMillionsMonthlyReport.SoleDutyNum = millionsMonthlyReport.SoleDutyNum;
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除百万工时安全统计月报
|
||||
/// 根据主键删除企业安全数据统计月报
|
||||
/// </summary>
|
||||
/// <param name="millionsMonthlyReportId"></param>
|
||||
public static void DeleteMillionsMonthlyReportById(string millionsMonthlyReportId)
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 安全管理工作总结报告
|
||||
/// </summary>
|
||||
public static class ProjectWorkSummaryReportService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取安全管理工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="workSummaryReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.InformationProject_WorkSummaryReport GetWorkSummaryReportById(string workSummaryReportId)
|
||||
{
|
||||
return Funs.DB.InformationProject_WorkSummaryReport.FirstOrDefault(e => e.WorkSummaryReportId == workSummaryReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加安全管理工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="workSummaryReport"></param>
|
||||
public static void AddWorkSummaryReport(Model.InformationProject_WorkSummaryReport workSummaryReport)
|
||||
{
|
||||
Model.InformationProject_WorkSummaryReport newWorkSummaryReport = new Model.InformationProject_WorkSummaryReport
|
||||
{
|
||||
WorkSummaryReportId = workSummaryReport.WorkSummaryReportId,
|
||||
ProjectId=workSummaryReport.ProjectId,
|
||||
YearId = workSummaryReport.YearId,
|
||||
UnitId = workSummaryReport.UnitId,
|
||||
ResponsiblePerson = workSummaryReport.ResponsiblePerson,
|
||||
ResponsiblePersonTel = workSummaryReport.ResponsiblePersonTel,
|
||||
ContactPerson = workSummaryReport.ContactPerson,
|
||||
ContactPersonTel = workSummaryReport.ContactPersonTel,
|
||||
ReportDate = workSummaryReport.ReportDate,
|
||||
SafeLaborTime = workSummaryReport.SafeLaborTime,
|
||||
SafetyObjectives = workSummaryReport.SafetyObjectives,
|
||||
AccidentSituation = workSummaryReport.AccidentSituation,
|
||||
Awards = workSummaryReport.Awards,
|
||||
WorkDevelopment = workSummaryReport.WorkDevelopment,
|
||||
PersonnelTraining = workSummaryReport.PersonnelTraining,
|
||||
GovernanceSituation = workSummaryReport.GovernanceSituation,
|
||||
ManagementActivity = workSummaryReport.ManagementActivity,
|
||||
WorkExperience = workSummaryReport.WorkExperience,
|
||||
Countermeasures = workSummaryReport.Countermeasures,
|
||||
NextYearWorkPlan = workSummaryReport.NextYearWorkPlan,
|
||||
JobSuggestion = workSummaryReport.JobSuggestion,
|
||||
CompileMan=workSummaryReport.CompileMan,
|
||||
CompileDate=workSummaryReport.CompileDate
|
||||
};
|
||||
Funs.DB.InformationProject_WorkSummaryReport.InsertOnSubmit(newWorkSummaryReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改安全管理工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="workSummaryReport"></param>
|
||||
public static void UpdateWorkSummaryReport(Model.InformationProject_WorkSummaryReport workSummaryReport)
|
||||
{
|
||||
Model.InformationProject_WorkSummaryReport newWorkSummaryReport = Funs.DB.InformationProject_WorkSummaryReport.FirstOrDefault(e => e.WorkSummaryReportId == workSummaryReport.WorkSummaryReportId);
|
||||
if (newWorkSummaryReport != null)
|
||||
{
|
||||
newWorkSummaryReport.UnitId = workSummaryReport.UnitId;
|
||||
newWorkSummaryReport.YearId = workSummaryReport.YearId;
|
||||
newWorkSummaryReport.ResponsiblePerson = workSummaryReport.ResponsiblePerson;
|
||||
newWorkSummaryReport.ResponsiblePersonTel = workSummaryReport.ResponsiblePersonTel;
|
||||
newWorkSummaryReport.ContactPerson = workSummaryReport.ContactPerson;
|
||||
newWorkSummaryReport.ContactPersonTel = workSummaryReport.ContactPersonTel;
|
||||
newWorkSummaryReport.ReportDate = workSummaryReport.ReportDate;
|
||||
newWorkSummaryReport.SafeLaborTime = workSummaryReport.SafeLaborTime;
|
||||
newWorkSummaryReport.SafetyObjectives = workSummaryReport.SafetyObjectives;
|
||||
newWorkSummaryReport.AccidentSituation = workSummaryReport.AccidentSituation;
|
||||
newWorkSummaryReport.Awards = workSummaryReport.Awards;
|
||||
newWorkSummaryReport.WorkDevelopment = workSummaryReport.WorkDevelopment;
|
||||
newWorkSummaryReport.PersonnelTraining = workSummaryReport.PersonnelTraining;
|
||||
newWorkSummaryReport.GovernanceSituation = workSummaryReport.GovernanceSituation;
|
||||
newWorkSummaryReport.ManagementActivity = workSummaryReport.ManagementActivity;
|
||||
newWorkSummaryReport.WorkExperience = workSummaryReport.WorkExperience;
|
||||
newWorkSummaryReport.Countermeasures = workSummaryReport.Countermeasures;
|
||||
newWorkSummaryReport.NextYearWorkPlan = workSummaryReport.NextYearWorkPlan;
|
||||
newWorkSummaryReport.JobSuggestion = workSummaryReport.JobSuggestion;
|
||||
newWorkSummaryReport.CompileMan = workSummaryReport.CompileMan;
|
||||
newWorkSummaryReport.CompileDate = workSummaryReport.CompileDate;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除安全管理工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="workSummaryReportId"></param>
|
||||
public static void DeleteWorkSummaryReportById(string workSummaryReportId)
|
||||
{
|
||||
Model.InformationProject_WorkSummaryReport workSummaryReport = Funs.DB.InformationProject_WorkSummaryReport.FirstOrDefault(e => e.WorkSummaryReportId == workSummaryReportId);
|
||||
if (workSummaryReport != null)
|
||||
{
|
||||
Funs.DB.InformationProject_WorkSummaryReport.DeleteOnSubmit(workSummaryReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
}
|
||||
public static Model.Base_Project GetProjectByProjectCode(string code)
|
||||
{
|
||||
return Funs.DB.Base_Project.FirstOrDefault(e => e.ProjectCode == code);
|
||||
return Funs.DB.Base_Project.FirstOrDefault(e => e.ProjectCode == code || e.ProjectNum==code);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -94,6 +94,7 @@
|
||||
Model.Base_Project newProject = new Base_Project
|
||||
{
|
||||
ProjectId = project.ProjectId,
|
||||
ProjectNum= project.ProjectNum,
|
||||
ProjectCode = project.ProjectCode,
|
||||
ProjectName = project.ProjectName,
|
||||
StartDate = project.StartDate,
|
||||
@@ -141,6 +142,7 @@
|
||||
{
|
||||
newProject.ProjectCode = project.ProjectCode;
|
||||
newProject.ProjectName = project.ProjectName;
|
||||
newProject.ProjectNum = project.ProjectNum;
|
||||
newProject.StartDate = project.StartDate;
|
||||
newProject.EndDate = project.EndDate;
|
||||
newProject.ProjectAddress = project.ProjectAddress;
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 实业安全简报
|
||||
/// </summary>
|
||||
public static class InformationProject_SafetyBriefingService
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取实业安全简报
|
||||
/// </summary>
|
||||
/// <param name="safetyBriefingId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.InformationProject_SafetyBriefing GetSafetyBriefingById(string safetyBriefingId)
|
||||
{
|
||||
return Funs.DB.InformationProject_SafetyBriefing.FirstOrDefault(e => e.SafetyBriefingId == safetyBriefingId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加实业安全简报
|
||||
/// </summary>
|
||||
/// <param name="safetyBriefing"></param>
|
||||
public static void AddSafetyBriefing(Model.InformationProject_SafetyBriefing safetyBriefing)
|
||||
{
|
||||
Model.InformationProject_SafetyBriefing newSafetyBriefing = new Model.InformationProject_SafetyBriefing
|
||||
{
|
||||
SafetyBriefingId = safetyBriefing.SafetyBriefingId,
|
||||
ProjectId = safetyBriefing.ProjectId,
|
||||
UnitId = safetyBriefing.UnitId,
|
||||
YearId = safetyBriefing.YearId,
|
||||
Month = safetyBriefing.Month,
|
||||
CompileMan = safetyBriefing.CompileMan,
|
||||
CompileDate = safetyBriefing.CompileDate,
|
||||
Auditor = safetyBriefing.Auditor,
|
||||
Approver = safetyBriefing.Approver,
|
||||
MainWork = safetyBriefing.MainWork,
|
||||
HazardRecording = safetyBriefing.HazardRecording,
|
||||
SafetyAccident = safetyBriefing.SafetyAccident,
|
||||
EPAccident = safetyBriefing.EPAccident,
|
||||
OHAccident = safetyBriefing.OHAccident,
|
||||
WorkPermitNum = safetyBriefing.WorkPermitNum,
|
||||
HiddenDangerDetection = safetyBriefing.HiddenDangerDetection,
|
||||
RectificationSituation = safetyBriefing.RectificationSituation,
|
||||
CheckProblemsRectification = safetyBriefing.CheckProblemsRectification,
|
||||
PendingProject = safetyBriefing.PendingProject,
|
||||
ContractorManagement = safetyBriefing.ContractorManagement,
|
||||
EnvironmentalEmissions = safetyBriefing.EnvironmentalEmissions,
|
||||
NextMonthWorkPlan = safetyBriefing.NextMonthWorkPlan
|
||||
};
|
||||
Funs.DB.InformationProject_SafetyBriefing.InsertOnSubmit(newSafetyBriefing);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改实业安全简报
|
||||
/// </summary>
|
||||
/// <param name="safetyBriefing"></param>
|
||||
public static void UpdateSafetyBriefing(Model.InformationProject_SafetyBriefing safetyBriefing)
|
||||
{
|
||||
Model.InformationProject_SafetyBriefing newSafetyBriefing = Funs.DB.InformationProject_SafetyBriefing.FirstOrDefault(e => e.SafetyBriefingId == safetyBriefing.SafetyBriefingId);
|
||||
if (newSafetyBriefing != null)
|
||||
{
|
||||
newSafetyBriefing.UnitId = safetyBriefing.UnitId;
|
||||
newSafetyBriefing.YearId = safetyBriefing.YearId;
|
||||
newSafetyBriefing.Month = safetyBriefing.Month;
|
||||
newSafetyBriefing.CompileMan = safetyBriefing.CompileMan;
|
||||
newSafetyBriefing.CompileDate = safetyBriefing.CompileDate;
|
||||
newSafetyBriefing.Auditor = safetyBriefing.Auditor;
|
||||
newSafetyBriefing.Approver = safetyBriefing.Approver;
|
||||
newSafetyBriefing.MainWork = safetyBriefing.MainWork;
|
||||
newSafetyBriefing.HazardRecording = safetyBriefing.HazardRecording;
|
||||
newSafetyBriefing.SafetyAccident = safetyBriefing.SafetyAccident;
|
||||
newSafetyBriefing.EPAccident = safetyBriefing.EPAccident;
|
||||
newSafetyBriefing.OHAccident = safetyBriefing.OHAccident;
|
||||
newSafetyBriefing.WorkPermitNum = safetyBriefing.WorkPermitNum;
|
||||
newSafetyBriefing.HiddenDangerDetection = safetyBriefing.HiddenDangerDetection;
|
||||
newSafetyBriefing.RectificationSituation = safetyBriefing.RectificationSituation;
|
||||
newSafetyBriefing.CheckProblemsRectification = safetyBriefing.CheckProblemsRectification;
|
||||
newSafetyBriefing.PendingProject = safetyBriefing.PendingProject;
|
||||
newSafetyBriefing.ContractorManagement = safetyBriefing.ContractorManagement;
|
||||
newSafetyBriefing.EnvironmentalEmissions = safetyBriefing.EnvironmentalEmissions;
|
||||
newSafetyBriefing.NextMonthWorkPlan = safetyBriefing.NextMonthWorkPlan;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除实业安全简报
|
||||
/// </summary>
|
||||
/// <param name="safetyBriefingId"></param>
|
||||
public static void DeleteSafetyBriefingById(string safetyBriefingId)
|
||||
{
|
||||
Model.InformationProject_SafetyBriefing safetyBriefing = Funs.DB.InformationProject_SafetyBriefing.FirstOrDefault(e => e.SafetyBriefingId == safetyBriefingId);
|
||||
if (safetyBriefing != null)
|
||||
{
|
||||
Funs.DB.InformationProject_SafetyBriefing.DeleteOnSubmit(safetyBriefing);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,6 +83,7 @@
|
||||
newSysSet5.SetValue = token;
|
||||
}
|
||||
newSysSet5.SetName = "token";
|
||||
newSysSet5.SetId = 99;
|
||||
Funs.DB.Sys_Set.InsertOnSubmit(newSysSet5);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
@@ -106,6 +107,7 @@
|
||||
newSysSet5.SetValue = ExpirationTime;
|
||||
}
|
||||
newSysSet5.SetName = "token失效时间";
|
||||
newSysSet5.SetId = 98;
|
||||
Funs.DB.Sys_Set.InsertOnSubmit(newSysSet5);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
@@ -332,6 +332,20 @@ namespace BLL
|
||||
}
|
||||
return name;
|
||||
}
|
||||
public static string GetUnitNameByUnitId(object unitId)
|
||||
{
|
||||
string name = string.Empty;
|
||||
if (unitId != null)
|
||||
{
|
||||
var unit = Funs.DB.Base_Unit.FirstOrDefault(x => x.UnitId == unitId.ToString());
|
||||
if (unit != null)
|
||||
{
|
||||
name = unit.UnitName;
|
||||
}
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
public static string GetInstallationNameByUnitId(string installationId)
|
||||
{
|
||||
string name = string.Empty;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,278 @@
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class HazardRealtimedeviceService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.Hazard_RealTimeDevice> GetHazard_RealTimeDeviceByModle(Model.Hazard_RealTimeDevice table)
|
||||
{
|
||||
var q = from x in db.Hazard_RealTimeDevice
|
||||
where
|
||||
(string.IsNullOrEmpty(table.ID) || x.ID.Contains(table.ID)) &&
|
||||
(string.IsNullOrEmpty(table.UnitId) || x.UnitId.Contains(table.UnitId)) &&
|
||||
(string.IsNullOrEmpty(table.UnitName) || x.UnitName.Contains(table.UnitName)) &&
|
||||
(string.IsNullOrEmpty(table.HazardName) || x.HazardName.Contains(table.HazardName)) &&
|
||||
(string.IsNullOrEmpty(table.HazardLevel) || x.HazardLevel.Contains(table.HazardLevel)) &&
|
||||
(string.IsNullOrEmpty(table.DeviceCode) || x.DeviceCode.Contains(table.DeviceCode)) &&
|
||||
(string.IsNullOrEmpty(table.DeviceName) || x.DeviceName.Contains(table.DeviceName)) &&
|
||||
(string.IsNullOrEmpty(table.DeviceType) || x.DeviceType.Contains(table.DeviceType)) &&
|
||||
(string.IsNullOrEmpty(table.SphereType) || x.SphereType.Contains(table.SphereType)) &&
|
||||
(string.IsNullOrEmpty(table.TemperatureType) || x.TemperatureType.Contains(table.TemperatureType)) &&
|
||||
(string.IsNullOrEmpty(table.DesignTemperantureMax) || x.DesignTemperantureMax.Contains(table.DesignTemperantureMax)) &&
|
||||
(string.IsNullOrEmpty(table.DesignTemperantureMin) || x.DesignTemperantureMin.Contains(table.DesignTemperantureMin)) &&
|
||||
(string.IsNullOrEmpty(table.PressureType) || x.PressureType.Contains(table.PressureType)) &&
|
||||
(string.IsNullOrEmpty(table.DesignPressure) || x.DesignPressure.Contains(table.DesignPressure)) &&
|
||||
(string.IsNullOrEmpty(table.DesignPressureMax) || x.DesignPressureMax.Contains(table.DesignPressureMax)) &&
|
||||
(string.IsNullOrEmpty(table.Medium) || x.Medium.Contains(table.Medium)) &&
|
||||
(string.IsNullOrEmpty(table.MediumForm) || x.MediumForm.Contains(table.MediumForm)) &&
|
||||
(string.IsNullOrEmpty(table.MediumLevelMax) || x.MediumLevelMax.Contains(table.MediumLevelMax)) &&
|
||||
(string.IsNullOrEmpty(table.Reserves) || x.Reserves.Contains(table.Reserves)) &&
|
||||
(string.IsNullOrEmpty(table.StandardCode) || x.StandardCode.Contains(table.StandardCode)) &&
|
||||
(string.IsNullOrEmpty(table.StandardName) || x.StandardName.Contains(table.StandardName)) &&
|
||||
(string.IsNullOrEmpty(table.StandardType) || x.StandardType.Contains(table.StandardType)) &&
|
||||
(string.IsNullOrEmpty(table.StandardDes) || x.StandardDes.Contains(table.StandardDes)) &&
|
||||
(string.IsNullOrEmpty(table.MeasurementUnit) || x.MeasurementUnit.Contains(table.MeasurementUnit)) &&
|
||||
(string.IsNullOrEmpty(table.MeterMax) || x.MeterMax.Contains(table.MeterMax)) &&
|
||||
(string.IsNullOrEmpty(table.MeterMin) || x.MeterMin.Contains(table.MeterMin)) &&
|
||||
(string.IsNullOrEmpty(table.ThresholdLow1) || x.ThresholdLow1.Contains(table.ThresholdLow1)) &&
|
||||
(string.IsNullOrEmpty(table.ThresholdLow2) || x.ThresholdLow2.Contains(table.ThresholdLow2)) &&
|
||||
(string.IsNullOrEmpty(table.ThresholdMax1) || x.ThresholdMax1.Contains(table.ThresholdMax1)) &&
|
||||
(string.IsNullOrEmpty(table.ThresholdMax2) || x.ThresholdMax2.Contains(table.ThresholdMax2)) &&
|
||||
(string.IsNullOrEmpty(table.BitNum) || x.BitNum.Contains(table.BitNum)) &&
|
||||
(string.IsNullOrEmpty(table.ProjectId) || x.ProjectId.Contains(table.ProjectId)) &&
|
||||
(string.IsNullOrEmpty(table.Value) || x.Value.Contains(table.Value)) &&
|
||||
(string.IsNullOrEmpty(table.FactoryId) || x.FactoryId.Contains(table.FactoryId)) &&
|
||||
(string.IsNullOrEmpty(table.ReceiveDate) || x.ReceiveDate.Contains(table.ReceiveDate))
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
}
|
||||
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="PageIndex">页码</param>
|
||||
/// <param name="PageSize">每页数量</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(Model.Hazard_RealTimeDevice table, Grid Grid1)
|
||||
{
|
||||
var q = GetHazard_RealTimeDeviceByModle(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.ID,
|
||||
x.UnitId,
|
||||
x.UnitName,
|
||||
x.HazardName,
|
||||
x.HazardLevel,
|
||||
x.DeviceCode,
|
||||
x.DeviceName,
|
||||
x.DeviceType,
|
||||
x.SphereType,
|
||||
x.TemperatureType,
|
||||
x.DesignTemperantureMax,
|
||||
x.DesignTemperantureMin,
|
||||
x.PressureType,
|
||||
x.DesignPressure,
|
||||
x.DesignPressureMax,
|
||||
x.Medium,
|
||||
x.MediumForm,
|
||||
x.MediumLevelMax,
|
||||
x.Reserves,
|
||||
x.StandardCode,
|
||||
x.StandardName,
|
||||
x.StandardType,
|
||||
x.StandardDes,
|
||||
x.MeasurementUnit,
|
||||
x.MeterMax,
|
||||
x.MeterMin,
|
||||
x.ThresholdLow1,
|
||||
x.ThresholdLow2,
|
||||
x.ThresholdMax1,
|
||||
x.ThresholdMax2,
|
||||
x.BitNum,
|
||||
x.DateTime,
|
||||
x.ProjectId,
|
||||
x.Value,
|
||||
x.FactoryId,
|
||||
x.ReportDate,
|
||||
x.ReceiveDate,
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static Model.Hazard_RealTimeDevice GetHazard_RealTimeDeviceById(string ID)
|
||||
{
|
||||
return db.Hazard_RealTimeDevice.FirstOrDefault(x => x.ID == ID);
|
||||
}
|
||||
|
||||
|
||||
public static void AddHazard_RealTimeDevice(Model.Hazard_RealTimeDevice newtable)
|
||||
{
|
||||
|
||||
Model.Hazard_RealTimeDevice table = new Model.Hazard_RealTimeDevice
|
||||
{
|
||||
ID = newtable.ID,
|
||||
UnitId = newtable.UnitId,
|
||||
UnitName = newtable.UnitName,
|
||||
HazardName = newtable.HazardName,
|
||||
HazardLevel = newtable.HazardLevel,
|
||||
DeviceCode = newtable.DeviceCode,
|
||||
DeviceName = newtable.DeviceName,
|
||||
DeviceType = newtable.DeviceType,
|
||||
SphereType = newtable.SphereType,
|
||||
TemperatureType = newtable.TemperatureType,
|
||||
DesignTemperantureMax = newtable.DesignTemperantureMax,
|
||||
DesignTemperantureMin = newtable.DesignTemperantureMin,
|
||||
PressureType = newtable.PressureType,
|
||||
DesignPressure = newtable.DesignPressure,
|
||||
DesignPressureMax = newtable.DesignPressureMax,
|
||||
Medium = newtable.Medium,
|
||||
MediumForm = newtable.MediumForm,
|
||||
MediumLevelMax = newtable.MediumLevelMax,
|
||||
Reserves = newtable.Reserves,
|
||||
StandardCode = newtable.StandardCode,
|
||||
StandardName = newtable.StandardName,
|
||||
StandardType = newtable.StandardType,
|
||||
StandardDes = newtable.StandardDes,
|
||||
MeasurementUnit = newtable.MeasurementUnit,
|
||||
MeterMax = newtable.MeterMax,
|
||||
MeterMin = newtable.MeterMin,
|
||||
ThresholdLow1 = newtable.ThresholdLow1,
|
||||
ThresholdLow2 = newtable.ThresholdLow2,
|
||||
ThresholdMax1 = newtable.ThresholdMax1,
|
||||
ThresholdMax2 = newtable.ThresholdMax2,
|
||||
BitNum = newtable.BitNum,
|
||||
DateTime = newtable.DateTime,
|
||||
ProjectId = newtable.ProjectId,
|
||||
Value = newtable.Value,
|
||||
FactoryId = newtable.FactoryId,
|
||||
ReportDate = newtable.ReportDate,
|
||||
ReceiveDate = newtable.ReceiveDate,
|
||||
};
|
||||
db.Hazard_RealTimeDevice.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void AddBulkHazard_RealTimeDevice(List<Model.Hazard_RealTimeDevice> newtables)
|
||||
{
|
||||
|
||||
db.Hazard_RealTimeDevice.InsertAllOnSubmit(newtables);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
public static void UpdateHazard_RealTimeDevice(Model.Hazard_RealTimeDevice newtable)
|
||||
{
|
||||
|
||||
Model.Hazard_RealTimeDevice table = db.Hazard_RealTimeDevice.FirstOrDefault(x => x.ID == newtable.ID);
|
||||
if (table != null)
|
||||
{
|
||||
table.ID = newtable.ID;
|
||||
table.UnitId = newtable.UnitId;
|
||||
table.UnitName = newtable.UnitName;
|
||||
table.HazardName = newtable.HazardName;
|
||||
table.HazardLevel = newtable.HazardLevel;
|
||||
table.DeviceCode = newtable.DeviceCode;
|
||||
table.DeviceName = newtable.DeviceName;
|
||||
table.DeviceType = newtable.DeviceType;
|
||||
table.SphereType = newtable.SphereType;
|
||||
table.TemperatureType = newtable.TemperatureType;
|
||||
table.DesignTemperantureMax = newtable.DesignTemperantureMax;
|
||||
table.DesignTemperantureMin = newtable.DesignTemperantureMin;
|
||||
table.PressureType = newtable.PressureType;
|
||||
table.DesignPressure = newtable.DesignPressure;
|
||||
table.DesignPressureMax = newtable.DesignPressureMax;
|
||||
table.Medium = newtable.Medium;
|
||||
table.MediumForm = newtable.MediumForm;
|
||||
table.MediumLevelMax = newtable.MediumLevelMax;
|
||||
table.Reserves = newtable.Reserves;
|
||||
table.StandardCode = newtable.StandardCode;
|
||||
table.StandardName = newtable.StandardName;
|
||||
table.StandardType = newtable.StandardType;
|
||||
table.StandardDes = newtable.StandardDes;
|
||||
table.MeasurementUnit = newtable.MeasurementUnit;
|
||||
table.MeterMax = newtable.MeterMax;
|
||||
table.MeterMin = newtable.MeterMin;
|
||||
table.ThresholdLow1 = newtable.ThresholdLow1;
|
||||
table.ThresholdLow2 = newtable.ThresholdLow2;
|
||||
table.ThresholdMax1 = newtable.ThresholdMax1;
|
||||
table.ThresholdMax2 = newtable.ThresholdMax2;
|
||||
table.BitNum = newtable.BitNum;
|
||||
table.DateTime = newtable.DateTime;
|
||||
table.ProjectId = newtable.ProjectId;
|
||||
table.Value = newtable.Value;
|
||||
table.FactoryId = newtable.FactoryId;
|
||||
table.ReportDate = newtable.ReportDate;
|
||||
table.ReceiveDate = newtable.ReceiveDate;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteHazard_RealTimeDeviceById(string ID)
|
||||
{
|
||||
|
||||
Model.Hazard_RealTimeDevice table = db.Hazard_RealTimeDevice.FirstOrDefault(x => x.ID == ID);
|
||||
if (table != null)
|
||||
{
|
||||
db.Hazard_RealTimeDevice.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void DeleteALLHazard_RealTimeDevice()
|
||||
{
|
||||
if (db.Hazard_RealTimeDevice != null)
|
||||
{
|
||||
db.Hazard_RealTimeDevice.DeleteAllOnSubmit(db.Hazard_RealTimeDevice);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
public static List<Model.Hazard_RealTimeDevice> GetHazard_RealTimeDeviceByDate(DateTime? reportDate)
|
||||
{
|
||||
var q = from x in db.Hazard_RealTimeDevice
|
||||
where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0
|
||||
select x;
|
||||
return q.ToList();
|
||||
}
|
||||
public static void DeleteHazard_RealTimeDeviceByDate(DateTime? reportDate)
|
||||
{
|
||||
|
||||
var table = db.Hazard_RealTimeDevice.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0);
|
||||
if (table != null)
|
||||
{
|
||||
db.Hazard_RealTimeDevice.DeleteAllOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,246 @@
|
||||
using FineUIPro;
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class SYHSEData_DataService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.SYHSEData_Data> GetSYHSEData_DataByModle(Model.SYHSEData_Data table)
|
||||
{
|
||||
var q = from x in db.SYHSEData_Data
|
||||
where
|
||||
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
|
||||
(string.IsNullOrEmpty(table.FactoryId) || x.FactoryId.Contains(table.FactoryId))
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
}
|
||||
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="PageIndex">页码</param>
|
||||
/// <param name="PageSize">每页数量</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(Model.SYHSEData_Data table, Grid Grid1)
|
||||
{
|
||||
var q = GetSYHSEData_DataByModle(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.Id,
|
||||
x.FactoryId,
|
||||
x.SafetyMnaHours,
|
||||
x.GeneralRiskNum,
|
||||
x.LowRiskNum,
|
||||
x.MoreRiskNum,
|
||||
x.GreatRiskNum,
|
||||
x.ReportDate,
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
public static bool IsReportByDate(DateTime dateTime)
|
||||
{
|
||||
var result = false;
|
||||
var q = (from x in Funs.DB.SYHSEData_Data
|
||||
where x.ReportDate >= dateTime.Date && x.ReportDate < (dateTime.Date.AddDays(1).Date)
|
||||
select x).ToList();
|
||||
if (q != null && q.Count > 0)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
public static Model.ReturnData PushCNCEC(string Id)
|
||||
{
|
||||
string baseurl = "/api/SYHSEData/SaveNewSYHSEData";
|
||||
var item = GetItemById(Id);
|
||||
string str = JsonConvert.SerializeObject(item);
|
||||
var responeData = BLL.ServerService.PushCNCEC(str, baseurl);
|
||||
return responeData;
|
||||
}
|
||||
public static Model.NewSYHSEData GetItemById(string Id)
|
||||
{
|
||||
var data=GetSYHSEData_DataById(Id);
|
||||
var data_realtime = HazardRealtimedeviceService.GetHazard_RealTimeDeviceByDate(data.ReportDate);
|
||||
var data_hidden= SyhsedataHiddendangercheckService.GetSYHSEData_HiddenDangerCheckByDate(data.ReportDate);
|
||||
var data_risk= SyhsedataRiskcontrolService.GetSYHSEData_RiskControlByDate(data.ReportDate);
|
||||
|
||||
|
||||
NewSYHSEData APIData = new NewSYHSEData();
|
||||
var APIDataList_Item= new List<NewSYHSEDataItem>();
|
||||
var APIDataList_Relatime= new List<NewSYHSEDataRealTimeDeviceItem>();
|
||||
var APIDataList_Hidden= new List<NewSYHSEDataHiddenDangerCheckItem>();
|
||||
var APIDataList_Risk= new List<NewSYHSEDataRiskControlItem>();
|
||||
|
||||
foreach (var tb in data_realtime)
|
||||
{
|
||||
var q = new NewSYHSEDataRealTimeDeviceItem()
|
||||
{
|
||||
Id=tb.ID,
|
||||
HazardName=tb.HazardName,
|
||||
HazardLevel=tb.HazardLevel,
|
||||
DeviceName=tb.DeviceName,
|
||||
Medium=tb.Medium,
|
||||
MeasurementUnit=tb.MeasurementUnit,
|
||||
DateTime=tb.DateTime.ToString(),
|
||||
Value=tb.Value,
|
||||
|
||||
};
|
||||
|
||||
APIDataList_Relatime.Add(q);
|
||||
}
|
||||
|
||||
foreach (var tb in data_hidden)
|
||||
{
|
||||
var q = new NewSYHSEDataHiddenDangerCheckItem()
|
||||
{
|
||||
Id=tb.Id,
|
||||
HiddenDangerName=tb.HiddenDangerName,
|
||||
TotalNum=tb.TotalNum.HasValue ? tb.TotalNum.Value:0,
|
||||
OKNum=tb.OKNum.HasValue ? tb.OKNum.Value : 0,
|
||||
|
||||
};
|
||||
APIDataList_Hidden.Add(q);
|
||||
}
|
||||
|
||||
foreach (var tb in data_risk)
|
||||
{
|
||||
|
||||
var q = new NewSYHSEDataRiskControlItem()
|
||||
{
|
||||
Id=tb.Id,
|
||||
RiskControlName=tb.RiskControlName,
|
||||
|
||||
};
|
||||
APIDataList_Risk.Add(q);
|
||||
}
|
||||
|
||||
NewSYHSEDataItem Item = new NewSYHSEDataItem();
|
||||
Item.Id = data.Id;
|
||||
Item.ReportDate=data.ReportDate.ToString();
|
||||
Item.UnitId = Const.UnitId_CD;
|
||||
Item.CollCropCode = UnitService.GetUnitByUnitId(Const.UnitId_CD).CollCropCode;
|
||||
Item.UnitName= UnitService.GetUnitByUnitId(Const.UnitId_CD).UnitName;
|
||||
Item.FactoryId = data.FactoryId;
|
||||
Item.FactoryCode = BLL.Base_FactoryService.GetBase_FactoryById(data.FactoryId).FactoryCode;
|
||||
Item.FactoryName = BLL.Base_FactoryService.GetBase_FactoryById(data.FactoryId).FactoryName;
|
||||
Item.Address = BLL.Base_FactoryService.GetBase_FactoryById(data.FactoryId).Address;
|
||||
Item.MapCoordinates= BLL.Base_FactoryService.GetBase_FactoryById(data.FactoryId).MapCoordinates;
|
||||
Item.SafetyMnaHours = data.SafetyMnaHours.HasValue ? data.SafetyMnaHours.Value : 0;
|
||||
Item.GeneralRiskNum = data.GeneralRiskNum.HasValue ? data.GeneralRiskNum.Value : 0;
|
||||
Item.LowRiskNum = data.LowRiskNum.HasValue ? data.LowRiskNum.Value : 0;
|
||||
Item.MoreRiskNum = data.MoreRiskNum.HasValue ? data.MoreRiskNum.Value : 0;
|
||||
Item.GreatRiskNum = data.GreatRiskNum.HasValue ? data.GreatRiskNum.Value : 0;
|
||||
Item.NewSYHSEDataRiskControlItems = APIDataList_Risk;
|
||||
Item.NewSYHSEDataRealTimeDeviceItems = APIDataList_Relatime;
|
||||
Item.NewSYHSEDataHiddenDangerCheckItems = APIDataList_Hidden;
|
||||
|
||||
APIDataList_Item.Add(Item);
|
||||
|
||||
APIData.NewSYHSEDataItems = APIDataList_Item;
|
||||
|
||||
return APIData;
|
||||
}
|
||||
|
||||
public static Model.SYHSEData_Data GetSYHSEData_DataById(string Id)
|
||||
{
|
||||
return db.SYHSEData_Data.FirstOrDefault(x => x.Id == Id);
|
||||
}
|
||||
|
||||
|
||||
public static void AddSYHSEData_Data(Model.SYHSEData_Data newtable)
|
||||
{
|
||||
|
||||
Model.SYHSEData_Data table = new Model.SYHSEData_Data
|
||||
{
|
||||
Id = newtable.Id,
|
||||
FactoryId = newtable.FactoryId,
|
||||
SafetyMnaHours = newtable.SafetyMnaHours,
|
||||
GeneralRiskNum = newtable.GeneralRiskNum,
|
||||
LowRiskNum = newtable.LowRiskNum,
|
||||
MoreRiskNum = newtable.MoreRiskNum,
|
||||
GreatRiskNum = newtable.GreatRiskNum,
|
||||
ReportDate = newtable.ReportDate,
|
||||
};
|
||||
db.SYHSEData_Data.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void AddBulkSYHSEData_Data(List<Model.SYHSEData_Data> newtables)
|
||||
{
|
||||
|
||||
db.SYHSEData_Data.InsertAllOnSubmit(newtables);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
public static void UpdateSYHSEData_Data(Model.SYHSEData_Data newtable)
|
||||
{
|
||||
|
||||
Model.SYHSEData_Data table = db.SYHSEData_Data.FirstOrDefault(x => x.Id == newtable.Id);
|
||||
if (table != null)
|
||||
{
|
||||
table.Id = newtable.Id;
|
||||
table.FactoryId = newtable.FactoryId;
|
||||
table.SafetyMnaHours = newtable.SafetyMnaHours;
|
||||
table.GeneralRiskNum = newtable.GeneralRiskNum;
|
||||
table.LowRiskNum = newtable.LowRiskNum;
|
||||
table.MoreRiskNum = newtable.MoreRiskNum;
|
||||
table.GreatRiskNum = newtable.GreatRiskNum;
|
||||
table.ReportDate = newtable.ReportDate;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteSYHSEData_DataById(string Id)
|
||||
{
|
||||
|
||||
Model.SYHSEData_Data table = db.SYHSEData_Data.FirstOrDefault(x => x.Id == Id);
|
||||
if (table != null)
|
||||
{
|
||||
db.SYHSEData_Data.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void DeleteALLSYHSEData_Data()
|
||||
{
|
||||
if (db.SYHSEData_Data != null)
|
||||
{
|
||||
db.SYHSEData_Data.DeleteAllOnSubmit(db.SYHSEData_Data);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,153 @@
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class SyhsedataHiddendangercheckService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.SYHSEData_HiddenDangerCheck> GetSYHSEData_HiddenDangerCheckByModle(Model.SYHSEData_HiddenDangerCheck table)
|
||||
{
|
||||
var q = from x in db.SYHSEData_HiddenDangerCheck
|
||||
where
|
||||
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
|
||||
(string.IsNullOrEmpty(table.FactoryId) || x.FactoryId.Contains(table.FactoryId)) &&
|
||||
(string.IsNullOrEmpty(table.HiddenDangerName) || x.HiddenDangerName.Contains(table.HiddenDangerName))
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
}
|
||||
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="PageIndex">页码</param>
|
||||
/// <param name="PageSize">每页数量</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(Model.SYHSEData_HiddenDangerCheck table, Grid Grid1)
|
||||
{
|
||||
var q = GetSYHSEData_HiddenDangerCheckByModle(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.Id,
|
||||
x.FactoryId,
|
||||
x.HiddenDangerName,
|
||||
x.TotalNum,
|
||||
x.OKNum,
|
||||
x.ReportDate,
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static Model.SYHSEData_HiddenDangerCheck GetSYHSEData_HiddenDangerCheckById(string Id)
|
||||
{
|
||||
return db.SYHSEData_HiddenDangerCheck.FirstOrDefault(x => x.Id == Id);
|
||||
}
|
||||
|
||||
|
||||
public static void AddSYHSEData_HiddenDangerCheck(Model.SYHSEData_HiddenDangerCheck newtable)
|
||||
{
|
||||
|
||||
Model.SYHSEData_HiddenDangerCheck table = new Model.SYHSEData_HiddenDangerCheck
|
||||
{
|
||||
Id = newtable.Id,
|
||||
FactoryId = newtable.FactoryId,
|
||||
HiddenDangerName = newtable.HiddenDangerName,
|
||||
TotalNum = newtable.TotalNum,
|
||||
OKNum = newtable.OKNum,
|
||||
ReportDate = newtable.ReportDate,
|
||||
};
|
||||
db.SYHSEData_HiddenDangerCheck.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void AddBulkSYHSEData_HiddenDangerCheck(List<Model.SYHSEData_HiddenDangerCheck> newtables)
|
||||
{
|
||||
|
||||
db.SYHSEData_HiddenDangerCheck.InsertAllOnSubmit(newtables);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
public static void UpdateSYHSEData_HiddenDangerCheck(Model.SYHSEData_HiddenDangerCheck newtable)
|
||||
{
|
||||
|
||||
Model.SYHSEData_HiddenDangerCheck table = db.SYHSEData_HiddenDangerCheck.FirstOrDefault(x => x.Id == newtable.Id);
|
||||
if (table != null)
|
||||
{
|
||||
table.Id = newtable.Id;
|
||||
table.FactoryId = newtable.FactoryId;
|
||||
table.HiddenDangerName = newtable.HiddenDangerName;
|
||||
table.TotalNum = newtable.TotalNum;
|
||||
table.OKNum = newtable.OKNum;
|
||||
table.ReportDate = newtable.ReportDate;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteSYHSEData_HiddenDangerCheckById(string Id)
|
||||
{
|
||||
|
||||
Model.SYHSEData_HiddenDangerCheck table = db.SYHSEData_HiddenDangerCheck.FirstOrDefault(x => x.Id == Id);
|
||||
if (table != null)
|
||||
{
|
||||
db.SYHSEData_HiddenDangerCheck.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void DeleteALLSYHSEData_HiddenDangerCheck()
|
||||
{
|
||||
if (db.SYHSEData_HiddenDangerCheck != null)
|
||||
{
|
||||
db.SYHSEData_HiddenDangerCheck.DeleteAllOnSubmit(db.SYHSEData_HiddenDangerCheck);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
public static List<Model.SYHSEData_HiddenDangerCheck> GetSYHSEData_HiddenDangerCheckByDate(DateTime? reportDate)
|
||||
{
|
||||
var q = from x in db.SYHSEData_HiddenDangerCheck
|
||||
where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0
|
||||
select x;
|
||||
return q.ToList();
|
||||
}
|
||||
public static void DeleteSYHSEData_HiddenDangerCheckByDate(DateTime? reportDate)
|
||||
{
|
||||
|
||||
var table = db.SYHSEData_HiddenDangerCheck.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0);
|
||||
if (table != null)
|
||||
{
|
||||
db.SYHSEData_HiddenDangerCheck.DeleteAllOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
||||
public static class SyhsedataRiskcontrolService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
|
||||
#region 获取列表
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
public static List<Model.SYHSEData_RiskControl> GetSYHSEData_RiskControlByModle(Model.SYHSEData_RiskControl table)
|
||||
{
|
||||
var q = from x in db.SYHSEData_RiskControl
|
||||
where
|
||||
(string.IsNullOrEmpty(table.Id) || x.Id.Contains(table.Id)) &&
|
||||
(string.IsNullOrEmpty(table.FactoryId) || x.FactoryId.Contains(table.FactoryId)) &&
|
||||
(string.IsNullOrEmpty(table.RiskControlName) || x.RiskControlName.Contains(table.RiskControlName))
|
||||
select x
|
||||
;
|
||||
|
||||
return q.ToList();
|
||||
}
|
||||
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="PageIndex">页码</param>
|
||||
/// <param name="PageSize">每页数量</param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(Model.SYHSEData_RiskControl table, Grid Grid1)
|
||||
{
|
||||
var q = GetSYHSEData_RiskControlByModle(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.Id,
|
||||
x.FactoryId,
|
||||
x.RiskControlName,
|
||||
x.ReportDate,
|
||||
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
public static Model.SYHSEData_RiskControl GetSYHSEData_RiskControlById(string Id)
|
||||
{
|
||||
return db.SYHSEData_RiskControl.FirstOrDefault(x => x.Id == Id);
|
||||
}
|
||||
|
||||
|
||||
public static void AddSYHSEData_RiskControl(Model.SYHSEData_RiskControl newtable)
|
||||
{
|
||||
|
||||
Model.SYHSEData_RiskControl table = new Model.SYHSEData_RiskControl
|
||||
{
|
||||
Id = newtable.Id,
|
||||
FactoryId = newtable.FactoryId,
|
||||
RiskControlName = newtable.RiskControlName,
|
||||
ReportDate = newtable.ReportDate,
|
||||
};
|
||||
db.SYHSEData_RiskControl.InsertOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
public static void AddBulkSYHSEData_RiskControl(List<Model.SYHSEData_RiskControl> newtables)
|
||||
{
|
||||
|
||||
db.SYHSEData_RiskControl.InsertAllOnSubmit(newtables);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
|
||||
public static void UpdateSYHSEData_RiskControl(Model.SYHSEData_RiskControl newtable)
|
||||
{
|
||||
|
||||
Model.SYHSEData_RiskControl table = db.SYHSEData_RiskControl.FirstOrDefault(x => x.Id == newtable.Id);
|
||||
if (table != null)
|
||||
{
|
||||
table.Id = newtable.Id;
|
||||
table.FactoryId = newtable.FactoryId;
|
||||
table.RiskControlName = newtable.RiskControlName;
|
||||
table.ReportDate = newtable.ReportDate;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
public static void DeleteSYHSEData_RiskControlById(string Id)
|
||||
{
|
||||
|
||||
Model.SYHSEData_RiskControl table = db.SYHSEData_RiskControl.FirstOrDefault(x => x.Id == Id);
|
||||
if (table != null)
|
||||
{
|
||||
db.SYHSEData_RiskControl.DeleteOnSubmit(table);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void DeleteALLSYHSEData_RiskControl()
|
||||
{
|
||||
if (db.SYHSEData_RiskControl != null)
|
||||
{
|
||||
db.SYHSEData_RiskControl.DeleteAllOnSubmit(db.SYHSEData_RiskControl);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
public static List<Model.SYHSEData_RiskControl> GetSYHSEData_RiskControlByDate(DateTime? reportDate)
|
||||
{
|
||||
var q = from x in db.SYHSEData_RiskControl
|
||||
where x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0
|
||||
select x;
|
||||
return q.ToList();
|
||||
}
|
||||
public static void DeleteSYHSEData_RiskControlByDate(DateTime? reportDate)
|
||||
{
|
||||
|
||||
var table = db.SYHSEData_RiskControl.Where(x => x.ReportDate.Value.Date.CompareTo(reportDate.Value.Date) == 0);
|
||||
if (table != null)
|
||||
{
|
||||
db.SYHSEData_RiskControl.DeleteAllOnSubmit(table);
|
||||
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 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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 生态环保工作总结报告
|
||||
/// </summary>
|
||||
public static class EPSummaryReportService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取生态环保工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="ePSummaryReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_EPSummaryReport GetEPSummaryReportById(string ePSummaryReportId)
|
||||
{
|
||||
return Funs.DB.Information_EPSummaryReport.FirstOrDefault(e => e.EPSummaryReportId == ePSummaryReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位和年份获取生态环保工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="yearId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_EPSummaryReport GetEPSummaryReportByUnitIdAndYearId(string unitId, int yearId)
|
||||
{
|
||||
return Funs.DB.Information_EPSummaryReport.FirstOrDefault(e => e.UnitId == unitId && e.YearId == yearId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加生态环保工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="ePSummaryReport"></param>
|
||||
public static void AddEPSummaryReport(Model.Information_EPSummaryReport ePSummaryReport)
|
||||
{
|
||||
Model.Information_EPSummaryReport newReport = new Model.Information_EPSummaryReport
|
||||
{
|
||||
EPSummaryReportId = ePSummaryReport.EPSummaryReportId,
|
||||
UnitId = ePSummaryReport.UnitId,
|
||||
YearId = ePSummaryReport.YearId,
|
||||
ResponsiblePerson = ePSummaryReport.ResponsiblePerson,
|
||||
ResponsiblePersonTel = ePSummaryReport.ResponsiblePersonTel,
|
||||
ContactPerson = ePSummaryReport.ContactPerson,
|
||||
ContactPersonTel = ePSummaryReport.ContactPersonTel,
|
||||
ReportDate = ePSummaryReport.ReportDate,
|
||||
Description1 = ePSummaryReport.Description1,
|
||||
Description2 = ePSummaryReport.Description2,
|
||||
Description3 = ePSummaryReport.Description3,
|
||||
Description4 = ePSummaryReport.Description4,
|
||||
Description5 = ePSummaryReport.Description5,
|
||||
Description6 = ePSummaryReport.Description6,
|
||||
Description7 = ePSummaryReport.Description7,
|
||||
Description8 = ePSummaryReport.Description8,
|
||||
Description9 = ePSummaryReport.Description9
|
||||
};
|
||||
Funs.DB.Information_EPSummaryReport.InsertOnSubmit(newReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改生态环保工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="ePSummaryReport"></param>
|
||||
public static void UpdateEPSummaryReport(Model.Information_EPSummaryReport ePSummaryReport)
|
||||
{
|
||||
Model.Information_EPSummaryReport newReport = Funs.DB.Information_EPSummaryReport.FirstOrDefault(e => e.EPSummaryReportId == ePSummaryReport.EPSummaryReportId);
|
||||
if (newReport != null)
|
||||
{
|
||||
newReport.UnitId = ePSummaryReport.UnitId;
|
||||
newReport.YearId = ePSummaryReport.YearId;
|
||||
newReport.ResponsiblePerson = ePSummaryReport.ResponsiblePerson;
|
||||
newReport.ResponsiblePersonTel = ePSummaryReport.ResponsiblePersonTel;
|
||||
newReport.ContactPerson = ePSummaryReport.ContactPerson;
|
||||
newReport.ContactPersonTel = ePSummaryReport.ContactPersonTel;
|
||||
newReport.ReportDate = ePSummaryReport.ReportDate;
|
||||
newReport.Description1 = ePSummaryReport.Description1;
|
||||
newReport.Description2 = ePSummaryReport.Description2;
|
||||
newReport.Description3 = ePSummaryReport.Description3;
|
||||
newReport.Description4 = ePSummaryReport.Description4;
|
||||
newReport.Description5 = ePSummaryReport.Description5;
|
||||
newReport.Description6 = ePSummaryReport.Description6;
|
||||
newReport.Description7 = ePSummaryReport.Description7;
|
||||
newReport.Description8 = ePSummaryReport.Description8;
|
||||
newReport.Description9 = ePSummaryReport.Description9;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除生态环保工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="ePSummaryReportId"></param>
|
||||
public static void DeleteEPSummaryReportById(string ePSummaryReportId)
|
||||
{
|
||||
Model.Information_EPSummaryReport ePSummaryReport = Funs.DB.Information_EPSummaryReport.FirstOrDefault(e => e.EPSummaryReportId == ePSummaryReportId);
|
||||
if (ePSummaryReport != null)
|
||||
{
|
||||
Funs.DB.Information_EPSummaryReport.DeleteOnSubmit(ePSummaryReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,20 +6,20 @@ namespace BLL
|
||||
public static class MillionsMonthlyReportItemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 百万工时安全统计月报表明细表
|
||||
/// 企业安全数据统计月报明细表
|
||||
/// </summary>
|
||||
/// <param name="MillionsMonthlyReportItemId">百万工时安全统计月报表明细表Id</param>
|
||||
/// <returns>百万工时安全统计月报表明细表</returns>
|
||||
/// <param name="MillionsMonthlyReportItemId">企业安全数据统计月报明细表Id</param>
|
||||
/// <returns>企业安全数据统计月报明细表</returns>
|
||||
public static Model.Information_MillionsMonthlyReportItem GetMillionsMonthlyReportItemByMillionsMonthlyReportItemId(string MillionsMonthlyReportItemId)
|
||||
{
|
||||
return Funs.DB.Information_MillionsMonthlyReportItem.FirstOrDefault(e => e.MillionsMonthlyReportItemId == MillionsMonthlyReportItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 百万工时安全统计月报表明细表
|
||||
/// 企业安全数据统计月报明细表
|
||||
/// </summary>
|
||||
/// <param name="MillionsMonthlyReportItemId">百万工时安全统计月报表明细表Id</param>
|
||||
/// <returns>百万工时安全统计月报表明细表</returns>
|
||||
/// <param name="MillionsMonthlyReportItemId">企业安全数据统计月报明细表Id</param>
|
||||
/// <returns>企业安全数据统计月报明细表</returns>
|
||||
public static Model.Information_MillionsMonthlyReportItem GetMillionsMonthlyReportItemByMillionsMonthlyReportIdAndTypeId(string MillionsMonthlyReportId)
|
||||
{
|
||||
return Funs.DB.Information_MillionsMonthlyReportItem.FirstOrDefault(e => e.MillionsMonthlyReportId == MillionsMonthlyReportId);
|
||||
@@ -28,7 +28,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 根据主表Id判断是否存在明细记录
|
||||
/// </summary>
|
||||
/// <param name="MillionsMonthlyReportItemId">百万工时安全统计月报表表Id</param>
|
||||
/// <param name="MillionsMonthlyReportItemId">企业安全数据统计月报表Id</param>
|
||||
/// <returns>是否存在明细记录</returns>
|
||||
public static bool IsExitItems(string MillionsMonthlyReportId)
|
||||
{
|
||||
@@ -38,7 +38,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="MillionsMonthlyReportItemId">百万工时安全统计月报表明细表Id</param>
|
||||
/// <param name="MillionsMonthlyReportItemId">企业安全数据统计月报明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Information_MillionsMonthlyReportItem> GetItems(string MillionsMonthlyReportId)
|
||||
{
|
||||
@@ -51,7 +51,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="MillionsMonthlyReportItemId">百万工时安全统计月报表明细表Id</param>
|
||||
/// <param name="MillionsMonthlyReportItemId">企业安全数据统计月报明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Information_MillionsMonthlyReportItem> GetYearSumItems(string unitId, int? year, int? month)
|
||||
{
|
||||
@@ -66,7 +66,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="MillionsMonthlyReportItemId">百万工时安全统计月报表明细表Id</param>
|
||||
/// <param name="MillionsMonthlyReportItemId">企业安全数据统计月报明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Information_MillionsMonthlyReportItem> GetAllUnitYearSumItems(int year, int month)
|
||||
{
|
||||
@@ -80,7 +80,7 @@ namespace BLL
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合(不包含本月合计行)
|
||||
/// </summary>
|
||||
/// <param name="MillionsMonthlyReportItemId">百万工时安全统计月报表明细表Id</param>
|
||||
/// <param name="MillionsMonthlyReportItemId">企业安全数据统计月报明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Information_MillionsMonthlyReportItem> GetItemsNoSum(string MillionsMonthlyReportId)
|
||||
{
|
||||
@@ -92,9 +92,9 @@ namespace BLL
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加百万工时安全统计月报表明细表
|
||||
/// 增加企业安全数据统计月报明细表
|
||||
/// </summary>
|
||||
/// <param name="MillionsMonthlyReportItem">百万工时安全统计月报表明细表实体</param>
|
||||
/// <param name="MillionsMonthlyReportItem">企业安全数据统计月报明细表实体</param>
|
||||
public static void AddMillionsMonthlyReportItem(Model.Information_MillionsMonthlyReportItem MillionsMonthlyReportItem)
|
||||
{
|
||||
Model.Information_MillionsMonthlyReportItem newMillionsMonthlyReportItem = new Model.Information_MillionsMonthlyReportItem
|
||||
@@ -109,6 +109,9 @@ namespace BLL
|
||||
ContractorNum = MillionsMonthlyReportItem.ContractorNum,
|
||||
SumPersonNum = MillionsMonthlyReportItem.SumPersonNum,
|
||||
TotalWorkNum = MillionsMonthlyReportItem.TotalWorkNum,
|
||||
DeathAccidentNum = MillionsMonthlyReportItem.DeathAccidentNum,
|
||||
DeathAccidentPersonNum = MillionsMonthlyReportItem.DeathAccidentPersonNum,
|
||||
DeathAccidentLossHour = MillionsMonthlyReportItem.DeathAccidentLossHour,
|
||||
SeriousInjuriesNum = MillionsMonthlyReportItem.SeriousInjuriesNum,
|
||||
SeriousInjuriesPersonNum = MillionsMonthlyReportItem.SeriousInjuriesPersonNum,
|
||||
SeriousInjuriesLossHour = MillionsMonthlyReportItem.SeriousInjuriesLossHour,
|
||||
@@ -123,6 +126,7 @@ namespace BLL
|
||||
MedicalTreatmentPersonNum = MillionsMonthlyReportItem.MedicalTreatmentPersonNum,
|
||||
MedicalTreatmentLossHour = MillionsMonthlyReportItem.MedicalTreatmentLossHour,
|
||||
FireNum = MillionsMonthlyReportItem.FireNum,
|
||||
EnvironmenNum = MillionsMonthlyReportItem.EnvironmenNum,
|
||||
ExplosionNum = MillionsMonthlyReportItem.ExplosionNum,
|
||||
TrafficNum = MillionsMonthlyReportItem.TrafficNum,
|
||||
EquipmentNum = MillionsMonthlyReportItem.EquipmentNum,
|
||||
@@ -138,9 +142,9 @@ namespace BLL
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改百万工时安全统计月报表明细表
|
||||
/// 修改企业安全数据统计月报明细表
|
||||
/// </summary>
|
||||
/// <param name="MillionsMonthlyReportItem">百万工时安全统计月报表明细表实体</param>
|
||||
/// <param name="MillionsMonthlyReportItem">企业安全数据统计月报明细表实体</param>
|
||||
public static void UpdateMillionsMonthlyReportItem(Model.Information_MillionsMonthlyReportItem MillionsMonthlyReportItem)
|
||||
{
|
||||
Model.Information_MillionsMonthlyReportItem newMillionsMonthlyReportItem = Funs.DB.Information_MillionsMonthlyReportItem.FirstOrDefault(e => e.MillionsMonthlyReportItemId == MillionsMonthlyReportItem.MillionsMonthlyReportItemId);
|
||||
@@ -152,6 +156,9 @@ namespace BLL
|
||||
newMillionsMonthlyReportItem.ContractorNum = MillionsMonthlyReportItem.ContractorNum;
|
||||
newMillionsMonthlyReportItem.SumPersonNum = MillionsMonthlyReportItem.SumPersonNum;
|
||||
newMillionsMonthlyReportItem.TotalWorkNum = MillionsMonthlyReportItem.TotalWorkNum;
|
||||
newMillionsMonthlyReportItem.DeathAccidentNum = MillionsMonthlyReportItem.DeathAccidentNum;
|
||||
newMillionsMonthlyReportItem.DeathAccidentPersonNum = MillionsMonthlyReportItem.DeathAccidentPersonNum;
|
||||
newMillionsMonthlyReportItem.DeathAccidentLossHour = MillionsMonthlyReportItem.DeathAccidentLossHour;
|
||||
newMillionsMonthlyReportItem.SeriousInjuriesNum = MillionsMonthlyReportItem.SeriousInjuriesNum;
|
||||
newMillionsMonthlyReportItem.SeriousInjuriesPersonNum = MillionsMonthlyReportItem.SeriousInjuriesPersonNum;
|
||||
newMillionsMonthlyReportItem.SeriousInjuriesLossHour = MillionsMonthlyReportItem.SeriousInjuriesLossHour;
|
||||
@@ -167,6 +174,7 @@ namespace BLL
|
||||
newMillionsMonthlyReportItem.MedicalTreatmentLossHour = MillionsMonthlyReportItem.MedicalTreatmentLossHour;
|
||||
newMillionsMonthlyReportItem.FireNum = MillionsMonthlyReportItem.FireNum;
|
||||
newMillionsMonthlyReportItem.ExplosionNum = MillionsMonthlyReportItem.ExplosionNum;
|
||||
newMillionsMonthlyReportItem.EnvironmenNum = MillionsMonthlyReportItem.EnvironmenNum;
|
||||
newMillionsMonthlyReportItem.TrafficNum = MillionsMonthlyReportItem.TrafficNum;
|
||||
newMillionsMonthlyReportItem.EquipmentNum = MillionsMonthlyReportItem.EquipmentNum;
|
||||
newMillionsMonthlyReportItem.QualityNum = MillionsMonthlyReportItem.QualityNum;
|
||||
|
||||
@@ -6,41 +6,41 @@ namespace BLL
|
||||
public static class MillionsMonthlyReportService
|
||||
{
|
||||
/// <summary>
|
||||
/// 百万工时安全统计月报表
|
||||
/// 企业安全数据统计月报
|
||||
/// </summary>
|
||||
/// <param name="MillionsMonthlyReportId">百万工时安全统计月报表Id</param>
|
||||
/// <returns>百万工时安全统计月报表</returns>
|
||||
/// <param name="MillionsMonthlyReportId">企业安全数据统计月报Id</param>
|
||||
/// <returns>企业安全数据统计月报</returns>
|
||||
public static Model.Information_MillionsMonthlyReport GetMillionsMonthlyReportByMillionsMonthlyReportId(string MillionsMonthlyReportId)
|
||||
{
|
||||
return Funs.DB.Information_MillionsMonthlyReport.FirstOrDefault(e => e.MillionsMonthlyReportId == MillionsMonthlyReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 百万工时安全统计月报表
|
||||
/// 企业安全数据统计月报
|
||||
/// </summary>
|
||||
/// <param name="unitId">单位Id</param>
|
||||
/// <param name = "year" > 年度 </ param >
|
||||
/// <param name="month">月份</param>
|
||||
/// <returns>百万工时安全统计月报表</returns>
|
||||
/// <returns>企业安全数据统计月报</returns>
|
||||
public static Model.Information_MillionsMonthlyReport GetMillionsMonthlyReportByUnitIdAndYearAndMonth(string unitId, int year, int month)
|
||||
{
|
||||
return Funs.DB.Information_MillionsMonthlyReport.FirstOrDefault(e => e.UnitId == unitId && e.Month == month && e.Year == year);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位Id获取百万工时安全统计月报表集合
|
||||
/// 根据单位Id获取企业安全数据统计月报集合
|
||||
/// </summary>
|
||||
/// <param name="UnitId">单位Id</param>
|
||||
/// <returns>百万工时安全统计月报表集合</returns>
|
||||
/// <returns>企业安全数据统计月报集合</returns>
|
||||
public static List<Model.View_Information_MillionsMonthlyReport> GetMillionsMonthlyReportsByUnitId(string UnitId)
|
||||
{
|
||||
return (from x in Funs.DB.View_Information_MillionsMonthlyReport where x.UnitId == UnitId orderby x.FillingDate descending select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加百万工时安全统计月报表
|
||||
/// 增加企业安全数据统计月报
|
||||
/// </summary>
|
||||
/// <param name="MillionsMonthlyReport">百万工时安全统计月报表实体</param>
|
||||
/// <param name="MillionsMonthlyReport">企业安全数据统计月报实体</param>
|
||||
public static void AddMillionsMonthlyReport(Model.Information_MillionsMonthlyReport MillionsMonthlyReport)
|
||||
{
|
||||
Model.Information_MillionsMonthlyReport newMillionsMonthlyReport = new Model.Information_MillionsMonthlyReport
|
||||
@@ -59,7 +59,23 @@ namespace BLL
|
||||
FillingMan = MillionsMonthlyReport.FillingMan,
|
||||
UpState = MillionsMonthlyReport.UpState,
|
||||
HandleState = MillionsMonthlyReport.HandleState,
|
||||
HandleMan = MillionsMonthlyReport.HandleMan
|
||||
HandleMan = MillionsMonthlyReport.HandleMan,
|
||||
InputCosts = MillionsMonthlyReport.InputCosts,
|
||||
TrainNum = MillionsMonthlyReport.TrainNum,
|
||||
GeneralHazardNum = MillionsMonthlyReport.GeneralHazardNum,
|
||||
MajorHazardNum = MillionsMonthlyReport.MajorHazardNum,
|
||||
NotProofLargeProjectNum = MillionsMonthlyReport.NotProofLargeProjectNum,
|
||||
ProofLargeProjectNum = MillionsMonthlyReport.ProofLargeProjectNum,
|
||||
FireLicenseNum = MillionsMonthlyReport.FireLicenseNum,
|
||||
LimitLicenseNum = MillionsMonthlyReport.LimitLicenseNum,
|
||||
HighLicenseNum = MillionsMonthlyReport.HighLicenseNum,
|
||||
HoistingLicenseNum = MillionsMonthlyReport.HoistingLicenseNum,
|
||||
BreakGroundLicenseNum = MillionsMonthlyReport.BreakGroundLicenseNum,
|
||||
ElectricityLicenseNum = MillionsMonthlyReport.ElectricityLicenseNum,
|
||||
RTLicenseNum = MillionsMonthlyReport.RTLicenseNum,
|
||||
NightLicenseNum = MillionsMonthlyReport.NightLicenseNum,
|
||||
CommissionerNum = MillionsMonthlyReport.CommissionerNum,
|
||||
SoleDutyNum = MillionsMonthlyReport.SoleDutyNum,
|
||||
};
|
||||
|
||||
Funs.DB.Information_MillionsMonthlyReport.InsertOnSubmit(newMillionsMonthlyReport);
|
||||
@@ -67,9 +83,9 @@ namespace BLL
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改百万工时安全统计月报表
|
||||
/// 修改企业安全数据统计月报
|
||||
/// </summary>
|
||||
/// <param name="MillionsMonthlyReport">百万工时安全统计月报表实体</param>
|
||||
/// <param name="MillionsMonthlyReport">企业安全数据统计月报实体</param>
|
||||
public static void UpdateMillionsMonthlyReport(Model.Information_MillionsMonthlyReport MillionsMonthlyReport)
|
||||
{
|
||||
Model.Information_MillionsMonthlyReport newMillionsMonthlyReport = Funs.DB.Information_MillionsMonthlyReport.FirstOrDefault(e => e.MillionsMonthlyReportId == MillionsMonthlyReport.MillionsMonthlyReportId);
|
||||
@@ -88,6 +104,22 @@ namespace BLL
|
||||
newMillionsMonthlyReport.UpState = MillionsMonthlyReport.UpState;
|
||||
newMillionsMonthlyReport.HandleState = MillionsMonthlyReport.HandleState;
|
||||
newMillionsMonthlyReport.HandleMan = MillionsMonthlyReport.HandleMan;
|
||||
newMillionsMonthlyReport.InputCosts = MillionsMonthlyReport.InputCosts;
|
||||
newMillionsMonthlyReport.TrainNum = MillionsMonthlyReport.TrainNum;
|
||||
newMillionsMonthlyReport.GeneralHazardNum = MillionsMonthlyReport.GeneralHazardNum;
|
||||
newMillionsMonthlyReport.MajorHazardNum = MillionsMonthlyReport.MajorHazardNum;
|
||||
newMillionsMonthlyReport.NotProofLargeProjectNum = MillionsMonthlyReport.NotProofLargeProjectNum;
|
||||
newMillionsMonthlyReport.ProofLargeProjectNum = MillionsMonthlyReport.ProofLargeProjectNum;
|
||||
newMillionsMonthlyReport.FireLicenseNum = MillionsMonthlyReport.FireLicenseNum;
|
||||
newMillionsMonthlyReport.LimitLicenseNum = MillionsMonthlyReport.LimitLicenseNum;
|
||||
newMillionsMonthlyReport.HighLicenseNum = MillionsMonthlyReport.HighLicenseNum;
|
||||
newMillionsMonthlyReport.HoistingLicenseNum = MillionsMonthlyReport.HoistingLicenseNum;
|
||||
newMillionsMonthlyReport.BreakGroundLicenseNum = MillionsMonthlyReport.BreakGroundLicenseNum;
|
||||
newMillionsMonthlyReport.ElectricityLicenseNum = MillionsMonthlyReport.ElectricityLicenseNum;
|
||||
newMillionsMonthlyReport.RTLicenseNum = MillionsMonthlyReport.RTLicenseNum;
|
||||
newMillionsMonthlyReport.NightLicenseNum = MillionsMonthlyReport.NightLicenseNum;
|
||||
newMillionsMonthlyReport.CommissionerNum = MillionsMonthlyReport.CommissionerNum;
|
||||
newMillionsMonthlyReport.SoleDutyNum = MillionsMonthlyReport.SoleDutyNum;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 质量管理工作总结报告
|
||||
/// </summary>
|
||||
public static class QualityWorkSummaryReportService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取质量管理工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="qualityWorkSummaryReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_QualityWorkSummaryReport GetQualityWorkSummaryReportById(string qualityWorkSummaryReportId)
|
||||
{
|
||||
return Funs.DB.Information_QualityWorkSummaryReport.FirstOrDefault(e => e.QualityWorkSummaryReportId == qualityWorkSummaryReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 质量管理工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="unitId">单位Id</param>
|
||||
/// <param name="year">年度</param>
|
||||
/// <returns>质量管理工作总结报告</returns>
|
||||
public static Model.Information_QualityWorkSummaryReport GetQualityWorkSummaryReportByUnitIdAndYear(string unitId, int year)
|
||||
{
|
||||
return Funs.DB.Information_QualityWorkSummaryReport.FirstOrDefault(e => e.UnitId == unitId && e.YearId == year);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加质量管理工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="qualityWorkSummaryReport"></param>
|
||||
public static void AddQualityWorkSummaryReport(Model.Information_QualityWorkSummaryReport qualityWorkSummaryReport)
|
||||
{
|
||||
Model.Information_QualityWorkSummaryReport newQualityWorkSummaryReport = new Model.Information_QualityWorkSummaryReport
|
||||
{
|
||||
QualityWorkSummaryReportId = qualityWorkSummaryReport.QualityWorkSummaryReportId,
|
||||
YearId = qualityWorkSummaryReport.YearId,
|
||||
UnitId = qualityWorkSummaryReport.UnitId,
|
||||
ResponsiblePerson = qualityWorkSummaryReport.ResponsiblePerson,
|
||||
ResponsiblePersonTel = qualityWorkSummaryReport.ResponsiblePersonTel,
|
||||
ContactPerson = qualityWorkSummaryReport.ContactPerson,
|
||||
ContactPersonTel = qualityWorkSummaryReport.ContactPersonTel,
|
||||
ReportDate = qualityWorkSummaryReport.ReportDate,
|
||||
Performance = qualityWorkSummaryReport.Performance,
|
||||
AccidentSituation = qualityWorkSummaryReport.AccidentSituation,
|
||||
Awards = qualityWorkSummaryReport.Awards,
|
||||
WorkDevelopment = qualityWorkSummaryReport.WorkDevelopment,
|
||||
PersonnelTraining = qualityWorkSummaryReport.PersonnelTraining,
|
||||
CheckSituation = qualityWorkSummaryReport.CheckSituation,
|
||||
ManagementActivity = qualityWorkSummaryReport.ManagementActivity,
|
||||
WorkExperience = qualityWorkSummaryReport.WorkExperience,
|
||||
Countermeasures = qualityWorkSummaryReport.Countermeasures,
|
||||
NextYearWorkPlan = qualityWorkSummaryReport.NextYearWorkPlan,
|
||||
JobSuggestion = qualityWorkSummaryReport.JobSuggestion,
|
||||
UpState = qualityWorkSummaryReport.UpState
|
||||
};
|
||||
Funs.DB.Information_QualityWorkSummaryReport.InsertOnSubmit(newQualityWorkSummaryReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改质量管理工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="qualityWorkSummaryReport"></param>
|
||||
public static void UpdateQualityWorkSummaryReport(Model.Information_QualityWorkSummaryReport qualityWorkSummaryReport)
|
||||
{
|
||||
Model.Information_QualityWorkSummaryReport newQualityWorkSummaryReport = Funs.DB.Information_QualityWorkSummaryReport.FirstOrDefault(e => e.QualityWorkSummaryReportId == qualityWorkSummaryReport.QualityWorkSummaryReportId);
|
||||
if (newQualityWorkSummaryReport != null)
|
||||
{
|
||||
newQualityWorkSummaryReport.UnitId = qualityWorkSummaryReport.UnitId;
|
||||
newQualityWorkSummaryReport.YearId = qualityWorkSummaryReport.YearId;
|
||||
newQualityWorkSummaryReport.ResponsiblePerson = qualityWorkSummaryReport.ResponsiblePerson;
|
||||
newQualityWorkSummaryReport.ResponsiblePersonTel = qualityWorkSummaryReport.ResponsiblePersonTel;
|
||||
newQualityWorkSummaryReport.ContactPerson = qualityWorkSummaryReport.ContactPerson;
|
||||
newQualityWorkSummaryReport.ContactPersonTel = qualityWorkSummaryReport.ContactPersonTel;
|
||||
newQualityWorkSummaryReport.ReportDate = qualityWorkSummaryReport.ReportDate;
|
||||
newQualityWorkSummaryReport.Performance = qualityWorkSummaryReport.Performance;
|
||||
newQualityWorkSummaryReport.AccidentSituation = qualityWorkSummaryReport.AccidentSituation;
|
||||
newQualityWorkSummaryReport.Awards = qualityWorkSummaryReport.Awards;
|
||||
newQualityWorkSummaryReport.WorkDevelopment = qualityWorkSummaryReport.WorkDevelopment;
|
||||
newQualityWorkSummaryReport.PersonnelTraining = qualityWorkSummaryReport.PersonnelTraining;
|
||||
newQualityWorkSummaryReport.CheckSituation = qualityWorkSummaryReport.CheckSituation;
|
||||
newQualityWorkSummaryReport.ManagementActivity = qualityWorkSummaryReport.ManagementActivity;
|
||||
newQualityWorkSummaryReport.WorkExperience = qualityWorkSummaryReport.WorkExperience;
|
||||
newQualityWorkSummaryReport.Countermeasures = qualityWorkSummaryReport.Countermeasures;
|
||||
newQualityWorkSummaryReport.NextYearWorkPlan = qualityWorkSummaryReport.NextYearWorkPlan;
|
||||
newQualityWorkSummaryReport.JobSuggestion = qualityWorkSummaryReport.JobSuggestion;
|
||||
newQualityWorkSummaryReport.UpState = qualityWorkSummaryReport.UpState;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除质量管理工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="QualityWorkSummaryReportId"></param>
|
||||
public static void DeleteQualityWorkSummaryReportById(string QualityWorkSummaryReportId)
|
||||
{
|
||||
Model.Information_QualityWorkSummaryReport qualityWorkSummaryReport = Funs.DB.Information_QualityWorkSummaryReport.FirstOrDefault(e => e.QualityWorkSummaryReportId == QualityWorkSummaryReportId);
|
||||
if (qualityWorkSummaryReport != null)
|
||||
{
|
||||
Funs.DB.Information_QualityWorkSummaryReport.DeleteOnSubmit(qualityWorkSummaryReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 季度工程项目质量信息表
|
||||
/// </summary>
|
||||
public static class QuarterlyProjectQualityService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取季度工程项目质量信息表
|
||||
/// </summary>
|
||||
/// <param name="quarterlyProjectQualityId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_QuarterlyProjectQuality GetQuarterlyProjectQualityById(string quarterlyProjectQualityId)
|
||||
{
|
||||
return Funs.DB.Information_QuarterlyProjectQuality.FirstOrDefault(e => e.QuarterlyProjectQualityId == quarterlyProjectQualityId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 季度工程项目质量信息表
|
||||
/// </summary>
|
||||
/// <param name="unitId">单位Id</param>
|
||||
/// <param name="year">年度</param>
|
||||
/// <param name="quarter">季度</param>
|
||||
/// <returns>季度工程项目质量信息表</returns>
|
||||
public static Model.Information_QuarterlyProjectQuality GetQuarterlyProjectQualityByUnitIdAndYearAndQuarter(string unitId, int year,int quarter)
|
||||
{
|
||||
return Funs.DB.Information_QuarterlyProjectQuality.FirstOrDefault(e => e.UnitId == unitId && e.Year == year && e.Quarter == quarter);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加季度工程项目质量信息表
|
||||
/// </summary>
|
||||
/// <param name="quarterlyProjectQuality"></param>
|
||||
public static void AddQuarterlyProjectQuality(Model.Information_QuarterlyProjectQuality quarterlyProjectQuality)
|
||||
{
|
||||
Model.Information_QuarterlyProjectQuality newQuarterlyProjectQuality = new Model.Information_QuarterlyProjectQuality
|
||||
{
|
||||
QuarterlyProjectQualityId = quarterlyProjectQuality.QuarterlyProjectQualityId,
|
||||
UnitId = quarterlyProjectQuality.UnitId,
|
||||
Year = quarterlyProjectQuality.Year,
|
||||
Quarter = quarterlyProjectQuality.Quarter,
|
||||
QualityManagePersonNum = quarterlyProjectQuality.QualityManagePersonNum,
|
||||
AdvancedTitlePersonNum = quarterlyProjectQuality.AdvancedTitlePersonNum,
|
||||
IntermediateTitlePersonNum = quarterlyProjectQuality.IntermediateTitlePersonNum,
|
||||
BeImplementedProjectNum = quarterlyProjectQuality.BeImplementedProjectNum,
|
||||
StartImplementedProjectNum = quarterlyProjectQuality.StartImplementedProjectNum,
|
||||
AccumulativeStartImplemented = quarterlyProjectQuality.AccumulativeStartImplemented,
|
||||
CompleteProjectNum = quarterlyProjectQuality.CompleteProjectNum,
|
||||
YearCompleteProjectNum = quarterlyProjectQuality.YearCompleteProjectNum,
|
||||
QuarterTotal = quarterlyProjectQuality.QuarterTotal,
|
||||
QuarterFirstPassNum = quarterlyProjectQuality.QuarterFirstPassNum,
|
||||
QuarterFirstPassRate = quarterlyProjectQuality.QuarterFirstPassRate,
|
||||
YearTotal = quarterlyProjectQuality.YearTotal,
|
||||
YearFirstPassNum = quarterlyProjectQuality.YearFirstPassNum,
|
||||
YearFirstPassRate = quarterlyProjectQuality.YearFirstPassRate,
|
||||
QuaterCheckSuperviseNum = quarterlyProjectQuality.QuaterCheckSuperviseNum,
|
||||
QuaterCorrectiveNoticeNum = quarterlyProjectQuality.QuaterCorrectiveNoticeNum,
|
||||
QuaterQualityProblemNum = quarterlyProjectQuality.QuaterQualityProblemNum,
|
||||
QuaterClosedQualityProblemNum = quarterlyProjectQuality.QuaterClosedQualityProblemNum,
|
||||
YearCheckSuperviseNum = quarterlyProjectQuality.YearCheckSuperviseNum,
|
||||
YearCorrectiveNoticeNum = quarterlyProjectQuality.YearCorrectiveNoticeNum,
|
||||
YearQualityProblemNum = quarterlyProjectQuality.YearQualityProblemNum,
|
||||
YearClosedQualityProblemNum = quarterlyProjectQuality.YearClosedQualityProblemNum,
|
||||
QuaterQualityAccidentNum = quarterlyProjectQuality.QuaterQualityAccidentNum,
|
||||
QuaterDirectEconomicLoss = quarterlyProjectQuality.QuaterDirectEconomicLoss,
|
||||
YearQualityAccidentNum = quarterlyProjectQuality.YearQualityAccidentNum,
|
||||
YearDirectEconomicLoss = quarterlyProjectQuality.YearDirectEconomicLoss,
|
||||
ResponsiblePerson = quarterlyProjectQuality.ResponsiblePerson,
|
||||
CompileMan = quarterlyProjectQuality.CompileMan,
|
||||
CompileDate = quarterlyProjectQuality.CompileDate,
|
||||
Tel = quarterlyProjectQuality.Tel,
|
||||
UpState = quarterlyProjectQuality.UpState
|
||||
};
|
||||
Funs.DB.Information_QuarterlyProjectQuality.InsertOnSubmit(newQuarterlyProjectQuality);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改季度工程项目质量信息表
|
||||
/// </summary>
|
||||
/// <param name="quarterlyProjectQuality"></param>
|
||||
public static void UpdateQuarterlyProjectQuality(Model.Information_QuarterlyProjectQuality quarterlyProjectQuality)
|
||||
{
|
||||
Model.Information_QuarterlyProjectQuality newQuarterlyProjectQuality = Funs.DB.Information_QuarterlyProjectQuality.FirstOrDefault(e => e.QuarterlyProjectQualityId == quarterlyProjectQuality.QuarterlyProjectQualityId);
|
||||
if (newQuarterlyProjectQuality != null)
|
||||
{
|
||||
newQuarterlyProjectQuality.UnitId = quarterlyProjectQuality.UnitId;
|
||||
newQuarterlyProjectQuality.Year = quarterlyProjectQuality.Year;
|
||||
newQuarterlyProjectQuality.Quarter = quarterlyProjectQuality.Quarter;
|
||||
newQuarterlyProjectQuality.QualityManagePersonNum = quarterlyProjectQuality.QualityManagePersonNum;
|
||||
newQuarterlyProjectQuality.AdvancedTitlePersonNum = quarterlyProjectQuality.AdvancedTitlePersonNum;
|
||||
newQuarterlyProjectQuality.IntermediateTitlePersonNum = quarterlyProjectQuality.IntermediateTitlePersonNum;
|
||||
newQuarterlyProjectQuality.BeImplementedProjectNum = quarterlyProjectQuality.BeImplementedProjectNum;
|
||||
newQuarterlyProjectQuality.StartImplementedProjectNum = quarterlyProjectQuality.StartImplementedProjectNum;
|
||||
newQuarterlyProjectQuality.AccumulativeStartImplemented = quarterlyProjectQuality.AccumulativeStartImplemented;
|
||||
newQuarterlyProjectQuality.CompleteProjectNum = quarterlyProjectQuality.CompleteProjectNum;
|
||||
newQuarterlyProjectQuality.YearCompleteProjectNum = quarterlyProjectQuality.YearCompleteProjectNum;
|
||||
newQuarterlyProjectQuality.QuarterTotal = quarterlyProjectQuality.QuarterTotal;
|
||||
newQuarterlyProjectQuality.QuarterFirstPassNum = quarterlyProjectQuality.QuarterFirstPassNum;
|
||||
newQuarterlyProjectQuality.QuarterFirstPassRate = quarterlyProjectQuality.QuarterFirstPassRate;
|
||||
newQuarterlyProjectQuality.YearTotal = quarterlyProjectQuality.YearTotal;
|
||||
newQuarterlyProjectQuality.YearFirstPassNum = quarterlyProjectQuality.YearFirstPassNum;
|
||||
newQuarterlyProjectQuality.YearFirstPassRate = quarterlyProjectQuality.YearFirstPassRate;
|
||||
newQuarterlyProjectQuality.QuaterCheckSuperviseNum = quarterlyProjectQuality.QuaterCheckSuperviseNum;
|
||||
newQuarterlyProjectQuality.QuaterCorrectiveNoticeNum = quarterlyProjectQuality.QuaterCorrectiveNoticeNum;
|
||||
newQuarterlyProjectQuality.QuaterQualityProblemNum = quarterlyProjectQuality.QuaterQualityProblemNum;
|
||||
newQuarterlyProjectQuality.QuaterClosedQualityProblemNum = quarterlyProjectQuality.QuaterClosedQualityProblemNum;
|
||||
newQuarterlyProjectQuality.YearCheckSuperviseNum = quarterlyProjectQuality.YearCheckSuperviseNum;
|
||||
newQuarterlyProjectQuality.YearCorrectiveNoticeNum = quarterlyProjectQuality.YearCorrectiveNoticeNum;
|
||||
newQuarterlyProjectQuality.YearQualityProblemNum = quarterlyProjectQuality.YearQualityProblemNum;
|
||||
newQuarterlyProjectQuality.YearClosedQualityProblemNum = quarterlyProjectQuality.YearClosedQualityProblemNum;
|
||||
newQuarterlyProjectQuality.QuaterQualityAccidentNum = quarterlyProjectQuality.QuaterQualityAccidentNum;
|
||||
newQuarterlyProjectQuality.QuaterDirectEconomicLoss = quarterlyProjectQuality.QuaterDirectEconomicLoss;
|
||||
newQuarterlyProjectQuality.YearQualityAccidentNum = quarterlyProjectQuality.YearQualityAccidentNum;
|
||||
newQuarterlyProjectQuality.YearDirectEconomicLoss = quarterlyProjectQuality.YearDirectEconomicLoss;
|
||||
newQuarterlyProjectQuality.ResponsiblePerson = quarterlyProjectQuality.ResponsiblePerson;
|
||||
newQuarterlyProjectQuality.CompileMan = quarterlyProjectQuality.CompileMan;
|
||||
newQuarterlyProjectQuality.CompileDate = quarterlyProjectQuality.CompileDate;
|
||||
newQuarterlyProjectQuality.Tel = quarterlyProjectQuality.Tel;
|
||||
newQuarterlyProjectQuality.UpState = quarterlyProjectQuality.UpState;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除季度工程项目质量信息表
|
||||
/// </summary>
|
||||
/// <param name="quarterlyProjectQualityId"></param>
|
||||
public static void DeleteQuarterlyProjectQualityById(string quarterlyProjectQualityId)
|
||||
{
|
||||
Model.Information_QuarterlyProjectQuality quarterlyProjectQuality = Funs.DB.Information_QuarterlyProjectQuality.FirstOrDefault(e => e.QuarterlyProjectQualityId == quarterlyProjectQualityId);
|
||||
if (quarterlyProjectQuality != null)
|
||||
{
|
||||
Funs.DB.Information_QuarterlyProjectQuality.DeleteOnSubmit(quarterlyProjectQuality);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 实业安全简报
|
||||
/// </summary>
|
||||
public static class SafetyBriefingService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取实业安全简报
|
||||
/// </summary>
|
||||
/// <param name="safetyBriefingId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_SafetyBriefing GetSafetyBriefingById(string safetyBriefingId)
|
||||
{
|
||||
return Funs.DB.Information_SafetyBriefing.FirstOrDefault(e => e.SafetyBriefingId == safetyBriefingId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 实业安全简报
|
||||
/// </summary>
|
||||
/// <param name="unitId">单位Id</param>
|
||||
/// <param name="year">年度</param>
|
||||
/// <param name="month">月份</param>
|
||||
/// <returns>实业安全简报</returns>
|
||||
public static Model.Information_SafetyBriefing GetSafetyBriefingByUnitIdAndYearAndMonth(string unitId, int year,int month)
|
||||
{
|
||||
return Funs.DB.Information_SafetyBriefing.FirstOrDefault(e => e.UnitId == unitId && e.YearId == year && e.Month == month);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加实业安全简报
|
||||
/// </summary>
|
||||
/// <param name="safetyBriefing"></param>
|
||||
public static void AddSafetyBriefing(Model.Information_SafetyBriefing safetyBriefing)
|
||||
{
|
||||
Model.Information_SafetyBriefing newSafetyBriefing = new Model.Information_SafetyBriefing
|
||||
{
|
||||
SafetyBriefingId = safetyBriefing.SafetyBriefingId,
|
||||
UnitId = safetyBriefing.UnitId,
|
||||
YearId = safetyBriefing.YearId,
|
||||
Month = safetyBriefing.Month,
|
||||
CompileMan = safetyBriefing.CompileMan,
|
||||
CompileDate = safetyBriefing.CompileDate,
|
||||
Auditor = safetyBriefing.Auditor,
|
||||
Approver = safetyBriefing.Approver,
|
||||
MainWork=safetyBriefing.MainWork,
|
||||
HazardRecording=safetyBriefing.HazardRecording,
|
||||
SafetyAccident=safetyBriefing.SafetyAccident,
|
||||
EPAccident=safetyBriefing.EPAccident,
|
||||
OHAccident=safetyBriefing.OHAccident,
|
||||
WorkPermitNum=safetyBriefing.WorkPermitNum,
|
||||
HiddenDangerDetection=safetyBriefing.HiddenDangerDetection,
|
||||
RectificationSituation=safetyBriefing.RectificationSituation,
|
||||
CheckProblemsRectification=safetyBriefing.CheckProblemsRectification,
|
||||
PendingProject=safetyBriefing.PendingProject,
|
||||
ContractorManagement=safetyBriefing.ContractorManagement,
|
||||
EnvironmentalEmissions=safetyBriefing.EnvironmentalEmissions,
|
||||
NextMonthWorkPlan=safetyBriefing.NextMonthWorkPlan,
|
||||
UpState = safetyBriefing.UpState
|
||||
};
|
||||
Funs.DB.Information_SafetyBriefing.InsertOnSubmit(newSafetyBriefing);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改实业安全简报
|
||||
/// </summary>
|
||||
/// <param name="safetyBriefing"></param>
|
||||
public static void UpdateSafetyBriefing(Model.Information_SafetyBriefing safetyBriefing)
|
||||
{
|
||||
Model.Information_SafetyBriefing newSafetyBriefing = Funs.DB.Information_SafetyBriefing.FirstOrDefault(e => e.SafetyBriefingId == safetyBriefing.SafetyBriefingId);
|
||||
if (newSafetyBriefing != null)
|
||||
{
|
||||
newSafetyBriefing.UnitId = safetyBriefing.UnitId;
|
||||
newSafetyBriefing.YearId = safetyBriefing.YearId;
|
||||
newSafetyBriefing.Month = safetyBriefing.Month;
|
||||
newSafetyBriefing.CompileMan = safetyBriefing.CompileMan;
|
||||
newSafetyBriefing.CompileDate = safetyBriefing.CompileDate;
|
||||
newSafetyBriefing.Auditor = safetyBriefing.Auditor;
|
||||
newSafetyBriefing.Approver = safetyBriefing.Approver;
|
||||
newSafetyBriefing.MainWork = safetyBriefing.MainWork;
|
||||
newSafetyBriefing.HazardRecording = safetyBriefing.HazardRecording;
|
||||
newSafetyBriefing.SafetyAccident = safetyBriefing.SafetyAccident;
|
||||
newSafetyBriefing.EPAccident = safetyBriefing.EPAccident;
|
||||
newSafetyBriefing.OHAccident = safetyBriefing.OHAccident;
|
||||
newSafetyBriefing.WorkPermitNum = safetyBriefing.WorkPermitNum;
|
||||
newSafetyBriefing.HiddenDangerDetection = safetyBriefing.HiddenDangerDetection;
|
||||
newSafetyBriefing.RectificationSituation = safetyBriefing.RectificationSituation;
|
||||
newSafetyBriefing.CheckProblemsRectification = safetyBriefing.CheckProblemsRectification;
|
||||
newSafetyBriefing.PendingProject = safetyBriefing.PendingProject;
|
||||
newSafetyBriefing.ContractorManagement = safetyBriefing.ContractorManagement;
|
||||
newSafetyBriefing.EnvironmentalEmissions = safetyBriefing.EnvironmentalEmissions;
|
||||
newSafetyBriefing.NextMonthWorkPlan = safetyBriefing.NextMonthWorkPlan;
|
||||
newSafetyBriefing.UpState = safetyBriefing.UpState;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除实业安全简报
|
||||
/// </summary>
|
||||
/// <param name="safetyBriefingId"></param>
|
||||
public static void DeleteSafetyBriefingById(string safetyBriefingId)
|
||||
{
|
||||
Model.Information_SafetyBriefing safetyBriefing = Funs.DB.Information_SafetyBriefing.FirstOrDefault(e => e.SafetyBriefingId == safetyBriefingId);
|
||||
if (safetyBriefing != null)
|
||||
{
|
||||
Funs.DB.Information_SafetyBriefing.DeleteOnSubmit(safetyBriefing);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,9 +4,11 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
namespace BLL
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class UrgeReportService
|
||||
{
|
||||
/// <summary>
|
||||
@@ -19,11 +21,11 @@ namespace BLL
|
||||
public static void SetComplete(string unitId, string reportType, string year, string value)
|
||||
{
|
||||
Model.Information_UrgeReport urgeReport = new Model.Information_UrgeReport();
|
||||
if (reportType == Const.ReportType_1 || reportType == Const.ReportType_2)
|
||||
if (reportType == Const.ReportType_1 || reportType == Const.ReportType_2 || reportType == Const.ReportType_8)
|
||||
{
|
||||
urgeReport = Funs.DB.Information_UrgeReport.FirstOrDefault(x => x.UnitId == unitId && x.ReprotType == reportType && x.YearId == year && x.MonthId == value);
|
||||
}
|
||||
else if (reportType == Const.ReportType_3 || reportType == Const.ReportType_4)
|
||||
else if (reportType == Const.ReportType_3 || reportType == Const.ReportType_4 || reportType == Const.ReportType_9)
|
||||
{
|
||||
urgeReport = Funs.DB.Information_UrgeReport.FirstOrDefault(x => x.UnitId == unitId && x.ReprotType == reportType && x.YearId == year && x.QuarterId == value);
|
||||
}
|
||||
@@ -31,6 +33,10 @@ namespace BLL
|
||||
{
|
||||
urgeReport = Funs.DB.Information_UrgeReport.FirstOrDefault(x => x.UnitId == unitId && x.ReprotType == reportType && x.YearId == year && x.HalfYearId == value);
|
||||
}
|
||||
else if (reportType == Const.ReportType_6 || reportType == Const.ReportType_7 || reportType == Const.ReportType_10)
|
||||
{
|
||||
urgeReport = Funs.DB.Information_UrgeReport.FirstOrDefault(x => x.UnitId == unitId && x.ReprotType == reportType && x.YearId == year);
|
||||
}
|
||||
if (urgeReport != null)
|
||||
{
|
||||
urgeReport.IsComplete = true;
|
||||
@@ -38,5 +44,4 @@ namespace BLL
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 安全管理工作总结报告
|
||||
/// </summary>
|
||||
public static class WorkSummaryReportService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取安全管理工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="workSummaryReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_WorkSummaryReport GetWorkSummaryReportById(string workSummaryReportId)
|
||||
{
|
||||
return Funs.DB.Information_WorkSummaryReport.FirstOrDefault(e => e.WorkSummaryReportId == workSummaryReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 安全管理工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="unitId">单位Id</param>
|
||||
/// <param name="year">年度</param>
|
||||
/// <returns>安全管理工作总结报告</returns>
|
||||
public static Model.Information_WorkSummaryReport GetWorkSummaryReportByUnitIdAndYear(string unitId, int year)
|
||||
{
|
||||
return Funs.DB.Information_WorkSummaryReport.FirstOrDefault(e => e.UnitId == unitId && e.YearId == year);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加安全管理工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="workSummaryReport"></param>
|
||||
public static void AddWorkSummaryReport(Model.Information_WorkSummaryReport workSummaryReport)
|
||||
{
|
||||
Model.Information_WorkSummaryReport newWorkSummaryReport = new Model.Information_WorkSummaryReport
|
||||
{
|
||||
WorkSummaryReportId = workSummaryReport.WorkSummaryReportId,
|
||||
YearId = workSummaryReport.YearId,
|
||||
UnitId = workSummaryReport.UnitId,
|
||||
ResponsiblePerson = workSummaryReport.ResponsiblePerson,
|
||||
ResponsiblePersonTel = workSummaryReport.ResponsiblePersonTel,
|
||||
ContactPerson = workSummaryReport.ContactPerson,
|
||||
ContactPersonTel = workSummaryReport.ContactPersonTel,
|
||||
ReportDate = workSummaryReport.ReportDate,
|
||||
SafeLaborTime = workSummaryReport.SafeLaborTime,
|
||||
SafetyObjectives = workSummaryReport.SafetyObjectives,
|
||||
AccidentSituation = workSummaryReport.AccidentSituation,
|
||||
Awards = workSummaryReport.Awards,
|
||||
WorkDevelopment = workSummaryReport.WorkDevelopment,
|
||||
PersonnelTraining = workSummaryReport.PersonnelTraining,
|
||||
GovernanceSituation = workSummaryReport.GovernanceSituation,
|
||||
ManagementActivity = workSummaryReport.ManagementActivity,
|
||||
WorkExperience = workSummaryReport.WorkExperience,
|
||||
Countermeasures = workSummaryReport.Countermeasures,
|
||||
NextYearWorkPlan = workSummaryReport.NextYearWorkPlan,
|
||||
JobSuggestion = workSummaryReport.JobSuggestion,
|
||||
UpState = workSummaryReport.UpState
|
||||
};
|
||||
Funs.DB.Information_WorkSummaryReport.InsertOnSubmit(newWorkSummaryReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改安全管理工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="workSummaryReport"></param>
|
||||
public static void UpdateWorkSummaryReport(Model.Information_WorkSummaryReport workSummaryReport)
|
||||
{
|
||||
Model.Information_WorkSummaryReport newWorkSummaryReport = Funs.DB.Information_WorkSummaryReport.FirstOrDefault(e => e.WorkSummaryReportId == workSummaryReport.WorkSummaryReportId);
|
||||
if (newWorkSummaryReport != null)
|
||||
{
|
||||
newWorkSummaryReport.UnitId = workSummaryReport.UnitId;
|
||||
newWorkSummaryReport.YearId = workSummaryReport.YearId;
|
||||
newWorkSummaryReport.ResponsiblePerson = workSummaryReport.ResponsiblePerson;
|
||||
newWorkSummaryReport.ResponsiblePersonTel = workSummaryReport.ResponsiblePersonTel;
|
||||
newWorkSummaryReport.ContactPerson = workSummaryReport.ContactPerson;
|
||||
newWorkSummaryReport.ContactPersonTel = workSummaryReport.ContactPersonTel;
|
||||
newWorkSummaryReport.ReportDate = workSummaryReport.ReportDate;
|
||||
newWorkSummaryReport.SafeLaborTime = workSummaryReport.SafeLaborTime;
|
||||
newWorkSummaryReport.SafetyObjectives = workSummaryReport.SafetyObjectives;
|
||||
newWorkSummaryReport.AccidentSituation = workSummaryReport.AccidentSituation;
|
||||
newWorkSummaryReport.Awards = workSummaryReport.Awards;
|
||||
newWorkSummaryReport.WorkDevelopment = workSummaryReport.WorkDevelopment;
|
||||
newWorkSummaryReport.PersonnelTraining = workSummaryReport.PersonnelTraining;
|
||||
newWorkSummaryReport.GovernanceSituation = workSummaryReport.GovernanceSituation;
|
||||
newWorkSummaryReport.ManagementActivity = workSummaryReport.ManagementActivity;
|
||||
newWorkSummaryReport.WorkExperience = workSummaryReport.WorkExperience;
|
||||
newWorkSummaryReport.Countermeasures = workSummaryReport.Countermeasures;
|
||||
newWorkSummaryReport.NextYearWorkPlan = workSummaryReport.NextYearWorkPlan;
|
||||
newWorkSummaryReport.JobSuggestion = workSummaryReport.JobSuggestion;
|
||||
newWorkSummaryReport.UpState = workSummaryReport.UpState;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除安全管理工作总结报告
|
||||
/// </summary>
|
||||
/// <param name="workSummaryReportId"></param>
|
||||
public static void DeleteWorkSummaryReportById(string workSummaryReportId)
|
||||
{
|
||||
Model.Information_WorkSummaryReport workSummaryReport = Funs.DB.Information_WorkSummaryReport.FirstOrDefault(e => e.WorkSummaryReportId == workSummaryReportId);
|
||||
if (workSummaryReport != null)
|
||||
{
|
||||
Funs.DB.Information_WorkSummaryReport.DeleteOnSubmit(workSummaryReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user