20220315 代码初始化上传
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 周(月)报综合管理
|
||||
/// </summary>
|
||||
public static class ComprehensiveService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <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)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
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)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 施工过程问题
|
||||
/// </summary>
|
||||
public static class ConstructionProblemsService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取施工过程问题
|
||||
/// </summary>
|
||||
/// <param name="constructionProblemsId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Report_ConstructionProblems GetConstructionProblemsById(string constructionProblemsId)
|
||||
{
|
||||
return Funs.DB.Report_ConstructionProblems.FirstOrDefault(e => e.ConstructionProblemsId == constructionProblemsId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据周(月)报Id获取施工过程问题
|
||||
/// </summary>
|
||||
/// <param name="reportId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Report_ConstructionProblems> GetConstructionProblemsByReportId(string reportId)
|
||||
{
|
||||
return (from x in Funs.DB.Report_ConstructionProblems where x.ReportId == reportId select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据周(月)报Id获取施工过程问题视图列表
|
||||
/// </summary>
|
||||
/// <param name="reportId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.View_Report_ConstructionProblems> GetConstructionProblemsViewListByReportId(string reportId)
|
||||
{
|
||||
return (from x in Funs.DB.View_Report_ConstructionProblems where x.ReportId == reportId select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加施工过程问题
|
||||
/// </summary>
|
||||
/// <param name="constructionProblems"></param>
|
||||
public static void AddConstructionProblems(Model.Report_ConstructionProblems constructionProblems)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Report_ConstructionProblems newConstructionProblems = new Model.Report_ConstructionProblems();
|
||||
newConstructionProblems.ConstructionProblemsId = constructionProblems.ConstructionProblemsId;
|
||||
newConstructionProblems.ReportId = constructionProblems.ReportId;
|
||||
newConstructionProblems.UnitId = constructionProblems.UnitId;
|
||||
newConstructionProblems.ProblemDesrioption = constructionProblems.ProblemDesrioption;
|
||||
newConstructionProblems.TreatmentMeasures = constructionProblems.TreatmentMeasures;
|
||||
newConstructionProblems.ProcessingResults = constructionProblems.ProcessingResults;
|
||||
newConstructionProblems.Remark = constructionProblems.Remark;
|
||||
db.Report_ConstructionProblems.InsertOnSubmit(newConstructionProblems);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据周(月)报Id删除所有相关明细信息
|
||||
/// </summary>
|
||||
/// <param name="reportId"></param>
|
||||
public static void DeleteConstructionProblemsByReportId(string reportId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.Report_ConstructionProblems where x.ReportId == reportId select x).ToList();
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
db.Report_ConstructionProblems.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 下周质量控制重点
|
||||
/// </summary>
|
||||
public static class NextQualityControlService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取下周质量控制点
|
||||
/// </summary>
|
||||
/// <param name="nextQualityControlId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Report_NextQualityControl GetNextQualityControlById(string nextQualityControlId)
|
||||
{
|
||||
return Funs.DB.Report_NextQualityControl.FirstOrDefault(e => e.NextQualityControlId == nextQualityControlId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据周(月)报Id获取相关下周质量控制点
|
||||
/// </summary>
|
||||
/// <param name="reportId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Report_NextQualityControl> GetNextQualityControlByReportId(string reportId)
|
||||
{
|
||||
return (from x in Funs.DB.Report_NextQualityControl
|
||||
where x.ReportId == reportId
|
||||
select
|
||||
x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加下周质量控制点
|
||||
/// </summary>
|
||||
/// <param name="nextQualityControl"></param>
|
||||
public static void AddNextQualityControl(Model.Report_NextQualityControl nextQualityControl)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Report_NextQualityControl newNextQualityControl = new Model.Report_NextQualityControl();
|
||||
newNextQualityControl.NextQualityControlId = nextQualityControl.NextQualityControlId;
|
||||
newNextQualityControl.ReportId = nextQualityControl.ReportId;
|
||||
newNextQualityControl.NextQualityControlContent = nextQualityControl.NextQualityControlContent;
|
||||
db.Report_NextQualityControl.InsertOnSubmit(newNextQualityControl);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据周(月)报Id删除下周质量控制点
|
||||
/// </summary>
|
||||
/// <param name="reportId"></param>
|
||||
public static void DeleteNextQualityControlByReportId(string reportId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.Report_NextQualityControl where x.ReportId == reportId select x).ToList();
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
db.Report_NextQualityControl.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 原材料问题
|
||||
/// </summary>
|
||||
public static class RowMaterialProblemService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取原材料问题
|
||||
/// </summary>
|
||||
/// <param name="rowMaterialProblemId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Report_RowMaterialProblem GetRowMaterialProblemById(string rowMaterialProblemId)
|
||||
{
|
||||
return Funs.DB.Report_RowMaterialProblem.FirstOrDefault(e => e.RowMaterialProblemId == rowMaterialProblemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据周(月)报Id获取相关原材料问题
|
||||
/// </summary>
|
||||
/// <param name="reportId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Report_RowMaterialProblem> GetRowMaterialProblemByReportId(string reportId)
|
||||
{
|
||||
return (from x in db.Report_RowMaterialProblem where x.ReportId == reportId select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加原材料问题
|
||||
/// </summary>
|
||||
/// <param name="rowMaterialProblem"></param>
|
||||
public static void AddRowMaterialProblem(Model.Report_RowMaterialProblem rowMaterialProblem)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Report_RowMaterialProblem newRowMaterialProblem = new Model.Report_RowMaterialProblem();
|
||||
newRowMaterialProblem.RowMaterialProblemId = rowMaterialProblem.RowMaterialProblemId;
|
||||
newRowMaterialProblem.ReportId = rowMaterialProblem.ReportId;
|
||||
newRowMaterialProblem.UnitId = rowMaterialProblem.UnitId;
|
||||
newRowMaterialProblem.ProblemDesrioption = rowMaterialProblem.ProblemDesrioption;
|
||||
newRowMaterialProblem.TreatmentMeasures = rowMaterialProblem.TreatmentMeasures;
|
||||
newRowMaterialProblem.ProcessingResults = rowMaterialProblem.ProcessingResults;
|
||||
newRowMaterialProblem.Remark = rowMaterialProblem.Remark;
|
||||
db.Report_RowMaterialProblem.InsertOnSubmit(newRowMaterialProblem);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据周(月)报Id删除所有相关原材料问题
|
||||
/// </summary>
|
||||
/// <param name="reportId"></param>
|
||||
public static void DeleteRowMaterialProbleByReportId(string reportId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.Report_RowMaterialProblem where x.ReportId == reportId select x).ToList();
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
db.Report_RowMaterialProblem.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 本周主要工作内容
|
||||
/// </summary>
|
||||
public static class ThisWeekOrMonthContentService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取本周主要工作内容
|
||||
/// </summary>
|
||||
/// <param name="thisWeekOrMonthContentId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Report_ThisWeekOrMonthContent GetThisWeekOrMonthContentById(string thisWeekOrMonthContentId)
|
||||
{
|
||||
return Funs.DB.Report_ThisWeekOrMonthContent.FirstOrDefault(e => e.ContentId == thisWeekOrMonthContentId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据周(月)报表Id获取相关本周主要工作内容
|
||||
/// </summary>
|
||||
/// <param name="reportId"></param>
|
||||
/// <returns></returns>
|
||||
public static List<Model.Report_ThisWeekOrMonthContent> GetThisWeekOrMonthContentByReportId(string reportId)
|
||||
{
|
||||
return (from x in Funs.DB.Report_ThisWeekOrMonthContent where x.ReportId == reportId select x).ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加本周主要工作内容
|
||||
/// </summary>
|
||||
/// <param name="thisWeekOrMonthContent"></param>
|
||||
public static void AddThisWeekOrMonthContent(Model.Report_ThisWeekOrMonthContent thisWeekOrMonthContent)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Report_ThisWeekOrMonthContent newThisWeekOrMonthContent = new Model.Report_ThisWeekOrMonthContent();
|
||||
newThisWeekOrMonthContent.ContentId = thisWeekOrMonthContent.ContentId;
|
||||
newThisWeekOrMonthContent.ReportId = thisWeekOrMonthContent.ReportId;
|
||||
newThisWeekOrMonthContent.Contents = thisWeekOrMonthContent.Contents;
|
||||
db.Report_ThisWeekOrMonthContent.InsertOnSubmit(newThisWeekOrMonthContent);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据周(月)报Id删除所有相关本周主要工作内容
|
||||
/// </summary>
|
||||
/// <param name="reportId"></param>
|
||||
public static void DeleteThisWeekOrMonthContentByReportId(string reportId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
var q = (from x in db.Report_ThisWeekOrMonthContent where x.ReportId == reportId select x).ToList();
|
||||
if (q.Count() > 0)
|
||||
{
|
||||
db.Report_ThisWeekOrMonthContent.DeleteAllOnSubmit(q);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Collections;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
public static class WeekAndMonthReportService
|
||||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取分页列表
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="reportType"></param>
|
||||
/// <param name="startRowIndex"></param>
|
||||
/// <param name="maximumRows"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable GetListData(string projectId, string reportType, int startRowIndex, int maximumRows)
|
||||
{
|
||||
IQueryable<Model.Report_WeekAndMonthReport> q = from x in db.Report_WeekAndMonthReport
|
||||
where x.ProjectId == projectId
|
||||
&& x.ReportType == reportType
|
||||
orderby x.StartDate descending
|
||||
select x;
|
||||
|
||||
count = q.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return new object[] { };
|
||||
}
|
||||
return from x in q.Skip(startRowIndex).Take(maximumRows)
|
||||
select new
|
||||
{
|
||||
x.ReportId,
|
||||
Period = ("第 " + x.Period + " 期"),
|
||||
x.StartDate,
|
||||
x.EndDate,
|
||||
x.ProjectId,
|
||||
x.ReportType
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取分页列表数
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="reportType"></param>
|
||||
/// <returns></returns>
|
||||
public static int GetListCount(string projectId, string reportType)
|
||||
{
|
||||
return count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取周(月)报
|
||||
/// </summary>
|
||||
/// <param name="reportId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Report_WeekAndMonthReport GetWeekAndMonthReportById(string reportId)
|
||||
{
|
||||
return Funs.DB.Report_WeekAndMonthReport.FirstOrDefault(e => e.ReportId == reportId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加周(月)报
|
||||
/// </summary>
|
||||
/// <param name="report"></param>
|
||||
public static void AddWeekAndMonthReport(Model.Report_WeekAndMonthReport report)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Report_WeekAndMonthReport newReport = new Model.Report_WeekAndMonthReport();
|
||||
newReport.ReportId = report.ReportId;
|
||||
newReport.Period = report.Period;
|
||||
newReport.StartDate = report.StartDate;
|
||||
newReport.EndDate = report.EndDate;
|
||||
newReport.ProjectId = report.ProjectId;
|
||||
newReport.ReportType = report.ReportType;
|
||||
db.Report_WeekAndMonthReport.InsertOnSubmit(newReport);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改周(月)报
|
||||
/// </summary>
|
||||
/// <param name="report"></param>
|
||||
public static void UpdateWeekAndMonthReport(Model.Report_WeekAndMonthReport report)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Report_WeekAndMonthReport newReport = db.Report_WeekAndMonthReport.FirstOrDefault(e => e.ReportId == report.ReportId);
|
||||
if (newReport != null)
|
||||
{
|
||||
newReport.Period = report.Period;
|
||||
newReport.StartDate = report.StartDate;
|
||||
newReport.EndDate = report.EndDate;
|
||||
newReport.ProjectId = report.ProjectId;
|
||||
newReport.ReportType = report.ReportType;
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除周(月)报
|
||||
/// </summary>
|
||||
/// <param name="reportId"></param>
|
||||
public static void DeleteWeekAndMonthReportById(string reportId)
|
||||
{
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
Model.Report_WeekAndMonthReport report = db.Report_WeekAndMonthReport.FirstOrDefault(e => e.ReportId == reportId);
|
||||
if (report != null)
|
||||
{
|
||||
db.Report_WeekAndMonthReport.DeleteOnSubmit(report);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user