93 lines
		
	
	
		
			4.5 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			93 lines
		
	
	
		
			4.5 KiB
		
	
	
	
		
			C#
		
	
	
	
| using System;
 | |
| using System.Collections.Generic;
 | |
| using System.Linq;
 | |
| using System.Text;
 | |
| using System.Threading.Tasks;
 | |
| 
 | |
| namespace BLL
 | |
| {
 | |
|     /// <summary>
 | |
|     /// 安全监督检查报告表
 | |
|     /// </summary>
 | |
|     public static class SuperviseCheckReportService
 | |
|     {
 | |
|         /// <summary>
 | |
|         /// 根据主键获取安全监督检查报告
 | |
|         /// </summary>
 | |
|         /// <param name="superviseCheckReportId"></param>
 | |
|         /// <returns></returns>
 | |
|         public static Model.Supervise_SuperviseCheckReport GetSuperviseCheckReportById(string superviseCheckReportId)
 | |
|         {
 | |
|             return Funs.DB.Supervise_SuperviseCheckReport.FirstOrDefault(e => e.SuperviseCheckReportId == superviseCheckReportId);
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 添加安全监督检查报告
 | |
|         /// </summary>
 | |
|         /// <param name="superviseCheckReport"></param>
 | |
|         public static void AddSuperviseCheckReport(Model.Supervise_SuperviseCheckReport superviseCheckReport)
 | |
|         {
 | |
|             Model.Supervise_SuperviseCheckReport newSuperviseCheckReport = new Model.Supervise_SuperviseCheckReport
 | |
|             {
 | |
|                 SuperviseCheckReportId = superviseCheckReport.SuperviseCheckReportId,
 | |
|                 SuperviseCheckReportCode = superviseCheckReport.SuperviseCheckReportCode,
 | |
|                 CheckDate = superviseCheckReport.CheckDate,
 | |
|                 ProjectId = superviseCheckReport.ProjectId,
 | |
|                 UnitId = superviseCheckReport.UnitId,
 | |
|                 CheckTeam = superviseCheckReport.CheckTeam,
 | |
|                 EvaluationResult = superviseCheckReport.EvaluationResult,
 | |
|                 CheckUnitId = superviseCheckReport.CheckUnitId,
 | |
|                 CheckMainType = superviseCheckReport.CheckMainType,
 | |
|                 CheckType = superviseCheckReport.CheckType,
 | |
|                 AttachUrl = superviseCheckReport.AttachUrl,
 | |
|                 IsIssued = superviseCheckReport.IsIssued
 | |
|             };
 | |
|             Funs.DB.Supervise_SuperviseCheckReport.InsertOnSubmit(newSuperviseCheckReport);
 | |
|             Funs.DB.SubmitChanges();
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 修改安全监督检查报告
 | |
|         /// </summary>
 | |
|         /// <param name="superviseCheckReport"></param>
 | |
|         public static void UpdateSuperviseCheckReport(Model.Supervise_SuperviseCheckReport superviseCheckReport)
 | |
|         {
 | |
|             Model.Supervise_SuperviseCheckReport newSuperviseCheckReport = Funs.DB.Supervise_SuperviseCheckReport.FirstOrDefault(e => e.SuperviseCheckReportId == superviseCheckReport.SuperviseCheckReportId);
 | |
|             if (newSuperviseCheckReport != null)
 | |
|             {
 | |
|                 newSuperviseCheckReport.SuperviseCheckReportCode = superviseCheckReport.SuperviseCheckReportCode;
 | |
|                 newSuperviseCheckReport.CheckDate = superviseCheckReport.CheckDate;
 | |
|                 newSuperviseCheckReport.ProjectId = superviseCheckReport.ProjectId;
 | |
|                 newSuperviseCheckReport.UnitId = superviseCheckReport.UnitId;
 | |
|                 newSuperviseCheckReport.CheckTeam = superviseCheckReport.CheckTeam;
 | |
|                 newSuperviseCheckReport.EvaluationResult = superviseCheckReport.EvaluationResult;
 | |
|                 newSuperviseCheckReport.CheckUnitId = superviseCheckReport.CheckUnitId;
 | |
|                 newSuperviseCheckReport.CheckMainType = superviseCheckReport.CheckMainType;
 | |
|                 newSuperviseCheckReport.CheckType = superviseCheckReport.CheckType;
 | |
|                 newSuperviseCheckReport.AttachUrl = superviseCheckReport.AttachUrl;
 | |
|                 newSuperviseCheckReport.IsIssued = superviseCheckReport.IsIssued;
 | |
|                 newSuperviseCheckReport.IsUpdate = null;
 | |
|                 Funs.DB.SubmitChanges();
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 根据主键删除安全监督检查报告
 | |
|         /// </summary>
 | |
|         /// <param name="superviseCheckReportId"></param>
 | |
|         public static void DeleteSuperviseCheckReportById(string superviseCheckReportId)
 | |
|         {
 | |
|             Model.Supervise_SuperviseCheckReport superviseCheckReport = Funs.DB.Supervise_SuperviseCheckReport.FirstOrDefault(e => e.SuperviseCheckReportId == superviseCheckReportId);
 | |
|             if (superviseCheckReport != null)
 | |
|             {
 | |
|                 if (!string.IsNullOrEmpty(superviseCheckReport.AttachUrl))
 | |
|                 {
 | |
|                     BLL.UploadFileService.DeleteFile(Funs.RootPath, superviseCheckReport.AttachUrl);//删除附件
 | |
|                 }
 | |
|                 Funs.DB.Supervise_SuperviseCheckReport.DeleteOnSubmit(superviseCheckReport);
 | |
|                 Funs.DB.SubmitChanges();
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| }
 |