85 lines
3.7 KiB
C#
85 lines
3.7 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Linq;
|
||
using System.Text;
|
||
|
||
namespace BLL
|
||
{
|
||
/// <summary>
|
||
/// 周(月)报综合管理
|
||
/// </summary>
|
||
public static class QualityGoalService
|
||
{
|
||
public static Model.SGGLDB db = Funs.DB;
|
||
|
||
/// <summary>
|
||
/// 根据主键获取本周(月)报综合信息
|
||
/// </summary>
|
||
/// <param name="thisWeekOrMonthContentId"></param>
|
||
/// <returns></returns>
|
||
public static Model.Report_QualityGoal GetTComprehensiveById(string ReportId)
|
||
{
|
||
return Funs.DB.Report_QualityGoal.FirstOrDefault(e => e.ReportId == ReportId);
|
||
}
|
||
|
||
/// <summary>
|
||
/// 根据周(月)报表Id获取本周(月)报综合信息
|
||
/// </summary>
|
||
/// <param name="reportId"></param>
|
||
/// <returns></returns>
|
||
public static Model.Report_QualityGoal Get_QualityGoalByReportId(string reportId)
|
||
{
|
||
return (from x in Funs.DB.Report_QualityGoal where x.ReportId == reportId select x).FirstOrDefault();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加本周(月)报综合信息
|
||
/// </summary>
|
||
/// <param name="thisWeekOrMonthContent"></param>
|
||
public static void Add_QualityGoal(Model.Report_QualityGoal comprehensive)
|
||
{
|
||
Model.SGGLDB db = Funs.DB;
|
||
Model.Report_QualityGoal newComprehensive = new Model.Report_QualityGoal();
|
||
newComprehensive.ReportId = comprehensive.ReportId;
|
||
newComprehensive.ProjectId = comprehensive.ProjectId;
|
||
newComprehensive.Date = comprehensive.Date;
|
||
newComprehensive.Pro_Total = comprehensive.Pro_Total;
|
||
newComprehensive.Pro_Pass = comprehensive.Pro_Pass;
|
||
newComprehensive.Pro_NoPassRectify = comprehensive.Pro_NoPassRectify;
|
||
newComprehensive.Sup_Total = comprehensive.Sup_Total;
|
||
newComprehensive.Sup_Rectify = comprehensive.Sup_Rectify;
|
||
newComprehensive.Sub_Total = comprehensive.Sub_Total;
|
||
newComprehensive.Sub_Pass = comprehensive.Sub_Pass;
|
||
newComprehensive.WorkArea_Total = comprehensive.WorkArea_Total;
|
||
newComprehensive.WorkArea_Pass = comprehensive.WorkArea_Pass;
|
||
newComprehensive.KeyPro_Total = comprehensive.KeyPro_Total;
|
||
newComprehensive.KeyPro_Pass = comprehensive.KeyPro_Pass;
|
||
newComprehensive.Weld_Total = comprehensive.Weld_Total;
|
||
newComprehensive.Weld_Pass = comprehensive.Weld_Pass;
|
||
newComprehensive.DeviceWeld_Total = comprehensive.DeviceWeld_Total;
|
||
newComprehensive.DeviceWeld_Pass = comprehensive.DeviceWeld_Pass;
|
||
newComprehensive.SafetyInstruction_Total = comprehensive.SafetyInstruction_Total;
|
||
newComprehensive.SafetyInstruction_Pass = comprehensive.SafetyInstruction_Pass;
|
||
newComprehensive.ManName = comprehensive.ManName;
|
||
newComprehensive.ManOcpu = comprehensive.ManOcpu;
|
||
newComprehensive.Remark = comprehensive.Remark;
|
||
db.Report_QualityGoal.InsertOnSubmit(newComprehensive);
|
||
db.SubmitChanges();
|
||
}
|
||
|
||
/// <summary>
|
||
/// 根据周(月)报Id删除所有相关本周(月)报综合信息
|
||
/// </summary>
|
||
/// <param name="reportId"></param>
|
||
public static void Delete_QualityGoalByReportId(string reportId)
|
||
{
|
||
Model.SGGLDB db = Funs.DB;
|
||
var q = (from x in db.Report_QualityGoal where x.ReportId == reportId select x).ToList();
|
||
if (q.Count() > 0)
|
||
{
|
||
db.Report_QualityGoal.DeleteAllOnSubmit(q);
|
||
db.SubmitChanges();
|
||
}
|
||
}
|
||
}
|
||
} |