增加公司级五张报表功能
This commit is contained in:
@@ -0,0 +1,181 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class AccidentCauseReportItemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 职工伤亡事故原因分析报表明细表
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReportItemId">职工伤亡事故原因分析报表明细表Id</param>
|
||||
/// <returns>职工伤亡事故原因分析报表明细表</returns>
|
||||
public static Model.Information_AccidentCauseReportItem GetAccidentCauseReportItemByAccidentCauseReportItemId(string AccidentCauseReportItemId)
|
||||
{
|
||||
return Funs.DB.Information_AccidentCauseReportItem.FirstOrDefault(e => e.AccidentCauseReportItemId == AccidentCauseReportItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 职工伤亡事故原因分析报表明细表
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReportItemId">职工伤亡事故原因分析报表明细表Id</param>
|
||||
/// <returns>职工伤亡事故原因分析报表明细表</returns>
|
||||
public static Model.Information_AccidentCauseReportItem GetAccidentCauseReportItemByAccidentCauseReportIdAndTypeId(string AccidentCauseReportId, string AccidentType)
|
||||
{
|
||||
return Funs.DB.Information_AccidentCauseReportItem.FirstOrDefault(e => e.AccidentCauseReportId == AccidentCauseReportId && e.AccidentType == AccidentType);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id判断是否存在明细记录
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReportItemId">职工伤亡事故原因分析报表表Id</param>
|
||||
/// <returns>是否存在明细记录</returns>
|
||||
public static bool IsExitItems(string AccidentCauseReportId)
|
||||
{
|
||||
return (from x in Funs.DB.Information_AccidentCauseReportItem where x.AccidentCauseReportId == AccidentCauseReportId select x).Count() > 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReportItemId">职工伤亡事故原因分析报表明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Information_AccidentCauseReportItem> GetItems(string AccidentCauseReportId)
|
||||
{
|
||||
return (from x in Funs.DB.Information_AccidentCauseReportItem
|
||||
join y in Funs.DB.Sys_Const on x.AccidentType equals y.ConstText
|
||||
where x.AccidentCauseReportId == AccidentCauseReportId && y.GroupId == ConstValue.Group_0012
|
||||
orderby y.SortIndex
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合(不包含总计行)
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReportItemId">职工伤亡事故原因分析报表明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Information_AccidentCauseReportItem> GetItemsNoSum(string AccidentCauseReportId)
|
||||
{
|
||||
return (from x in Funs.DB.Information_AccidentCauseReportItem
|
||||
join y in Funs.DB.Sys_Const on x.AccidentType equals y.ConstText
|
||||
where x.AccidentCauseReportId == AccidentCauseReportId && x.AccidentType != "总计" && y.GroupId == ConstValue.Group_0012
|
||||
orderby y.SortIndex
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加职工伤亡事故原因分析报表明细表
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReportItem">职工伤亡事故原因分析报表明细表实体</param>
|
||||
public static void AddAccidentCauseReportItem(Model.Information_AccidentCauseReportItem AccidentCauseReportItem)
|
||||
{
|
||||
Model.Information_AccidentCauseReportItem newAccidentCauseReportItem = new Model.Information_AccidentCauseReportItem
|
||||
{
|
||||
AccidentCauseReportItemId = AccidentCauseReportItem.AccidentCauseReportItemId,
|
||||
AccidentCauseReportId = AccidentCauseReportItem.AccidentCauseReportId,
|
||||
AccidentType = AccidentCauseReportItem.AccidentType,
|
||||
TotalDeath = AccidentCauseReportItem.TotalDeath,
|
||||
TotalInjuries = AccidentCauseReportItem.TotalInjuries,
|
||||
TotalMinorInjuries = AccidentCauseReportItem.TotalMinorInjuries,
|
||||
Death1 = AccidentCauseReportItem.Death1,
|
||||
Injuries1 = AccidentCauseReportItem.Injuries1,
|
||||
MinorInjuries1 = AccidentCauseReportItem.MinorInjuries1,
|
||||
Death2 = AccidentCauseReportItem.Death2,
|
||||
Injuries2 = AccidentCauseReportItem.Injuries2,
|
||||
MinorInjuries2 = AccidentCauseReportItem.MinorInjuries2,
|
||||
Death3 = AccidentCauseReportItem.Death3,
|
||||
Injuries3 = AccidentCauseReportItem.Injuries3,
|
||||
MinorInjuries3 = AccidentCauseReportItem.MinorInjuries3,
|
||||
Death4 = AccidentCauseReportItem.Death4,
|
||||
Injuries4 = AccidentCauseReportItem.Injuries4,
|
||||
MinorInjuries4 = AccidentCauseReportItem.MinorInjuries4,
|
||||
Death5 = AccidentCauseReportItem.Death5,
|
||||
Injuries5 = AccidentCauseReportItem.Injuries5,
|
||||
MinorInjuries5 = AccidentCauseReportItem.MinorInjuries5,
|
||||
Death6 = AccidentCauseReportItem.Death6,
|
||||
Injuries6 = AccidentCauseReportItem.Injuries6,
|
||||
MinorInjuries6 = AccidentCauseReportItem.MinorInjuries6,
|
||||
Death7 = AccidentCauseReportItem.Death7,
|
||||
Injuries7 = AccidentCauseReportItem.Injuries7,
|
||||
MinorInjuries7 = AccidentCauseReportItem.MinorInjuries7,
|
||||
Death8 = AccidentCauseReportItem.Death8,
|
||||
Injuries8 = AccidentCauseReportItem.Injuries8,
|
||||
MinorInjuries8 = AccidentCauseReportItem.MinorInjuries8,
|
||||
Death9 = AccidentCauseReportItem.Death9,
|
||||
Injuries9 = AccidentCauseReportItem.Injuries9,
|
||||
MinorInjuries9 = AccidentCauseReportItem.MinorInjuries9,
|
||||
Death10 = AccidentCauseReportItem.Death10,
|
||||
Injuries10 = AccidentCauseReportItem.Injuries10,
|
||||
MinorInjuries10 = AccidentCauseReportItem.MinorInjuries10,
|
||||
Death11 = AccidentCauseReportItem.Death11,
|
||||
Injuries11 = AccidentCauseReportItem.Injuries11,
|
||||
MinorInjuries11 = AccidentCauseReportItem.MinorInjuries11
|
||||
};
|
||||
|
||||
Funs.DB.Information_AccidentCauseReportItem.InsertOnSubmit(newAccidentCauseReportItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改职工伤亡事故原因分析报表明细表
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReportItem">职工伤亡事故原因分析报表明细表实体</param>
|
||||
public static void UpdateAccidentCauseReportItem(Model.Information_AccidentCauseReportItem AccidentCauseReportItem)
|
||||
{
|
||||
Model.Information_AccidentCauseReportItem newAccidentCauseReportItem = Funs.DB.Information_AccidentCauseReportItem.FirstOrDefault(e => e.AccidentCauseReportItemId == AccidentCauseReportItem.AccidentCauseReportItemId);
|
||||
newAccidentCauseReportItem.AccidentType = AccidentCauseReportItem.AccidentType;
|
||||
newAccidentCauseReportItem.TotalDeath = AccidentCauseReportItem.TotalDeath;
|
||||
newAccidentCauseReportItem.TotalInjuries = AccidentCauseReportItem.TotalInjuries;
|
||||
newAccidentCauseReportItem.TotalMinorInjuries = AccidentCauseReportItem.TotalMinorInjuries;
|
||||
newAccidentCauseReportItem.Death1 = AccidentCauseReportItem.Death1;
|
||||
newAccidentCauseReportItem.Injuries1 = AccidentCauseReportItem.Injuries1;
|
||||
newAccidentCauseReportItem.MinorInjuries1 = AccidentCauseReportItem.MinorInjuries1;
|
||||
newAccidentCauseReportItem.Death2 = AccidentCauseReportItem.Death2;
|
||||
newAccidentCauseReportItem.Injuries2 = AccidentCauseReportItem.Injuries2;
|
||||
newAccidentCauseReportItem.MinorInjuries2 = AccidentCauseReportItem.MinorInjuries2;
|
||||
newAccidentCauseReportItem.Death3 = AccidentCauseReportItem.Death3;
|
||||
newAccidentCauseReportItem.Injuries3 = AccidentCauseReportItem.Injuries3;
|
||||
newAccidentCauseReportItem.MinorInjuries3 = AccidentCauseReportItem.MinorInjuries3;
|
||||
newAccidentCauseReportItem.Death4 = AccidentCauseReportItem.Death4;
|
||||
newAccidentCauseReportItem.Injuries4 = AccidentCauseReportItem.Injuries4;
|
||||
newAccidentCauseReportItem.MinorInjuries4 = AccidentCauseReportItem.MinorInjuries4;
|
||||
newAccidentCauseReportItem.Death5 = AccidentCauseReportItem.Death5;
|
||||
newAccidentCauseReportItem.Injuries5 = AccidentCauseReportItem.Injuries5;
|
||||
newAccidentCauseReportItem.MinorInjuries5 = AccidentCauseReportItem.MinorInjuries5;
|
||||
newAccidentCauseReportItem.Death6 = AccidentCauseReportItem.Death6;
|
||||
newAccidentCauseReportItem.Injuries6 = AccidentCauseReportItem.Injuries6;
|
||||
newAccidentCauseReportItem.MinorInjuries6 = AccidentCauseReportItem.MinorInjuries6;
|
||||
newAccidentCauseReportItem.Death7 = AccidentCauseReportItem.Death7;
|
||||
newAccidentCauseReportItem.Injuries7 = AccidentCauseReportItem.Injuries7;
|
||||
newAccidentCauseReportItem.MinorInjuries7 = AccidentCauseReportItem.MinorInjuries7;
|
||||
newAccidentCauseReportItem.Death8 = AccidentCauseReportItem.Death8;
|
||||
newAccidentCauseReportItem.Injuries8 = AccidentCauseReportItem.Injuries8;
|
||||
newAccidentCauseReportItem.MinorInjuries8 = AccidentCauseReportItem.MinorInjuries8;
|
||||
newAccidentCauseReportItem.Death9 = AccidentCauseReportItem.Death9;
|
||||
newAccidentCauseReportItem.Injuries9 = AccidentCauseReportItem.Injuries9;
|
||||
newAccidentCauseReportItem.MinorInjuries9 = AccidentCauseReportItem.MinorInjuries9;
|
||||
newAccidentCauseReportItem.Death10 = AccidentCauseReportItem.Death10;
|
||||
newAccidentCauseReportItem.Injuries10 = AccidentCauseReportItem.Injuries10;
|
||||
newAccidentCauseReportItem.MinorInjuries10 = AccidentCauseReportItem.MinorInjuries10;
|
||||
newAccidentCauseReportItem.Death11 = AccidentCauseReportItem.Death11;
|
||||
newAccidentCauseReportItem.Injuries11 = AccidentCauseReportItem.Injuries11;
|
||||
newAccidentCauseReportItem.MinorInjuries11 = AccidentCauseReportItem.MinorInjuries11;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据Id删除所有数据
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReportItemId"></param>
|
||||
public static void DeleteAccidentCauseReportItemByAccidentCauseReportId(string AccidentCauseReportId)
|
||||
{
|
||||
var q = from x in Funs.DB.Information_AccidentCauseReportItem where x.AccidentCauseReportId == AccidentCauseReportId select x;
|
||||
if (q != null)
|
||||
{
|
||||
Funs.DB.Information_AccidentCauseReportItem.DeleteAllOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class AccidentCauseReportService
|
||||
{
|
||||
/// <summary>
|
||||
/// 职工伤亡事故原因分析报表
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReportId">职工伤亡事故原因分析报表Id</param>
|
||||
/// <returns>职工伤亡事故原因分析报表</returns>
|
||||
public static Model.Information_AccidentCauseReport GetAccidentCauseReportByAccidentCauseReportId(string AccidentCauseReportId)
|
||||
{
|
||||
return Funs.DB.Information_AccidentCauseReport.FirstOrDefault(e => e.AccidentCauseReportId == AccidentCauseReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 职工伤亡事故原因分析报表
|
||||
/// </summary>
|
||||
/// <param name="unitId">单位Id</param>
|
||||
/// <param name="year">年度</param>
|
||||
/// <param name="month">月份</param>
|
||||
/// <returns>职工伤亡事故原因分析报表</returns>
|
||||
public static Model.Information_AccidentCauseReport GetAccidentCauseReportByUnitIdAndYearAndMonth(string unitId, int year, int month)
|
||||
{
|
||||
return Funs.DB.Information_AccidentCauseReport.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_Information_AccidentCauseReport> GetAccidentCauseReportsByUnitId(string UnitId)
|
||||
{
|
||||
return (from x in Funs.DB.View_Information_AccidentCauseReport where x.UnitId == UnitId orderby x.FillingDate descending select x).ToList();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 增加职工伤亡事故原因分析报表
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReport">职工伤亡事故原因分析报表实体</param>
|
||||
public static void AddAccidentCauseReport(Model.Information_AccidentCauseReport AccidentCauseReport)
|
||||
{
|
||||
Model.Information_AccidentCauseReport newAccidentCauseReport = new Model.Information_AccidentCauseReport
|
||||
{
|
||||
AccidentCauseReportId = AccidentCauseReport.AccidentCauseReportId,
|
||||
AccidentCauseReportCode = AccidentCauseReport.AccidentCauseReportCode,
|
||||
Year = AccidentCauseReport.Year,
|
||||
Month = AccidentCauseReport.Month,
|
||||
UnitId = AccidentCauseReport.UnitId,
|
||||
DeathAccident = AccidentCauseReport.DeathAccident,
|
||||
DeathToll = AccidentCauseReport.DeathToll,
|
||||
InjuredAccident = AccidentCauseReport.InjuredAccident,
|
||||
InjuredToll = AccidentCauseReport.InjuredToll,
|
||||
MinorWoundAccident = AccidentCauseReport.MinorWoundAccident,
|
||||
MinorWoundToll = AccidentCauseReport.MinorWoundToll,
|
||||
AverageTotalHours = AccidentCauseReport.AverageTotalHours,
|
||||
AverageManHours = AccidentCauseReport.AverageManHours,
|
||||
TotalLossMan = AccidentCauseReport.TotalLossMan,
|
||||
LastMonthLossHoursTotal = AccidentCauseReport.LastMonthLossHoursTotal,
|
||||
KnockOffTotal = AccidentCauseReport.KnockOffTotal,
|
||||
DirectLoss = AccidentCauseReport.DirectLoss,
|
||||
IndirectLosses = AccidentCauseReport.IndirectLosses,
|
||||
TotalLoss = AccidentCauseReport.TotalLoss,
|
||||
TotalLossTime = AccidentCauseReport.TotalLossTime,
|
||||
FillCompanyPersonCharge = AccidentCauseReport.FillCompanyPersonCharge,
|
||||
TabPeople = AccidentCauseReport.TabPeople,
|
||||
FillingDate = AccidentCauseReport.FillingDate,
|
||||
AuditPerson = AccidentCauseReport.AuditPerson,
|
||||
UpState = AccidentCauseReport.UpState,
|
||||
HandleState = AccidentCauseReport.HandleState,
|
||||
HandleMan = AccidentCauseReport.HandleMan
|
||||
};
|
||||
|
||||
Funs.DB.Information_AccidentCauseReport.InsertOnSubmit(newAccidentCauseReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改职工伤亡事故原因分析报表
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReport">职工伤亡事故原因分析报表实体</param>
|
||||
public static void UpdateAccidentCauseReport(Model.Information_AccidentCauseReport AccidentCauseReport)
|
||||
{
|
||||
Model.Information_AccidentCauseReport newAccidentCauseReport = Funs.DB.Information_AccidentCauseReport.FirstOrDefault(e => e.AccidentCauseReportId == AccidentCauseReport.AccidentCauseReportId);
|
||||
if (newAccidentCauseReport != null)
|
||||
{
|
||||
newAccidentCauseReport.AccidentCauseReportCode = AccidentCauseReport.AccidentCauseReportCode;
|
||||
newAccidentCauseReport.Year = AccidentCauseReport.Year;
|
||||
newAccidentCauseReport.Month = AccidentCauseReport.Month;
|
||||
newAccidentCauseReport.UnitId = AccidentCauseReport.UnitId;
|
||||
newAccidentCauseReport.DeathAccident = AccidentCauseReport.DeathAccident;
|
||||
newAccidentCauseReport.DeathToll = AccidentCauseReport.DeathToll;
|
||||
newAccidentCauseReport.InjuredAccident = AccidentCauseReport.InjuredAccident;
|
||||
newAccidentCauseReport.InjuredToll = AccidentCauseReport.InjuredToll;
|
||||
newAccidentCauseReport.MinorWoundAccident = AccidentCauseReport.MinorWoundAccident;
|
||||
newAccidentCauseReport.MinorWoundToll = AccidentCauseReport.MinorWoundToll;
|
||||
newAccidentCauseReport.AverageTotalHours = AccidentCauseReport.AverageTotalHours;
|
||||
newAccidentCauseReport.AverageManHours = AccidentCauseReport.AverageManHours;
|
||||
newAccidentCauseReport.TotalLossMan = AccidentCauseReport.TotalLossMan;
|
||||
newAccidentCauseReport.LastMonthLossHoursTotal = AccidentCauseReport.LastMonthLossHoursTotal;
|
||||
newAccidentCauseReport.KnockOffTotal = AccidentCauseReport.KnockOffTotal;
|
||||
newAccidentCauseReport.DirectLoss = AccidentCauseReport.DirectLoss;
|
||||
newAccidentCauseReport.IndirectLosses = AccidentCauseReport.IndirectLosses;
|
||||
newAccidentCauseReport.TotalLoss = AccidentCauseReport.TotalLoss;
|
||||
newAccidentCauseReport.TotalLossTime = AccidentCauseReport.TotalLossTime;
|
||||
newAccidentCauseReport.FillCompanyPersonCharge = AccidentCauseReport.FillCompanyPersonCharge;
|
||||
newAccidentCauseReport.TabPeople = AccidentCauseReport.TabPeople;
|
||||
newAccidentCauseReport.AuditPerson = AccidentCauseReport.AuditPerson;
|
||||
newAccidentCauseReport.FillCompanyPersonCharge = AccidentCauseReport.FillCompanyPersonCharge;
|
||||
newAccidentCauseReport.TabPeople = AccidentCauseReport.TabPeople;
|
||||
newAccidentCauseReport.AuditPerson = AccidentCauseReport.AuditPerson;
|
||||
newAccidentCauseReport.FillingDate = AccidentCauseReport.FillingDate;
|
||||
newAccidentCauseReport.UpState = AccidentCauseReport.UpState;
|
||||
newAccidentCauseReport.HandleState = AccidentCauseReport.HandleState;
|
||||
newAccidentCauseReport.HandleMan = AccidentCauseReport.HandleMan;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据Id获取数据
|
||||
/// </summary>
|
||||
/// <param name="AccidentCauseReportId"></param>
|
||||
public static void DeleteAccidentCauseReportByAccidentCauseReportId(string AccidentCauseReportId)
|
||||
{
|
||||
Model.Information_AccidentCauseReport newAccidentCauseReport = Funs.DB.Information_AccidentCauseReport.FirstOrDefault(e => e.AccidentCauseReportId == AccidentCauseReportId);
|
||||
if (newAccidentCauseReport != null)
|
||||
{
|
||||
////删除审核流程表
|
||||
BLL.CommonService.DeleteFlowOperateByID(AccidentCauseReportId);
|
||||
Funs.DB.Information_AccidentCauseReport.DeleteOnSubmit(newAccidentCauseReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据报表单位,报表时间判断是否存在
|
||||
/// </summary>
|
||||
/// <param name="Id">Id</param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_AccidentCauseReport GetAccidentCauseReportByUnitIdDate(string unitId, int year, int Month)
|
||||
{
|
||||
return Funs.DB.Information_AccidentCauseReport.FirstOrDefault(e => e.UnitId == unitId && e.Year == year && e.Month == Month);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,124 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 应急演练开展情况季报明细表
|
||||
/// </summary>
|
||||
public static class DrillConductedQuarterlyReportItemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取应急演练开展情况季报表明细信息
|
||||
/// </summary>
|
||||
/// <param name="drillConductedQuarterlyReportItemId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_DrillConductedQuarterlyReportItem GetDrillConductedQuarterlyReportItemById(string drillConductedQuarterlyReportItemId)
|
||||
{
|
||||
return Funs.DB.Information_DrillConductedQuarterlyReportItem.FirstOrDefault(e => e.DrillConductedQuarterlyReportItemId == drillConductedQuarterlyReportItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据应急演练开展情况季报Id获取所有相关明细信息
|
||||
/// </summary>
|
||||
/// <param name="drillConductedQuarterlyReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Information_DrillConductedQuarterlyReportItem> GetDrillConductedQuarterlyReportItemList(string drillConductedQuarterlyReportId)
|
||||
{
|
||||
return (from x in Funs.DB.Information_DrillConductedQuarterlyReportItem where x.DrillConductedQuarterlyReportId == drillConductedQuarterlyReportId orderby x.SortIndex select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加应急演练开展情况季报明细信息
|
||||
/// </summary>
|
||||
/// <param name="drillConductedQuarterlyReportItem"></param>
|
||||
public static void AddDrillConductedQuarterlyReportItem(Model.Information_DrillConductedQuarterlyReportItem drillConductedQuarterlyReportItem)
|
||||
{
|
||||
Model.Information_DrillConductedQuarterlyReportItem newDrillConductedQuarterlyReportItem = new Model.Information_DrillConductedQuarterlyReportItem
|
||||
{
|
||||
DrillConductedQuarterlyReportItemId = drillConductedQuarterlyReportItem.DrillConductedQuarterlyReportItemId,
|
||||
DrillConductedQuarterlyReportId = drillConductedQuarterlyReportItem.DrillConductedQuarterlyReportId,
|
||||
IndustryType = drillConductedQuarterlyReportItem.IndustryType,
|
||||
TotalConductCount = drillConductedQuarterlyReportItem.TotalConductCount,
|
||||
TotalPeopleCount = drillConductedQuarterlyReportItem.TotalPeopleCount,
|
||||
TotalInvestment = drillConductedQuarterlyReportItem.TotalInvestment,
|
||||
HQConductCount = drillConductedQuarterlyReportItem.HQConductCount,
|
||||
HQPeopleCount = drillConductedQuarterlyReportItem.HQPeopleCount,
|
||||
HQInvestment = drillConductedQuarterlyReportItem.HQInvestment,
|
||||
BasicConductCount = drillConductedQuarterlyReportItem.BasicConductCount,
|
||||
BasicPeopleCount = drillConductedQuarterlyReportItem.BasicPeopleCount,
|
||||
BasicInvestment = drillConductedQuarterlyReportItem.BasicInvestment,
|
||||
ComprehensivePractice = drillConductedQuarterlyReportItem.ComprehensivePractice,
|
||||
CPScene = drillConductedQuarterlyReportItem.CPScene,
|
||||
CPDesktop = drillConductedQuarterlyReportItem.CPDesktop,
|
||||
SpecialDrill = drillConductedQuarterlyReportItem.SpecialDrill,
|
||||
SDScene = drillConductedQuarterlyReportItem.SDScene,
|
||||
SDDesktop = drillConductedQuarterlyReportItem.SDDesktop,
|
||||
SortIndex = drillConductedQuarterlyReportItem.SortIndex
|
||||
};
|
||||
Funs.DB.Information_DrillConductedQuarterlyReportItem.InsertOnSubmit(newDrillConductedQuarterlyReportItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改应急演练开展情况季报明细信息
|
||||
/// </summary>
|
||||
/// <param name="drillConductedQuarterlyReportItem"></param>
|
||||
public static void UpdateDrillConductedQuarterlyReportItem(Model.Information_DrillConductedQuarterlyReportItem drillConductedQuarterlyReportItem)
|
||||
{
|
||||
Model.Information_DrillConductedQuarterlyReportItem newDrillConductedQuarterlyReportItem = Funs.DB.Information_DrillConductedQuarterlyReportItem.FirstOrDefault(e => e.DrillConductedQuarterlyReportItemId == drillConductedQuarterlyReportItem.DrillConductedQuarterlyReportItemId);
|
||||
if (newDrillConductedQuarterlyReportItem != null)
|
||||
{
|
||||
newDrillConductedQuarterlyReportItem.IndustryType = drillConductedQuarterlyReportItem.IndustryType;
|
||||
newDrillConductedQuarterlyReportItem.TotalConductCount = drillConductedQuarterlyReportItem.TotalConductCount;
|
||||
newDrillConductedQuarterlyReportItem.TotalPeopleCount = drillConductedQuarterlyReportItem.TotalPeopleCount;
|
||||
newDrillConductedQuarterlyReportItem.TotalInvestment = drillConductedQuarterlyReportItem.TotalInvestment;
|
||||
newDrillConductedQuarterlyReportItem.HQConductCount = drillConductedQuarterlyReportItem.HQConductCount;
|
||||
newDrillConductedQuarterlyReportItem.HQPeopleCount = drillConductedQuarterlyReportItem.HQPeopleCount;
|
||||
newDrillConductedQuarterlyReportItem.HQInvestment = drillConductedQuarterlyReportItem.HQInvestment;
|
||||
newDrillConductedQuarterlyReportItem.BasicConductCount = drillConductedQuarterlyReportItem.BasicConductCount;
|
||||
newDrillConductedQuarterlyReportItem.BasicPeopleCount = drillConductedQuarterlyReportItem.BasicPeopleCount;
|
||||
newDrillConductedQuarterlyReportItem.BasicInvestment = drillConductedQuarterlyReportItem.BasicInvestment;
|
||||
newDrillConductedQuarterlyReportItem.ComprehensivePractice = drillConductedQuarterlyReportItem.ComprehensivePractice;
|
||||
newDrillConductedQuarterlyReportItem.CPScene = drillConductedQuarterlyReportItem.CPScene;
|
||||
newDrillConductedQuarterlyReportItem.CPDesktop = drillConductedQuarterlyReportItem.CPDesktop;
|
||||
newDrillConductedQuarterlyReportItem.SpecialDrill = drillConductedQuarterlyReportItem.SpecialDrill;
|
||||
newDrillConductedQuarterlyReportItem.SDScene = drillConductedQuarterlyReportItem.SDScene;
|
||||
newDrillConductedQuarterlyReportItem.SDDesktop = drillConductedQuarterlyReportItem.SDDesktop;
|
||||
newDrillConductedQuarterlyReportItem.SortIndex = drillConductedQuarterlyReportItem.SortIndex;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除应急演练开展情况季报明细信息
|
||||
/// </summary>
|
||||
/// <param name="drillConductedQuarterlyReportItemId"></param>
|
||||
public static void DeleteDrillConductedQuarterlyReportItemById(string drillConductedQuarterlyReportItemId)
|
||||
{
|
||||
Model.Information_DrillConductedQuarterlyReportItem drillConductedQuarterlyReportItem = Funs.DB.Information_DrillConductedQuarterlyReportItem.FirstOrDefault(e => e.DrillConductedQuarterlyReportItemId == drillConductedQuarterlyReportItemId);
|
||||
if (drillConductedQuarterlyReportItem != null)
|
||||
{
|
||||
Funs.DB.Information_DrillConductedQuarterlyReportItem.DeleteOnSubmit(drillConductedQuarterlyReportItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据应急演练开展情况季报主表id删除所有相关明细信息
|
||||
/// </summary>
|
||||
/// <param name="drillConductedQuarterlyReportId"></param>
|
||||
public static void DeleteDrillConductedQuarterlyReportItemList(string drillConductedQuarterlyReportId)
|
||||
{
|
||||
var q = (from x in Funs.DB.Information_DrillConductedQuarterlyReportItem where x.DrillConductedQuarterlyReportId == drillConductedQuarterlyReportId select x).ToList();
|
||||
if (q != null)
|
||||
{
|
||||
Funs.DB.Information_DrillConductedQuarterlyReportItem.DeleteAllOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 应急演练开展情况季报主表
|
||||
/// </summary>
|
||||
public static class DrillConductedQuarterlyReportService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取应急演练开展情况季报表
|
||||
/// </summary>
|
||||
/// <param name="drillConductedQuarterlyReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_DrillConductedQuarterlyReport GetDrillConductedQuarterlyReportById(string drillConductedQuarterlyReportId)
|
||||
{
|
||||
return Funs.DB.Information_DrillConductedQuarterlyReport.FirstOrDefault(e => e.DrillConductedQuarterlyReportId == drillConductedQuarterlyReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 应急演练开展情况季报表
|
||||
/// </summary>
|
||||
/// <param name="unitId">单位Id</param>
|
||||
/// <param name="year">年度</param>
|
||||
/// <param name="quarters">季度</param>
|
||||
/// <returns>应急演练开展情况季报表</returns>
|
||||
public static Model.Information_DrillConductedQuarterlyReport GetDrillConductedQuarterlyReportByUnitIdAndYearAndQuarters(string unitId, int year, int quarters)
|
||||
{
|
||||
return Funs.DB.Information_DrillConductedQuarterlyReport.FirstOrDefault(e => e.UnitId == unitId && e.Quarter == quarters && e.YearId == year);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位Id获取安全生产数据季报集合
|
||||
/// </summary>
|
||||
/// <param name="UnitId">单位Id</param>
|
||||
/// <returns>安全生产数据季报集合</returns>
|
||||
public static List<Model.View_Information_DrillConductedQuarterlyReport> GetDrillConductedQuarterlyReportsByUnitId(string UnitId)
|
||||
{
|
||||
return (from x in Funs.DB.View_Information_DrillConductedQuarterlyReport where x.UnitId == UnitId orderby x.ReportDate descending select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加应急演练开展情况季报表
|
||||
/// </summary>
|
||||
/// <param name="drillConductedQuarterlyReport"></param>
|
||||
public static void AddDrillConductedQuarterlyReport(Model.Information_DrillConductedQuarterlyReport drillConductedQuarterlyReport)
|
||||
{
|
||||
Model.Information_DrillConductedQuarterlyReport newDrillConductedQuarterlyReport = new Model.Information_DrillConductedQuarterlyReport
|
||||
{
|
||||
DrillConductedQuarterlyReportId = drillConductedQuarterlyReport.DrillConductedQuarterlyReportId,
|
||||
UnitId = drillConductedQuarterlyReport.UnitId,
|
||||
ReportDate = drillConductedQuarterlyReport.ReportDate,
|
||||
YearId = drillConductedQuarterlyReport.YearId,
|
||||
Quarter = drillConductedQuarterlyReport.Quarter,
|
||||
CompileMan = drillConductedQuarterlyReport.CompileMan,
|
||||
UpState = drillConductedQuarterlyReport.UpState,
|
||||
HandleState = drillConductedQuarterlyReport.HandleState,
|
||||
HandleMan = drillConductedQuarterlyReport.HandleMan
|
||||
};
|
||||
Funs.DB.Information_DrillConductedQuarterlyReport.InsertOnSubmit(newDrillConductedQuarterlyReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改应急演练开展情况季报表
|
||||
/// </summary>
|
||||
/// <param name="drillConductedQuarterlyReport"></param>
|
||||
public static void UpdateDrillConductedQuarterlyReport(Model.Information_DrillConductedQuarterlyReport drillConductedQuarterlyReport)
|
||||
{
|
||||
Model.Information_DrillConductedQuarterlyReport newDrillConductedQuarterlyReport = Funs.DB.Information_DrillConductedQuarterlyReport.FirstOrDefault(e => e.DrillConductedQuarterlyReportId == drillConductedQuarterlyReport.DrillConductedQuarterlyReportId);
|
||||
if (newDrillConductedQuarterlyReport != null)
|
||||
{
|
||||
newDrillConductedQuarterlyReport.UnitId = drillConductedQuarterlyReport.UnitId;
|
||||
newDrillConductedQuarterlyReport.ReportDate = drillConductedQuarterlyReport.ReportDate;
|
||||
newDrillConductedQuarterlyReport.YearId = drillConductedQuarterlyReport.YearId;
|
||||
newDrillConductedQuarterlyReport.Quarter = drillConductedQuarterlyReport.Quarter;
|
||||
newDrillConductedQuarterlyReport.UpState = drillConductedQuarterlyReport.UpState;
|
||||
newDrillConductedQuarterlyReport.HandleState = drillConductedQuarterlyReport.HandleState;
|
||||
newDrillConductedQuarterlyReport.HandleMan = drillConductedQuarterlyReport.HandleMan;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除应急演练开展情况季报表
|
||||
/// </summary>
|
||||
/// <param name="drillConductedQuarterlyReportId"></param>
|
||||
public static void DeleteDrillConductedQuarterlyReportById(string drillConductedQuarterlyReportId)
|
||||
{
|
||||
Model.Information_DrillConductedQuarterlyReport drillConductedQuarterlyReport = Funs.DB.Information_DrillConductedQuarterlyReport.FirstOrDefault(e => e.DrillConductedQuarterlyReportId == drillConductedQuarterlyReportId);
|
||||
if (drillConductedQuarterlyReport != null)
|
||||
{
|
||||
Funs.DB.Information_DrillConductedQuarterlyReport.DeleteOnSubmit(drillConductedQuarterlyReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位、季度获取应急演练开展情况季报表
|
||||
/// </summary>
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="quarter"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_DrillConductedQuarterlyReport GetDrillConductedQuarterlyReportByUnitIdDate(string unitId, int yearId, int quarter, string drillConductedQuarterlyReportId)
|
||||
{
|
||||
return Funs.DB.Information_DrillConductedQuarterlyReport.FirstOrDefault(e => e.UnitId == unitId && e.YearId == yearId && e.Quarter == quarter && ((drillConductedQuarterlyReportId == null && e.DrillConductedQuarterlyReportId != null) || e.DrillConductedQuarterlyReportId != drillConductedQuarterlyReportId));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 应急演练工作计划半年报明细表
|
||||
/// </summary>
|
||||
public static class DrillPlanHalfYearReportItemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取应急演练工作计划半年报明细信息
|
||||
/// </summary>
|
||||
/// <param name="drillPlanHalfYearReportItemId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_DrillPlanHalfYearReportItem GetDrillPlanHalfYearReportItemById(string drillPlanHalfYearReportItemId)
|
||||
{
|
||||
return Funs.DB.Information_DrillPlanHalfYearReportItem.FirstOrDefault(e => e.DrillPlanHalfYearReportItemId == drillPlanHalfYearReportItemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据应急演练工作计划半年报Id获取所有相关明细信息
|
||||
/// </summary>
|
||||
/// <param name="drillPlanHalfYearReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Information_DrillPlanHalfYearReportItem> GetDrillPlanHalfYearReportItemList(string drillPlanHalfYearReportId)
|
||||
{
|
||||
return (from x in Funs.DB.Information_DrillPlanHalfYearReportItem where x.DrillPlanHalfYearReportId == drillPlanHalfYearReportId orderby x.SortIndex select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加
|
||||
/// </summary>
|
||||
/// <param name="drillPlanHalfYearReportItem"></param>
|
||||
public static void AddDrillPlanHalfYearReportItem(Model.Information_DrillPlanHalfYearReportItem drillPlanHalfYearReportItem)
|
||||
{
|
||||
Model.Information_DrillPlanHalfYearReportItem newDrillPlanHalfYearReportItem = new Model.Information_DrillPlanHalfYearReportItem
|
||||
{
|
||||
DrillPlanHalfYearReportItemId = drillPlanHalfYearReportItem.DrillPlanHalfYearReportItemId,
|
||||
DrillPlanHalfYearReportId = drillPlanHalfYearReportItem.DrillPlanHalfYearReportId,
|
||||
DrillPlanName = drillPlanHalfYearReportItem.DrillPlanName,
|
||||
OrganizationUnit = drillPlanHalfYearReportItem.OrganizationUnit,
|
||||
DrillPlanDate = drillPlanHalfYearReportItem.DrillPlanDate,
|
||||
AccidentScene = drillPlanHalfYearReportItem.AccidentScene,
|
||||
ExerciseWay = drillPlanHalfYearReportItem.ExerciseWay,
|
||||
SortIndex = drillPlanHalfYearReportItem.SortIndex
|
||||
};
|
||||
Funs.DB.Information_DrillPlanHalfYearReportItem.InsertOnSubmit(newDrillPlanHalfYearReportItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改
|
||||
/// </summary>
|
||||
/// <param name="drillPlanHalfYearReportItem"></param>
|
||||
public static void UpdateDrillPlanHalfYearReportItem(Model.Information_DrillPlanHalfYearReportItem drillPlanHalfYearReportItem)
|
||||
{
|
||||
Model.Information_DrillPlanHalfYearReportItem newDrillPlanHalfYearReportItem = Funs.DB.Information_DrillPlanHalfYearReportItem.FirstOrDefault(e => e.DrillPlanHalfYearReportItemId == drillPlanHalfYearReportItem.DrillPlanHalfYearReportItemId);
|
||||
if (newDrillPlanHalfYearReportItem != null)
|
||||
{
|
||||
//newDrillPlanHalfYearReportItem.DrillPlanHalfYearReportId = drillPlanHalfYearReportItem.DrillPlanHalfYearReportId;
|
||||
newDrillPlanHalfYearReportItem.DrillPlanName = drillPlanHalfYearReportItem.DrillPlanName;
|
||||
newDrillPlanHalfYearReportItem.OrganizationUnit = drillPlanHalfYearReportItem.OrganizationUnit;
|
||||
newDrillPlanHalfYearReportItem.DrillPlanDate = drillPlanHalfYearReportItem.DrillPlanDate;
|
||||
newDrillPlanHalfYearReportItem.AccidentScene = drillPlanHalfYearReportItem.AccidentScene;
|
||||
newDrillPlanHalfYearReportItem.ExerciseWay = drillPlanHalfYearReportItem.ExerciseWay;
|
||||
newDrillPlanHalfYearReportItem.SortIndex = drillPlanHalfYearReportItem.SortIndex;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除
|
||||
/// </summary>
|
||||
/// <param name="drillPlanHalfYearReportItemId"></param>
|
||||
public static void DeleteDrillPlanHalfYearReportItemById(string drillPlanHalfYearReportItemId)
|
||||
{
|
||||
Model.Information_DrillPlanHalfYearReportItem drillPlanHalfYearReportItem = Funs.DB.Information_DrillPlanHalfYearReportItem.FirstOrDefault(e => e.DrillPlanHalfYearReportItemId == drillPlanHalfYearReportItemId);
|
||||
if (drillPlanHalfYearReportItem != null)
|
||||
{
|
||||
Funs.DB.Information_DrillPlanHalfYearReportItem.DeleteOnSubmit(drillPlanHalfYearReportItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表主键删除所有相关明细信息
|
||||
/// </summary>
|
||||
/// <param name="drillPlanHalfYearReportId"></param>
|
||||
public static void DeleteDrillPlanHalfYearReportItemList(string drillPlanHalfYearReportId)
|
||||
{
|
||||
var q = (from x in Funs.DB.Information_DrillPlanHalfYearReportItem where x.DrillPlanHalfYearReportId == drillPlanHalfYearReportId select x).ToList();
|
||||
if (q != null)
|
||||
{
|
||||
Funs.DB.Information_DrillPlanHalfYearReportItem.DeleteAllOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 应急演练工作计划半年报主表
|
||||
/// </summary>
|
||||
public static class DrillPlanHalfYearReportService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取应急演练工作计划半年报
|
||||
/// </summary>
|
||||
/// <param name="drillPlanHalfYearReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_DrillPlanHalfYearReport GetDrillPlanHalfYearReportById(string drillPlanHalfYearReportId)
|
||||
{
|
||||
return Funs.DB.Information_DrillPlanHalfYearReport.FirstOrDefault(e => e.DrillPlanHalfYearReportId == drillPlanHalfYearReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 应急演练工作计划半年报
|
||||
/// </summary>
|
||||
/// <param name="unitId">单位Id</param>
|
||||
/// <param name="year">年度</param>
|
||||
/// <param name="quarters">半年Id</param>
|
||||
/// <returns>应急演练工作计划半年报</returns>
|
||||
public static Model.Information_DrillPlanHalfYearReport GetDrillPlanHalfYearReportByUnitIdAndYearAndHalfYear(string unitId, int year, int halfYearId)
|
||||
{
|
||||
return Funs.DB.Information_DrillPlanHalfYearReport.FirstOrDefault(e => e.UnitId == unitId && e.HalfYearId == halfYearId && e.YearId == year);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位Id获取应急演练工作计划半年报集合
|
||||
/// </summary>
|
||||
/// <param name="UnitId">单位Id</param>
|
||||
/// <returns>应急演练工作计划半年报集合</returns>
|
||||
public static List<Model.View_Information_DrillPlanHalfYearReport> GetDrillPlanHalfYearReportsByUnitId(string UnitId)
|
||||
{
|
||||
return (from x in Funs.DB.View_Information_DrillPlanHalfYearReport where x.UnitId == UnitId orderby x.Years descending select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位、年数时间获取信息
|
||||
/// </summary>
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="yearId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_DrillPlanHalfYearReport GetDrillPlanHalfYearReportByUnitIdDate(string unitId, int yearId, int halfYearId)
|
||||
{
|
||||
return Funs.DB.Information_DrillPlanHalfYearReport.FirstOrDefault(e => e.UnitId == unitId && e.YearId == yearId && e.HalfYearId == halfYearId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加应急演练工作计划半年报
|
||||
/// </summary>
|
||||
/// <param name="drillPlanHalfYearReport"></param>
|
||||
public static void AddDrillPlanHalfYearReport(Model.Information_DrillPlanHalfYearReport drillPlanHalfYearReport)
|
||||
{
|
||||
Model.Information_DrillPlanHalfYearReport newDrillPlanHalfYearReport = new Model.Information_DrillPlanHalfYearReport
|
||||
{
|
||||
DrillPlanHalfYearReportId = drillPlanHalfYearReport.DrillPlanHalfYearReportId,
|
||||
UnitId = drillPlanHalfYearReport.UnitId,
|
||||
CompileMan = drillPlanHalfYearReport.CompileMan,
|
||||
CompileDate = drillPlanHalfYearReport.CompileDate,
|
||||
YearId = drillPlanHalfYearReport.YearId,
|
||||
HalfYearId = drillPlanHalfYearReport.HalfYearId,
|
||||
Telephone = drillPlanHalfYearReport.Telephone,
|
||||
UpState = drillPlanHalfYearReport.UpState,
|
||||
HandleState = drillPlanHalfYearReport.HandleState,
|
||||
HandleMan = drillPlanHalfYearReport.HandleMan
|
||||
};
|
||||
Funs.DB.Information_DrillPlanHalfYearReport.InsertOnSubmit(newDrillPlanHalfYearReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改应急演练工作计划半年报
|
||||
/// </summary>
|
||||
/// <param name="drillPlanHalfYearReport"></param>
|
||||
public static void UpdateDrillPlanHalfYearReport(Model.Information_DrillPlanHalfYearReport drillPlanHalfYearReport)
|
||||
{
|
||||
Model.Information_DrillPlanHalfYearReport newDrillPlanHalfYearReport = Funs.DB.Information_DrillPlanHalfYearReport.FirstOrDefault(e => e.DrillPlanHalfYearReportId == drillPlanHalfYearReport.DrillPlanHalfYearReportId);
|
||||
if (newDrillPlanHalfYearReport != null)
|
||||
{
|
||||
newDrillPlanHalfYearReport.UnitId = drillPlanHalfYearReport.UnitId;
|
||||
newDrillPlanHalfYearReport.CompileMan = drillPlanHalfYearReport.CompileMan;
|
||||
newDrillPlanHalfYearReport.CompileDate = drillPlanHalfYearReport.CompileDate;
|
||||
newDrillPlanHalfYearReport.YearId = drillPlanHalfYearReport.YearId;
|
||||
newDrillPlanHalfYearReport.HalfYearId = drillPlanHalfYearReport.HalfYearId;
|
||||
newDrillPlanHalfYearReport.Telephone = drillPlanHalfYearReport.Telephone;
|
||||
newDrillPlanHalfYearReport.UpState = drillPlanHalfYearReport.UpState;
|
||||
newDrillPlanHalfYearReport.HandleState = drillPlanHalfYearReport.HandleState;
|
||||
newDrillPlanHalfYearReport.HandleMan = drillPlanHalfYearReport.HandleMan;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除应急演练工作计划半年报
|
||||
/// </summary>
|
||||
/// <param name="drillPlanHalfYearReportId"></param>
|
||||
public static void DeleteDrillPlanHalfYearReportById(string drillPlanHalfYearReportId)
|
||||
{
|
||||
Model.Information_DrillPlanHalfYearReport drillPlanHalfYearReport = Funs.DB.Information_DrillPlanHalfYearReport.FirstOrDefault(e => e.DrillPlanHalfYearReportId == drillPlanHalfYearReportId);
|
||||
if (drillPlanHalfYearReport != null)
|
||||
{
|
||||
Funs.DB.Information_DrillPlanHalfYearReport.DeleteOnSubmit(drillPlanHalfYearReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,195 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class MillionsMonthlyReportItemService
|
||||
{
|
||||
/// <summary>
|
||||
/// 百万工时安全统计月报表明细表
|
||||
/// </summary>
|
||||
/// <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>
|
||||
public static Model.Information_MillionsMonthlyReportItem GetMillionsMonthlyReportItemByMillionsMonthlyReportIdAndTypeId(string MillionsMonthlyReportId)
|
||||
{
|
||||
return Funs.DB.Information_MillionsMonthlyReportItem.FirstOrDefault(e => e.MillionsMonthlyReportId == MillionsMonthlyReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id判断是否存在明细记录
|
||||
/// </summary>
|
||||
/// <param name="MillionsMonthlyReportItemId">百万工时安全统计月报表表Id</param>
|
||||
/// <returns>是否存在明细记录</returns>
|
||||
public static bool IsExitItems(string MillionsMonthlyReportId)
|
||||
{
|
||||
return (from x in Funs.DB.Information_MillionsMonthlyReportItem where x.MillionsMonthlyReportId == MillionsMonthlyReportId select x).Count() > 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="MillionsMonthlyReportItemId">百万工时安全统计月报表明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Information_MillionsMonthlyReportItem> GetItems(string MillionsMonthlyReportId)
|
||||
{
|
||||
return (from x in Funs.DB.Information_MillionsMonthlyReportItem
|
||||
where x.MillionsMonthlyReportId == MillionsMonthlyReportId
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="MillionsMonthlyReportItemId">百万工时安全统计月报表明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Information_MillionsMonthlyReportItem> GetYearSumItems(string unitId, int? year, int? month)
|
||||
{
|
||||
return (from x in Funs.DB.Information_MillionsMonthlyReportItem
|
||||
join y in Funs.DB.Information_MillionsMonthlyReport
|
||||
on x.MillionsMonthlyReportId equals y.MillionsMonthlyReportId
|
||||
where y.UnitId == unitId && y.Year == year && y.Month <= month
|
||||
&& x.Affiliation == "本月合计"
|
||||
select x).Distinct().ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合
|
||||
/// </summary>
|
||||
/// <param name="MillionsMonthlyReportItemId">百万工时安全统计月报表明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Information_MillionsMonthlyReportItem> GetAllUnitYearSumItems(int year, int month)
|
||||
{
|
||||
return (from x in Funs.DB.Information_MillionsMonthlyReportItem
|
||||
join y in Funs.DB.Information_MillionsMonthlyReport
|
||||
on x.MillionsMonthlyReportId equals y.MillionsMonthlyReportId
|
||||
where y.Year == year && y.Month <= month && x.Affiliation == "本月合计"
|
||||
select x).Distinct().ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主表Id获取明细记录集合(不包含本月合计行)
|
||||
/// </summary>
|
||||
/// <param name="MillionsMonthlyReportItemId">百万工时安全统计月报表明细表Id</param>
|
||||
/// <returns>明细记录集合</returns>
|
||||
public static List<Model.Information_MillionsMonthlyReportItem> GetItemsNoSum(string MillionsMonthlyReportId)
|
||||
{
|
||||
return (from x in Funs.DB.Information_MillionsMonthlyReportItem
|
||||
where x.MillionsMonthlyReportId == MillionsMonthlyReportId
|
||||
&& (x.Affiliation != "本月合计" || x.Affiliation == null)
|
||||
orderby x.SortIndex
|
||||
select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加百万工时安全统计月报表明细表
|
||||
/// </summary>
|
||||
/// <param name="MillionsMonthlyReportItem">百万工时安全统计月报表明细表实体</param>
|
||||
public static void AddMillionsMonthlyReportItem(Model.Information_MillionsMonthlyReportItem MillionsMonthlyReportItem)
|
||||
{
|
||||
Model.Information_MillionsMonthlyReportItem newMillionsMonthlyReportItem = new Model.Information_MillionsMonthlyReportItem
|
||||
{
|
||||
MillionsMonthlyReportItemId = MillionsMonthlyReportItem.MillionsMonthlyReportItemId,
|
||||
MillionsMonthlyReportId = MillionsMonthlyReportItem.MillionsMonthlyReportId,
|
||||
SortIndex = MillionsMonthlyReportItem.SortIndex,
|
||||
Affiliation = MillionsMonthlyReportItem.Affiliation,
|
||||
Name = MillionsMonthlyReportItem.Name,
|
||||
PostPersonNum = MillionsMonthlyReportItem.PostPersonNum,
|
||||
SnapPersonNum = MillionsMonthlyReportItem.SnapPersonNum,
|
||||
ContractorNum = MillionsMonthlyReportItem.ContractorNum,
|
||||
SumPersonNum = MillionsMonthlyReportItem.SumPersonNum,
|
||||
TotalWorkNum = MillionsMonthlyReportItem.TotalWorkNum,
|
||||
SeriousInjuriesNum = MillionsMonthlyReportItem.SeriousInjuriesNum,
|
||||
SeriousInjuriesPersonNum = MillionsMonthlyReportItem.SeriousInjuriesPersonNum,
|
||||
SeriousInjuriesLossHour = MillionsMonthlyReportItem.SeriousInjuriesLossHour,
|
||||
MinorAccidentNum = MillionsMonthlyReportItem.MinorAccidentNum,
|
||||
MinorAccidentPersonNum = MillionsMonthlyReportItem.MinorAccidentPersonNum,
|
||||
MinorAccidentLossHour = MillionsMonthlyReportItem.MinorAccidentLossHour,
|
||||
OtherAccidentNum = MillionsMonthlyReportItem.OtherAccidentNum,
|
||||
OtherAccidentPersonNum = MillionsMonthlyReportItem.OtherAccidentPersonNum,
|
||||
OtherAccidentLossHour = MillionsMonthlyReportItem.OtherAccidentLossHour,
|
||||
RestrictedWorkPersonNum = MillionsMonthlyReportItem.RestrictedWorkPersonNum,
|
||||
RestrictedWorkLossHour = MillionsMonthlyReportItem.RestrictedWorkLossHour,
|
||||
MedicalTreatmentPersonNum = MillionsMonthlyReportItem.MedicalTreatmentPersonNum,
|
||||
MedicalTreatmentLossHour = MillionsMonthlyReportItem.MedicalTreatmentLossHour,
|
||||
FireNum = MillionsMonthlyReportItem.FireNum,
|
||||
ExplosionNum = MillionsMonthlyReportItem.ExplosionNum,
|
||||
TrafficNum = MillionsMonthlyReportItem.TrafficNum,
|
||||
EquipmentNum = MillionsMonthlyReportItem.EquipmentNum,
|
||||
QualityNum = MillionsMonthlyReportItem.QualityNum,
|
||||
OtherNum = MillionsMonthlyReportItem.OtherNum,
|
||||
FirstAidDressingsNum = MillionsMonthlyReportItem.FirstAidDressingsNum,
|
||||
AttemptedEventNum = MillionsMonthlyReportItem.AttemptedEventNum,
|
||||
LossDayNum = MillionsMonthlyReportItem.LossDayNum
|
||||
};
|
||||
|
||||
Funs.DB.Information_MillionsMonthlyReportItem.InsertOnSubmit(newMillionsMonthlyReportItem);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改百万工时安全统计月报表明细表
|
||||
/// </summary>
|
||||
/// <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);
|
||||
newMillionsMonthlyReportItem.SortIndex = MillionsMonthlyReportItem.SortIndex;
|
||||
newMillionsMonthlyReportItem.Affiliation = MillionsMonthlyReportItem.Affiliation;
|
||||
newMillionsMonthlyReportItem.Name = MillionsMonthlyReportItem.Name;
|
||||
newMillionsMonthlyReportItem.PostPersonNum = MillionsMonthlyReportItem.PostPersonNum;
|
||||
newMillionsMonthlyReportItem.SnapPersonNum = MillionsMonthlyReportItem.SnapPersonNum;
|
||||
newMillionsMonthlyReportItem.ContractorNum = MillionsMonthlyReportItem.ContractorNum;
|
||||
newMillionsMonthlyReportItem.SumPersonNum = MillionsMonthlyReportItem.SumPersonNum;
|
||||
newMillionsMonthlyReportItem.TotalWorkNum = MillionsMonthlyReportItem.TotalWorkNum;
|
||||
newMillionsMonthlyReportItem.SeriousInjuriesNum = MillionsMonthlyReportItem.SeriousInjuriesNum;
|
||||
newMillionsMonthlyReportItem.SeriousInjuriesPersonNum = MillionsMonthlyReportItem.SeriousInjuriesPersonNum;
|
||||
newMillionsMonthlyReportItem.SeriousInjuriesLossHour = MillionsMonthlyReportItem.SeriousInjuriesLossHour;
|
||||
newMillionsMonthlyReportItem.MinorAccidentNum = MillionsMonthlyReportItem.MinorAccidentNum;
|
||||
newMillionsMonthlyReportItem.MinorAccidentPersonNum = MillionsMonthlyReportItem.MinorAccidentPersonNum;
|
||||
newMillionsMonthlyReportItem.MinorAccidentLossHour = MillionsMonthlyReportItem.MinorAccidentLossHour;
|
||||
newMillionsMonthlyReportItem.OtherAccidentNum = MillionsMonthlyReportItem.OtherAccidentNum;
|
||||
newMillionsMonthlyReportItem.OtherAccidentPersonNum = MillionsMonthlyReportItem.OtherAccidentPersonNum;
|
||||
newMillionsMonthlyReportItem.OtherAccidentLossHour = MillionsMonthlyReportItem.OtherAccidentLossHour;
|
||||
newMillionsMonthlyReportItem.RestrictedWorkPersonNum = MillionsMonthlyReportItem.RestrictedWorkPersonNum;
|
||||
newMillionsMonthlyReportItem.RestrictedWorkLossHour = MillionsMonthlyReportItem.RestrictedWorkLossHour;
|
||||
newMillionsMonthlyReportItem.MedicalTreatmentPersonNum = MillionsMonthlyReportItem.MedicalTreatmentPersonNum;
|
||||
newMillionsMonthlyReportItem.MedicalTreatmentLossHour = MillionsMonthlyReportItem.MedicalTreatmentLossHour;
|
||||
newMillionsMonthlyReportItem.FireNum = MillionsMonthlyReportItem.FireNum;
|
||||
newMillionsMonthlyReportItem.ExplosionNum = MillionsMonthlyReportItem.ExplosionNum;
|
||||
newMillionsMonthlyReportItem.TrafficNum = MillionsMonthlyReportItem.TrafficNum;
|
||||
newMillionsMonthlyReportItem.EquipmentNum = MillionsMonthlyReportItem.EquipmentNum;
|
||||
newMillionsMonthlyReportItem.QualityNum = MillionsMonthlyReportItem.QualityNum;
|
||||
newMillionsMonthlyReportItem.OtherNum = MillionsMonthlyReportItem.OtherNum;
|
||||
newMillionsMonthlyReportItem.FirstAidDressingsNum = MillionsMonthlyReportItem.FirstAidDressingsNum;
|
||||
newMillionsMonthlyReportItem.AttemptedEventNum = MillionsMonthlyReportItem.AttemptedEventNum;
|
||||
newMillionsMonthlyReportItem.LossDayNum = MillionsMonthlyReportItem.LossDayNum;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据Id删除所有数据
|
||||
/// </summary>
|
||||
/// <param name="MillionsMonthlyReportItemId"></param>
|
||||
public static void DeleteMillionsMonthlyReportItemByMillionsMonthlyReportId(string MillionsMonthlyReportId)
|
||||
{
|
||||
var q = from x in Funs.DB.Information_MillionsMonthlyReportItem where x.MillionsMonthlyReportId == MillionsMonthlyReportId select x;
|
||||
if (q != null)
|
||||
{
|
||||
Funs.DB.Information_MillionsMonthlyReportItem.DeleteAllOnSubmit(q);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class MillionsMonthlyReportService
|
||||
{
|
||||
/// <summary>
|
||||
/// 百万工时安全统计月报表
|
||||
/// </summary>
|
||||
/// <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>
|
||||
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获取百万工时安全统计月报表集合
|
||||
/// </summary>
|
||||
/// <param name="UnitId">单位Id</param>
|
||||
/// <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>
|
||||
public static void AddMillionsMonthlyReport(Model.Information_MillionsMonthlyReport MillionsMonthlyReport)
|
||||
{
|
||||
Model.Information_MillionsMonthlyReport newMillionsMonthlyReport = new Model.Information_MillionsMonthlyReport
|
||||
{
|
||||
MillionsMonthlyReportId = MillionsMonthlyReport.MillionsMonthlyReportId,
|
||||
Year = MillionsMonthlyReport.Year,
|
||||
Month = MillionsMonthlyReport.Month,
|
||||
UnitId = MillionsMonthlyReport.UnitId,
|
||||
FillingDate = MillionsMonthlyReport.FillingDate,
|
||||
DutyPerson = MillionsMonthlyReport.DutyPerson,
|
||||
RecordableIncidentRate = MillionsMonthlyReport.RecordableIncidentRate,
|
||||
LostTimeRate = MillionsMonthlyReport.LostTimeRate,
|
||||
LostTimeInjuryRate = MillionsMonthlyReport.LostTimeInjuryRate,
|
||||
DeathAccidentFrequency = MillionsMonthlyReport.DeathAccidentFrequency,
|
||||
AccidentMortality = MillionsMonthlyReport.AccidentMortality,
|
||||
FillingMan = MillionsMonthlyReport.FillingMan,
|
||||
UpState = MillionsMonthlyReport.UpState,
|
||||
HandleState = MillionsMonthlyReport.HandleState,
|
||||
HandleMan = MillionsMonthlyReport.HandleMan
|
||||
};
|
||||
|
||||
Funs.DB.Information_MillionsMonthlyReport.InsertOnSubmit(newMillionsMonthlyReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改百万工时安全统计月报表
|
||||
/// </summary>
|
||||
/// <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);
|
||||
if (newMillionsMonthlyReport != null)
|
||||
{
|
||||
newMillionsMonthlyReport.Year = MillionsMonthlyReport.Year;
|
||||
newMillionsMonthlyReport.Month = MillionsMonthlyReport.Month;
|
||||
newMillionsMonthlyReport.UnitId = MillionsMonthlyReport.UnitId;
|
||||
newMillionsMonthlyReport.FillingDate = MillionsMonthlyReport.FillingDate;
|
||||
newMillionsMonthlyReport.DutyPerson = MillionsMonthlyReport.DutyPerson;
|
||||
newMillionsMonthlyReport.RecordableIncidentRate = MillionsMonthlyReport.RecordableIncidentRate;
|
||||
newMillionsMonthlyReport.LostTimeRate = MillionsMonthlyReport.LostTimeRate;
|
||||
newMillionsMonthlyReport.LostTimeInjuryRate = MillionsMonthlyReport.LostTimeInjuryRate;
|
||||
newMillionsMonthlyReport.DeathAccidentFrequency = MillionsMonthlyReport.DeathAccidentFrequency;
|
||||
newMillionsMonthlyReport.AccidentMortality = MillionsMonthlyReport.AccidentMortality;
|
||||
newMillionsMonthlyReport.UpState = MillionsMonthlyReport.UpState;
|
||||
newMillionsMonthlyReport.HandleState = MillionsMonthlyReport.HandleState;
|
||||
newMillionsMonthlyReport.HandleMan = MillionsMonthlyReport.HandleMan;
|
||||
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据Id获取数据
|
||||
/// </summary>
|
||||
/// <param name="MillionsMonthlyReportId"></param>
|
||||
public static void DeleteMillionsMonthlyReportByMillionsMonthlyReportId(string MillionsMonthlyReportId)
|
||||
{
|
||||
Model.Information_MillionsMonthlyReport newMillionsMonthlyReport = Funs.DB.Information_MillionsMonthlyReport.FirstOrDefault(e => e.MillionsMonthlyReportId == MillionsMonthlyReportId);
|
||||
if (newMillionsMonthlyReport != null)
|
||||
{
|
||||
Funs.DB.Information_MillionsMonthlyReport.DeleteOnSubmit(newMillionsMonthlyReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据报表单位,报表时间判断是否存在
|
||||
/// </summary>
|
||||
/// <param name="Id">Id</param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_MillionsMonthlyReport GetMillionsMonthlyReportByUnitIdDate(string unitId, int year, int Month)
|
||||
{
|
||||
return Funs.DB.Information_MillionsMonthlyReport.FirstOrDefault(e => e.UnitId == unitId && e.Year == year && e.Month == Month);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,267 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 安全生产数据季报
|
||||
/// </summary>
|
||||
public static class SafetyQuarterlyReportService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取安全生产数据季报
|
||||
/// </summary>
|
||||
/// <param name="safetyQuarterlyReportId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_SafetyQuarterlyReport GetSafetyQuarterlyReportById(string safetyQuarterlyReportId)
|
||||
{
|
||||
return Funs.DB.Information_SafetyQuarterlyReport.FirstOrDefault(e => e.SafetyQuarterlyReportId == safetyQuarterlyReportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 安全生产数据季报
|
||||
/// </summary>
|
||||
/// <param name="unitId">单位Id</param>
|
||||
/// <param name="year">年度</param>
|
||||
/// <param name="quarters">季度</param>
|
||||
/// <returns>安全生产数据季报</returns>
|
||||
public static Model.Information_SafetyQuarterlyReport GetSafetyQuarterlyReportByUnitIdAndYearAndQuarters(string unitId, int year, int quarters)
|
||||
{
|
||||
return Funs.DB.Information_SafetyQuarterlyReport.FirstOrDefault(e => e.UnitId == unitId && e.Quarters == quarters && e.YearId == year);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位Id获取安全生产数据季报集合
|
||||
/// </summary>
|
||||
/// <param name="UnitId">单位Id</param>
|
||||
/// <returns>安全生产数据季报集合</returns>
|
||||
public static List<Model.View_Information_SafetyQuarterlyReport> GetSafetyQuarterlyReportsByUnitId(string UnitId)
|
||||
{
|
||||
return (from x in Funs.DB.View_Information_SafetyQuarterlyReport where x.UnitId == UnitId orderby x.FillingDate descending select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据单位、年度、季度获取安全生产数据季报
|
||||
/// </summary>
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="yearId"></param>
|
||||
/// <param name="quarters"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Information_SafetyQuarterlyReport GetSafetyQuarterlyReportByUnitYearQuarters(string unitId, int yearId, int quarters)
|
||||
{
|
||||
return Funs.DB.Information_SafetyQuarterlyReport.FirstOrDefault(e => e.UnitId == unitId && e.YearId == yearId && e.Quarters == quarters);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 增加安全生产数据季报
|
||||
/// </summary>
|
||||
/// <param name="safetyQuarterlyReport"></param>
|
||||
public static void AddSafetyQuarterlyReport(Model.Information_SafetyQuarterlyReport safetyQuarterlyReport)
|
||||
{
|
||||
Model.Information_SafetyQuarterlyReport newSafetyQuarterlyReport = new Model.Information_SafetyQuarterlyReport
|
||||
{
|
||||
SafetyQuarterlyReportId = safetyQuarterlyReport.SafetyQuarterlyReportId,
|
||||
UnitId = safetyQuarterlyReport.UnitId,
|
||||
YearId = safetyQuarterlyReport.YearId,
|
||||
FillingDate = DateTime.Now,
|
||||
Quarters = safetyQuarterlyReport.Quarters,
|
||||
TotalInWorkHours = safetyQuarterlyReport.TotalInWorkHours,
|
||||
TotalInWorkHoursRemark = safetyQuarterlyReport.TotalInWorkHoursRemark,
|
||||
TotalOutWorkHours = safetyQuarterlyReport.TotalOutWorkHours,
|
||||
TotalOutWorkHoursRemark = safetyQuarterlyReport.TotalOutWorkHoursRemark,
|
||||
WorkHoursLossRate = safetyQuarterlyReport.WorkHoursLossRate,
|
||||
WorkHoursLossRateRemark = safetyQuarterlyReport.WorkHoursLossRateRemark,
|
||||
WorkHoursAccuracy = safetyQuarterlyReport.WorkHoursAccuracy,
|
||||
WorkHoursAccuracyRemark = safetyQuarterlyReport.WorkHoursAccuracyRemark,
|
||||
MainBusinessIncome = safetyQuarterlyReport.MainBusinessIncome,
|
||||
MainBusinessIncomeRemark = safetyQuarterlyReport.MainBusinessIncomeRemark,
|
||||
ConstructionRevenue = safetyQuarterlyReport.ConstructionRevenue,
|
||||
ConstructionRevenueRemark = safetyQuarterlyReport.ConstructionRevenueRemark,
|
||||
UnitTimeIncome = safetyQuarterlyReport.UnitTimeIncome,
|
||||
UnitTimeIncomeRemark = safetyQuarterlyReport.UnitTimeIncomeRemark,
|
||||
BillionsOutputMortality = safetyQuarterlyReport.BillionsOutputMortality,
|
||||
BillionsOutputMortalityRemark = safetyQuarterlyReport.BillionsOutputMortalityRemark,
|
||||
MajorFireAccident = safetyQuarterlyReport.MajorFireAccident,
|
||||
MajorFireAccidentRemark = safetyQuarterlyReport.MajorFireAccidentRemark,
|
||||
MajorEquipAccident = safetyQuarterlyReport.MajorEquipAccident,
|
||||
MajorEquipAccidentRemark = safetyQuarterlyReport.MajorEquipAccidentRemark,
|
||||
AccidentFrequency = safetyQuarterlyReport.AccidentFrequency,
|
||||
AccidentFrequencyRemark = safetyQuarterlyReport.AccidentFrequencyRemark,
|
||||
SeriousInjuryAccident = safetyQuarterlyReport.SeriousInjuryAccident,
|
||||
SeriousInjuryAccidentRemark = safetyQuarterlyReport.SeriousInjuryAccidentRemark,
|
||||
FireAccident = safetyQuarterlyReport.FireAccident,
|
||||
FireAccidentRemark = safetyQuarterlyReport.FireAccidentRemark,
|
||||
EquipmentAccident = safetyQuarterlyReport.EquipmentAccident,
|
||||
EquipmentAccidentRemark = safetyQuarterlyReport.EquipmentAccidentRemark,
|
||||
PoisoningAndInjuries = safetyQuarterlyReport.PoisoningAndInjuries,
|
||||
PoisoningAndInjuriesRemark = safetyQuarterlyReport.PoisoningAndInjuriesRemark,
|
||||
ProductionSafetyInTotal = safetyQuarterlyReport.ProductionSafetyInTotal,
|
||||
ProductionSafetyInTotalRemark = safetyQuarterlyReport.ProductionSafetyInTotalRemark,
|
||||
ProtectionInput = safetyQuarterlyReport.ProtectionInput,
|
||||
ProtectionInputRemark = safetyQuarterlyReport.ProtectionInputRemark,
|
||||
LaboAndHealthIn = safetyQuarterlyReport.LaboAndHealthIn,
|
||||
LaborAndHealthInRemark = safetyQuarterlyReport.LaborAndHealthInRemark,
|
||||
TechnologyProgressIn = safetyQuarterlyReport.TechnologyProgressIn,
|
||||
TechnologyProgressInRemark = safetyQuarterlyReport.TechnologyProgressInRemark,
|
||||
EducationTrainIn = safetyQuarterlyReport.EducationTrainIn,
|
||||
EducationTrainInRemark = safetyQuarterlyReport.EducationTrainInRemark,
|
||||
ProjectCostRate = safetyQuarterlyReport.ProjectCostRate,
|
||||
ProjectCostRateRemark = safetyQuarterlyReport.ProjectCostRateRemark,
|
||||
ProductionInput = safetyQuarterlyReport.ProductionInput,
|
||||
ProductionInputRemark = safetyQuarterlyReport.ProductionInputRemark,
|
||||
Revenue = safetyQuarterlyReport.Revenue,
|
||||
RevenueRemark = safetyQuarterlyReport.RevenueRemark,
|
||||
FullTimeMan = safetyQuarterlyReport.FullTimeMan,
|
||||
FullTimeManRemark = safetyQuarterlyReport.FullTimeManRemark,
|
||||
FullTimeManAttachUrl = safetyQuarterlyReport.FullTimeManAttachUrl,
|
||||
PMMan = safetyQuarterlyReport.PMMan,
|
||||
PMManRemark = safetyQuarterlyReport.PMManRemark,
|
||||
PMManAttachUrl = safetyQuarterlyReport.PMManAttachUrl,
|
||||
CorporateDirectorEdu = safetyQuarterlyReport.CorporateDirectorEdu,
|
||||
CorporateDirectorEduRemark = safetyQuarterlyReport.CorporateDirectorEduRemark,
|
||||
ProjectLeaderEdu = safetyQuarterlyReport.ProjectLeaderEdu,
|
||||
ProjectLeaderEduRemark = safetyQuarterlyReport.ProjectLeaderEduRemark,
|
||||
FullTimeEdu = safetyQuarterlyReport.FullTimeEdu,
|
||||
FullTimeEduRemark = safetyQuarterlyReport.FullTimeEduRemark,
|
||||
ThreeKidsEduRate = safetyQuarterlyReport.ThreeKidsEduRate,
|
||||
ThreeKidsEduRateRemark = safetyQuarterlyReport.ThreeKidsEduRateRemark,
|
||||
UplinReportRate = safetyQuarterlyReport.UplinReportRate,
|
||||
UplinReportRateRemark = safetyQuarterlyReport.UplinReportRateRemark,
|
||||
Remarks = safetyQuarterlyReport.Remarks,
|
||||
CompileMan = safetyQuarterlyReport.CompileMan,
|
||||
UpState = safetyQuarterlyReport.UpState,
|
||||
HandleState = safetyQuarterlyReport.HandleState,
|
||||
HandleMan = safetyQuarterlyReport.HandleMan,
|
||||
KeyEquipmentTotal = safetyQuarterlyReport.KeyEquipmentTotal,
|
||||
KeyEquipmentTotalRemark = safetyQuarterlyReport.KeyEquipmentTotalRemark,
|
||||
KeyEquipmentReportCount = safetyQuarterlyReport.KeyEquipmentReportCount,
|
||||
KeyEquipmentReportCountRemark = safetyQuarterlyReport.KeyEquipmentReportCountRemark,
|
||||
ChemicalAreaProjectCount = safetyQuarterlyReport.ChemicalAreaProjectCount,
|
||||
ChemicalAreaProjectCountRemark = safetyQuarterlyReport.ChemicalAreaProjectCountRemark,
|
||||
HarmfulMediumCoverCount = safetyQuarterlyReport.HarmfulMediumCoverCount,
|
||||
HarmfulMediumCoverCountRemark = safetyQuarterlyReport.HarmfulMediumCoverCountRemark,
|
||||
HarmfulMediumCoverRate = safetyQuarterlyReport.HarmfulMediumCoverRate,
|
||||
HarmfulMediumCoverRateRemark = safetyQuarterlyReport.HarmfulMediumCoverRateRemark
|
||||
};
|
||||
Funs.DB.Information_SafetyQuarterlyReport.InsertOnSubmit(newSafetyQuarterlyReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改安全生产数据季报
|
||||
/// </summary>
|
||||
/// <param name="safetyQuarterlyReport"></param>
|
||||
public static void UpdateSafetyQuarterlyReport(Model.Information_SafetyQuarterlyReport safetyQuarterlyReport)
|
||||
{
|
||||
Model.Information_SafetyQuarterlyReport newSafetyQuarterlyReport = Funs.DB.Information_SafetyQuarterlyReport.FirstOrDefault(e => e.SafetyQuarterlyReportId == safetyQuarterlyReport.SafetyQuarterlyReportId);
|
||||
if (newSafetyQuarterlyReport != null)
|
||||
{
|
||||
newSafetyQuarterlyReport.UnitId = safetyQuarterlyReport.UnitId;
|
||||
newSafetyQuarterlyReport.YearId = safetyQuarterlyReport.YearId;
|
||||
newSafetyQuarterlyReport.Quarters = safetyQuarterlyReport.Quarters;
|
||||
newSafetyQuarterlyReport.TotalInWorkHours = safetyQuarterlyReport.TotalInWorkHours;
|
||||
newSafetyQuarterlyReport.TotalInWorkHoursRemark = safetyQuarterlyReport.TotalInWorkHoursRemark;
|
||||
newSafetyQuarterlyReport.TotalOutWorkHours = safetyQuarterlyReport.TotalOutWorkHours;
|
||||
newSafetyQuarterlyReport.TotalOutWorkHoursRemark = safetyQuarterlyReport.TotalOutWorkHoursRemark;
|
||||
newSafetyQuarterlyReport.WorkHoursLossRate = safetyQuarterlyReport.WorkHoursLossRate;
|
||||
newSafetyQuarterlyReport.WorkHoursLossRateRemark = safetyQuarterlyReport.WorkHoursLossRateRemark;
|
||||
newSafetyQuarterlyReport.WorkHoursAccuracy = safetyQuarterlyReport.WorkHoursAccuracy;
|
||||
newSafetyQuarterlyReport.WorkHoursAccuracyRemark = safetyQuarterlyReport.WorkHoursAccuracyRemark;
|
||||
newSafetyQuarterlyReport.MainBusinessIncome = safetyQuarterlyReport.MainBusinessIncome;
|
||||
newSafetyQuarterlyReport.MainBusinessIncomeRemark = safetyQuarterlyReport.MainBusinessIncomeRemark;
|
||||
newSafetyQuarterlyReport.ConstructionRevenue = safetyQuarterlyReport.ConstructionRevenue;
|
||||
newSafetyQuarterlyReport.ConstructionRevenueRemark = safetyQuarterlyReport.ConstructionRevenueRemark;
|
||||
newSafetyQuarterlyReport.UnitTimeIncome = safetyQuarterlyReport.UnitTimeIncome;
|
||||
newSafetyQuarterlyReport.UnitTimeIncomeRemark = safetyQuarterlyReport.UnitTimeIncomeRemark;
|
||||
newSafetyQuarterlyReport.BillionsOutputMortality = safetyQuarterlyReport.BillionsOutputMortality;
|
||||
newSafetyQuarterlyReport.BillionsOutputMortalityRemark = safetyQuarterlyReport.BillionsOutputMortalityRemark;
|
||||
newSafetyQuarterlyReport.MajorFireAccident = safetyQuarterlyReport.MajorFireAccident;
|
||||
newSafetyQuarterlyReport.MajorFireAccidentRemark = safetyQuarterlyReport.MajorFireAccidentRemark;
|
||||
newSafetyQuarterlyReport.MajorEquipAccident = safetyQuarterlyReport.MajorEquipAccident;
|
||||
newSafetyQuarterlyReport.MajorEquipAccidentRemark = safetyQuarterlyReport.MajorEquipAccidentRemark;
|
||||
newSafetyQuarterlyReport.AccidentFrequency = safetyQuarterlyReport.AccidentFrequency;
|
||||
newSafetyQuarterlyReport.AccidentFrequencyRemark = safetyQuarterlyReport.AccidentFrequencyRemark;
|
||||
newSafetyQuarterlyReport.SeriousInjuryAccident = safetyQuarterlyReport.SeriousInjuryAccident;
|
||||
newSafetyQuarterlyReport.SeriousInjuryAccidentRemark = safetyQuarterlyReport.SeriousInjuryAccidentRemark;
|
||||
newSafetyQuarterlyReport.FireAccident = safetyQuarterlyReport.FireAccident;
|
||||
newSafetyQuarterlyReport.FireAccidentRemark = safetyQuarterlyReport.FireAccidentRemark;
|
||||
newSafetyQuarterlyReport.EquipmentAccident = safetyQuarterlyReport.EquipmentAccident;
|
||||
newSafetyQuarterlyReport.EquipmentAccidentRemark = safetyQuarterlyReport.EquipmentAccidentRemark;
|
||||
newSafetyQuarterlyReport.PoisoningAndInjuries = safetyQuarterlyReport.PoisoningAndInjuries;
|
||||
newSafetyQuarterlyReport.PoisoningAndInjuriesRemark = safetyQuarterlyReport.PoisoningAndInjuriesRemark;
|
||||
newSafetyQuarterlyReport.ProductionSafetyInTotal = safetyQuarterlyReport.ProductionSafetyInTotal;
|
||||
newSafetyQuarterlyReport.ProductionSafetyInTotalRemark = safetyQuarterlyReport.ProductionSafetyInTotalRemark;
|
||||
newSafetyQuarterlyReport.ProtectionInput = safetyQuarterlyReport.ProtectionInput;
|
||||
newSafetyQuarterlyReport.ProtectionInputRemark = safetyQuarterlyReport.ProtectionInputRemark;
|
||||
newSafetyQuarterlyReport.LaboAndHealthIn = safetyQuarterlyReport.LaboAndHealthIn;
|
||||
newSafetyQuarterlyReport.LaborAndHealthInRemark = safetyQuarterlyReport.LaborAndHealthInRemark;
|
||||
newSafetyQuarterlyReport.TechnologyProgressIn = safetyQuarterlyReport.TechnologyProgressIn;
|
||||
newSafetyQuarterlyReport.TechnologyProgressInRemark = safetyQuarterlyReport.TechnologyProgressInRemark;
|
||||
newSafetyQuarterlyReport.EducationTrainIn = safetyQuarterlyReport.EducationTrainIn;
|
||||
newSafetyQuarterlyReport.EducationTrainInRemark = safetyQuarterlyReport.EducationTrainInRemark;
|
||||
newSafetyQuarterlyReport.ProjectCostRate = safetyQuarterlyReport.ProjectCostRate;
|
||||
newSafetyQuarterlyReport.ProjectCostRateRemark = safetyQuarterlyReport.ProjectCostRateRemark;
|
||||
newSafetyQuarterlyReport.ProductionInput = safetyQuarterlyReport.ProductionInput;
|
||||
newSafetyQuarterlyReport.ProductionInputRemark = safetyQuarterlyReport.ProductionInputRemark;
|
||||
newSafetyQuarterlyReport.Revenue = safetyQuarterlyReport.Revenue;
|
||||
newSafetyQuarterlyReport.RevenueRemark = safetyQuarterlyReport.RevenueRemark;
|
||||
newSafetyQuarterlyReport.FullTimeMan = safetyQuarterlyReport.FullTimeMan;
|
||||
newSafetyQuarterlyReport.FullTimeManRemark = safetyQuarterlyReport.FullTimeManRemark;
|
||||
newSafetyQuarterlyReport.FullTimeManAttachUrl = safetyQuarterlyReport.FullTimeManAttachUrl;
|
||||
newSafetyQuarterlyReport.PMMan = safetyQuarterlyReport.PMMan;
|
||||
newSafetyQuarterlyReport.PMManRemark = safetyQuarterlyReport.PMManRemark;
|
||||
newSafetyQuarterlyReport.PMManAttachUrl = safetyQuarterlyReport.PMManAttachUrl;
|
||||
newSafetyQuarterlyReport.CorporateDirectorEdu = safetyQuarterlyReport.CorporateDirectorEdu;
|
||||
newSafetyQuarterlyReport.CorporateDirectorEduRemark = safetyQuarterlyReport.CorporateDirectorEduRemark;
|
||||
newSafetyQuarterlyReport.ProjectLeaderEdu = safetyQuarterlyReport.ProjectLeaderEdu;
|
||||
newSafetyQuarterlyReport.ProjectLeaderEduRemark = safetyQuarterlyReport.ProjectLeaderEduRemark;
|
||||
newSafetyQuarterlyReport.FullTimeEdu = safetyQuarterlyReport.FullTimeEdu;
|
||||
newSafetyQuarterlyReport.FullTimeEduRemark = safetyQuarterlyReport.FullTimeEduRemark;
|
||||
newSafetyQuarterlyReport.ThreeKidsEduRate = safetyQuarterlyReport.ThreeKidsEduRate;
|
||||
newSafetyQuarterlyReport.ThreeKidsEduRateRemark = safetyQuarterlyReport.ThreeKidsEduRateRemark;
|
||||
newSafetyQuarterlyReport.UplinReportRate = safetyQuarterlyReport.UplinReportRate;
|
||||
newSafetyQuarterlyReport.UplinReportRateRemark = safetyQuarterlyReport.UplinReportRateRemark;
|
||||
newSafetyQuarterlyReport.Remarks = safetyQuarterlyReport.Remarks;
|
||||
newSafetyQuarterlyReport.UpState = safetyQuarterlyReport.UpState;
|
||||
newSafetyQuarterlyReport.HandleState = safetyQuarterlyReport.HandleState;
|
||||
newSafetyQuarterlyReport.HandleMan = safetyQuarterlyReport.HandleMan;
|
||||
newSafetyQuarterlyReport.KeyEquipmentTotal = safetyQuarterlyReport.KeyEquipmentTotal;
|
||||
newSafetyQuarterlyReport.KeyEquipmentTotalRemark = safetyQuarterlyReport.KeyEquipmentTotalRemark;
|
||||
newSafetyQuarterlyReport.KeyEquipmentReportCount = safetyQuarterlyReport.KeyEquipmentReportCount;
|
||||
newSafetyQuarterlyReport.KeyEquipmentReportCountRemark = safetyQuarterlyReport.KeyEquipmentReportCountRemark;
|
||||
newSafetyQuarterlyReport.ChemicalAreaProjectCount = safetyQuarterlyReport.ChemicalAreaProjectCount;
|
||||
newSafetyQuarterlyReport.ChemicalAreaProjectCountRemark = safetyQuarterlyReport.ChemicalAreaProjectCountRemark;
|
||||
newSafetyQuarterlyReport.HarmfulMediumCoverCount = safetyQuarterlyReport.HarmfulMediumCoverCount;
|
||||
newSafetyQuarterlyReport.HarmfulMediumCoverCountRemark = safetyQuarterlyReport.HarmfulMediumCoverCountRemark;
|
||||
newSafetyQuarterlyReport.HarmfulMediumCoverRate = safetyQuarterlyReport.HarmfulMediumCoverRate;
|
||||
newSafetyQuarterlyReport.HarmfulMediumCoverRateRemark = safetyQuarterlyReport.HarmfulMediumCoverRateRemark;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除安全生产数据季报
|
||||
/// </summary>
|
||||
/// <param name="safetyQuarterlyReportId"></param>
|
||||
public static void DeleteSafetyQuarterlyReportById(string safetyQuarterlyReportId)
|
||||
{
|
||||
Model.Information_SafetyQuarterlyReport safetyQuarterlyReport = Funs.DB.Information_SafetyQuarterlyReport.FirstOrDefault(e => e.SafetyQuarterlyReportId == safetyQuarterlyReportId);
|
||||
if (safetyQuarterlyReport != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(safetyQuarterlyReport.FullTimeManAttachUrl))
|
||||
{
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, safetyQuarterlyReport.FullTimeManAttachUrl);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(safetyQuarterlyReport.PMManAttachUrl))
|
||||
{
|
||||
BLL.UploadFileService.DeleteFile(Funs.RootPath, safetyQuarterlyReport.PMManAttachUrl);
|
||||
}
|
||||
Funs.DB.Information_SafetyQuarterlyReport.DeleteOnSubmit(safetyQuarterlyReport);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public static class UrgeReportService
|
||||
{
|
||||
/// <summary>
|
||||
/// 更新催报完成
|
||||
/// </summary>
|
||||
/// <param name="unitId"></param>
|
||||
/// <param name="reportType"></param>
|
||||
/// <param name="Year"></param>
|
||||
/// <param name="Month"></param>
|
||||
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)
|
||||
{
|
||||
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)
|
||||
{
|
||||
urgeReport = Funs.DB.Information_UrgeReport.FirstOrDefault(x => x.UnitId == unitId && x.ReprotType == reportType && x.YearId == year && x.QuarterId == value);
|
||||
}
|
||||
else if (reportType == Const.ReportType_5)
|
||||
{
|
||||
urgeReport = Funs.DB.Information_UrgeReport.FirstOrDefault(x => x.UnitId == unitId && x.ReprotType == reportType && x.YearId == year && x.HalfYearId == value);
|
||||
}
|
||||
if (urgeReport != null)
|
||||
{
|
||||
urgeReport.IsComplete = true;
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user