71 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			71 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			C#
		
	
	
	
|  | using System; | |||
|  | using System.Collections.Generic; | |||
|  | using System.Linq; | |||
|  | using System.Text; | |||
|  | using System.Threading.Tasks; | |||
|  | 
 | |||
|  | namespace BLL | |||
|  | { | |||
|  |     public static class ReportRemindService | |||
|  |     { | |||
|  |         /// <summary> | |||
|  |         /// 根据月份获取报告信息 | |||
|  |         /// </summary> | |||
|  |         /// <param name="monthReportId"></param> | |||
|  |         /// <returns></returns> | |||
|  |         public static Model.ManagementReport_ReportRemind GetReportRemindByReportRemindId(string reportRemindId) | |||
|  |         { | |||
|  |             return (from x in Funs.DB.ManagementReport_ReportRemind where x.ReportRemindId == reportRemindId select x).FirstOrDefault(); | |||
|  |         } | |||
|  | 
 | |||
|  |         /// <summary> | |||
|  |         /// 添加报表上报情况 | |||
|  |         /// </summary> | |||
|  |         /// <param name="reportRemind"></param> | |||
|  |         public static void AddReportRemind(Model.ManagementReport_ReportRemind reportRemind) | |||
|  |         { | |||
|  |             Model.ManagementReport_ReportRemind newReportRemind = new Model.ManagementReport_ReportRemind | |||
|  |             { | |||
|  |                 ReportRemindId = SQLHelper.GetNewID(typeof(Model.ManagementReport_ReportRemind)), | |||
|  |                 ProjectId = reportRemind.ProjectId, | |||
|  |                 Months = reportRemind.Months, | |||
|  |                 Year = reportRemind.Year, | |||
|  |                 Month = reportRemind.Month, | |||
|  |                 Quarterly = reportRemind.Quarterly, | |||
|  |                 HalfYear = reportRemind.HalfYear, | |||
|  |                 ReportName = reportRemind.ReportName, | |||
|  |                 CompileDate = reportRemind.CompileDate | |||
|  |             }; | |||
|  |             Funs.DB.ManagementReport_ReportRemind.InsertOnSubmit(newReportRemind); | |||
|  |             Funs.DB.SubmitChanges(); | |||
|  |         } | |||
|  | 
 | |||
|  |         /// <summary> | |||
|  |         /// 根据月报Id删除报表上报情况 | |||
|  |         /// </summary> | |||
|  |         /// <param name="monthReportId"></param> | |||
|  |         public static void DeleteReportRemindByReportRemind(Model.ManagementReport_ReportRemind reportRemind) | |||
|  |         { | |||
|  |             if (reportRemind != null) | |||
|  |             { | |||
|  |                 Funs.DB.ManagementReport_ReportRemind.DeleteOnSubmit(reportRemind); | |||
|  |                 Funs.DB.SubmitChanges(); | |||
|  |             } | |||
|  |         } | |||
|  | 
 | |||
|  |         /// <summary> | |||
|  |         /// 根据项目Id删除报表上报情况 | |||
|  |         /// </summary> | |||
|  |         /// <param name="monthReportId"></param> | |||
|  |         public static void DeleteReportRemindByProjectId(string projectId) | |||
|  |         { | |||
|  |             var report = from x in Funs.DB.ManagementReport_ReportRemind where x.ProjectId == projectId select x; | |||
|  |             if (report.Count() > 0) | |||
|  |             { | |||
|  |                 Funs.DB.ManagementReport_ReportRemind.DeleteAllOnSubmit(report); | |||
|  |                 Funs.DB.SubmitChanges(); | |||
|  |             } | |||
|  |         } | |||
|  |     } | |||
|  | } |