70 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			70 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			C#
		
	
	
	
| 
								 | 
							
								using System;
							 | 
						|||
| 
								 | 
							
								using System.Collections.Generic;
							 | 
						|||
| 
								 | 
							
								using System.Linq;
							 | 
						|||
| 
								 | 
							
								using System.Text;
							 | 
						|||
| 
								 | 
							
								using System.Threading.Tasks;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								namespace BLL
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    /// <summary>
							 | 
						|||
| 
								 | 
							
								    /// 本年度党建工作计划
							 | 
						|||
| 
								 | 
							
								    /// </summary>
							 | 
						|||
| 
								 | 
							
								    public class WorkPlanService
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 根据主键获取本年度党建工作计划
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="workPlanId"></param>
							 | 
						|||
| 
								 | 
							
								        /// <returns></returns>
							 | 
						|||
| 
								 | 
							
								        public static Model.Party_WorkPlan GetWorkPlanById(string workPlanId)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            return Funs.DB.Party_WorkPlan.FirstOrDefault(e => e.WorkPlanId == workPlanId);
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 添加本年度党建工作计划
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="workPlan"></param>
							 | 
						|||
| 
								 | 
							
								        public static void AddWorkPlan(Model.Party_WorkPlan workPlan)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            Model.Party_WorkPlan newWorkPlan = new Model.Party_WorkPlan
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                WorkPlanId = workPlan.WorkPlanId,
							 | 
						|||
| 
								 | 
							
								                Year = workPlan.Year,
							 | 
						|||
| 
								 | 
							
								                CompileMan = workPlan.CompileMan,
							 | 
						|||
| 
								 | 
							
								                CompileDate = workPlan.CompileDate
							 | 
						|||
| 
								 | 
							
								            };
							 | 
						|||
| 
								 | 
							
								            Funs.DB.Party_WorkPlan.InsertOnSubmit(newWorkPlan);
							 | 
						|||
| 
								 | 
							
								            Funs.DB.SubmitChanges();
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 修改本年度党建工作计划
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="workPlan"></param>
							 | 
						|||
| 
								 | 
							
								        public static void UpdateWorkPlan(Model.Party_WorkPlan workPlan)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            Model.Party_WorkPlan newWorkPlan = Funs.DB.Party_WorkPlan.FirstOrDefault(e => e.WorkPlanId == workPlan.WorkPlanId);
							 | 
						|||
| 
								 | 
							
								            if (newWorkPlan != null)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                Funs.DB.SubmitChanges();
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 根据主键删除本年度党建工作计划
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="workPlanId"></param>
							 | 
						|||
| 
								 | 
							
								        public static void DeleteWorkPlanById(string workPlanId)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            Model.Party_WorkPlan workPlan = Funs.DB.Party_WorkPlan.FirstOrDefault(e => e.WorkPlanId == workPlanId);
							 | 
						|||
| 
								 | 
							
								            if (workPlan != null)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                CommonService.DeleteAttachFileById(workPlanId);
							 | 
						|||
| 
								 | 
							
								                Funs.DB.Party_WorkPlan.DeleteOnSubmit(workPlan);
							 | 
						|||
| 
								 | 
							
								                Funs.DB.SubmitChanges();
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |