67 lines
2.6 KiB
C#
67 lines
2.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BLL
|
|
{
|
|
/// <summary>
|
|
/// 伤害事故统计
|
|
/// </summary>
|
|
public class InjuryAccidentCService
|
|
{
|
|
/// <summary>
|
|
/// 根据月报ID获取伤害事故统计
|
|
/// </summary>
|
|
/// <param name="monthReportId"></param>
|
|
/// <returns></returns>
|
|
public static List<Model.Manager_Month_InjuryAccidentC> GetInjuryAccidentCByMonthReportId(string monthReportId)
|
|
{
|
|
return (from x in Funs.DB.Manager_Month_InjuryAccidentC where x.MonthReportId == monthReportId select x).ToList();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加伤害事故统计
|
|
/// </summary>
|
|
/// <param name="injuryAccount"></param>
|
|
public static void AddInjuryAccidentC(Model.Manager_Month_InjuryAccidentC injuryAccident)
|
|
{
|
|
Model.Manager_Month_InjuryAccidentC newInjuryAccident = new Model.Manager_Month_InjuryAccidentC
|
|
{
|
|
InjuryAccidentId = injuryAccident.InjuryAccidentId,
|
|
MonthReportId = injuryAccident.MonthReportId,
|
|
UnitName = injuryAccident.UnitName,
|
|
AttemptedIncidents = injuryAccident.AttemptedIncidents,
|
|
FirstAidDressing = injuryAccident.FirstAidDressing,
|
|
MedicalTreatment = injuryAccident.MedicalTreatment,
|
|
WorkLimitation = injuryAccident.WorkLimitation,
|
|
LossCount = injuryAccident.LossCount,
|
|
LossPerson = injuryAccident.LossPerson,
|
|
LossWorkTime = injuryAccident.LossWorkTime,
|
|
LossEconomy = injuryAccident.LossEconomy,
|
|
DeathCount=injuryAccident.DeathCount,
|
|
DeathPerson = injuryAccident.DeathPerson,
|
|
DeathWorkTime = injuryAccident.DeathWorkTime,
|
|
DeathEconomy = injuryAccident.DeathEconomy
|
|
};
|
|
Funs.DB.Manager_Month_InjuryAccidentC.InsertOnSubmit(newInjuryAccident);
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据月报ID删除伤害事故
|
|
/// </summary>
|
|
/// <param name="montReportId"></param>
|
|
public static void DeleteInjuryAccidengtByMonthReportId(string montReportId)
|
|
{
|
|
var q = (from x in Funs.DB.Manager_Month_InjuryAccidentC where x.MonthReportId == montReportId select x).ToList();
|
|
if (q != null)
|
|
{
|
|
Funs.DB.Manager_Month_InjuryAccidentC.DeleteAllOnSubmit(q);
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
}
|
|
}
|
|
}
|