2024-11-19 09:45:27 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace BLL
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 周(月)报综合管理
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static class ComprehensiveService
|
|
|
|
|
{
|
2025-08-04 18:04:41 +08:00
|
|
|
|
public static Model.CNPCDB db = Funs.DB;
|
2024-11-19 09:45:27 +08:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据主键获取本周(月)报综合信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="thisWeekOrMonthContentId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static Model.Report_Comprehensive GetTComprehensiveById(string comprehensiveId)
|
|
|
|
|
{
|
|
|
|
|
return Funs.DB.Report_Comprehensive.FirstOrDefault(e => e.ComprehensiveId == comprehensiveId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据周(月)报表Id获取本周(月)报综合信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="reportId"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static Model.Report_Comprehensive GetComprehensiveByReportId(string reportId)
|
|
|
|
|
{
|
|
|
|
|
return (from x in Funs.DB.Report_Comprehensive where x.ReportId == reportId select x).FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 添加本周(月)报综合信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="thisWeekOrMonthContent"></param>
|
|
|
|
|
public static void AddComprehensive(Model.Report_Comprehensive comprehensive)
|
|
|
|
|
{
|
2025-08-04 18:04:41 +08:00
|
|
|
|
Model.CNPCDB db = Funs.DB;
|
2024-11-19 09:45:27 +08:00
|
|
|
|
Model.Report_Comprehensive newComprehensive = new Model.Report_Comprehensive();
|
|
|
|
|
newComprehensive.ComprehensiveId = comprehensive.ComprehensiveId;
|
|
|
|
|
newComprehensive.ReportId = comprehensive.ReportId;
|
|
|
|
|
newComprehensive.TotalCount = comprehensive.TotalCount;
|
|
|
|
|
newComprehensive.EquipmentRate = comprehensive.EquipmentRate;
|
|
|
|
|
newComprehensive.Others = comprehensive.Others;
|
|
|
|
|
db.Report_Comprehensive.InsertOnSubmit(newComprehensive);
|
|
|
|
|
db.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据周(月)报Id删除所有相关本周(月)报综合信息
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="reportId"></param>
|
|
|
|
|
public static void DeleteComprehensiveByReportId(string reportId)
|
|
|
|
|
{
|
2025-08-04 18:04:41 +08:00
|
|
|
|
Model.CNPCDB db = Funs.DB;
|
2024-11-19 09:45:27 +08:00
|
|
|
|
var q = (from x in db.Report_Comprehensive where x.ReportId == reportId select x).ToList();
|
|
|
|
|
if (q.Count() > 0)
|
|
|
|
|
{
|
|
|
|
|
db.Report_Comprehensive.DeleteAllOnSubmit(q);
|
|
|
|
|
db.SubmitChanges();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|