76 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			76 lines
		
	
	
		
			3.0 KiB
		
	
	
	
		
			C#
		
	
	
	
| 
								 | 
							
								using System;
							 | 
						|||
| 
								 | 
							
								using System.Collections.Generic;
							 | 
						|||
| 
								 | 
							
								using System.Linq;
							 | 
						|||
| 
								 | 
							
								using System.Text;
							 | 
						|||
| 
								 | 
							
								using System.Threading.Tasks;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								namespace BLL
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    /// <summary>
							 | 
						|||
| 
								 | 
							
								    /// 党史学习教育
							 | 
						|||
| 
								 | 
							
								    /// </summary>
							 | 
						|||
| 
								 | 
							
								    public class PartyHistoryStudyService
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 根据主键获取党史学习教育
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="partyHistoryStudyId"></param>
							 | 
						|||
| 
								 | 
							
								        /// <returns></returns>
							 | 
						|||
| 
								 | 
							
								        public static Model.Party_PartyHistoryStudy GetPartyHistoryStudyById(string partyHistoryStudyId)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            return Funs.DB.Party_PartyHistoryStudy.FirstOrDefault(e => e.PartyHistoryStudyId == partyHistoryStudyId);
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 添加党史学习教育
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="partyHistoryStudy"></param>
							 | 
						|||
| 
								 | 
							
								        public static void AddPartyHistoryStudy(Model.Party_PartyHistoryStudy partyHistoryStudy)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            Model.Party_PartyHistoryStudy newPartyHistoryStudy = new Model.Party_PartyHistoryStudy
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                PartyHistoryStudyId = partyHistoryStudy.PartyHistoryStudyId,
							 | 
						|||
| 
								 | 
							
								                Year = partyHistoryStudy.Year,
							 | 
						|||
| 
								 | 
							
								                StudyDate = partyHistoryStudy.StudyDate,
							 | 
						|||
| 
								 | 
							
								                Speaker = partyHistoryStudy.Speaker,
							 | 
						|||
| 
								 | 
							
								                Theme = partyHistoryStudy.Theme,
							 | 
						|||
| 
								 | 
							
								                CompileMan = partyHistoryStudy.CompileMan,
							 | 
						|||
| 
								 | 
							
								                CompileDate = partyHistoryStudy.CompileDate
							 | 
						|||
| 
								 | 
							
								            };
							 | 
						|||
| 
								 | 
							
								            Funs.DB.Party_PartyHistoryStudy.InsertOnSubmit(newPartyHistoryStudy);
							 | 
						|||
| 
								 | 
							
								            Funs.DB.SubmitChanges();
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 修改党史学习教育
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="partyHistoryStudy"></param>
							 | 
						|||
| 
								 | 
							
								        public static void UpdatePartyHistoryStudy(Model.Party_PartyHistoryStudy partyHistoryStudy)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            Model.Party_PartyHistoryStudy newPartyHistoryStudy = Funs.DB.Party_PartyHistoryStudy.FirstOrDefault(e => e.PartyHistoryStudyId == partyHistoryStudy.PartyHistoryStudyId);
							 | 
						|||
| 
								 | 
							
								            if (newPartyHistoryStudy != null)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                newPartyHistoryStudy.StudyDate = partyHistoryStudy.StudyDate;
							 | 
						|||
| 
								 | 
							
								                newPartyHistoryStudy.Speaker = partyHistoryStudy.Speaker;
							 | 
						|||
| 
								 | 
							
								                newPartyHistoryStudy.Theme = partyHistoryStudy.Theme;
							 | 
						|||
| 
								 | 
							
								                Funs.DB.SubmitChanges();
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 根据主键删除党史学习教育
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="partyHistoryStudyId"></param>
							 | 
						|||
| 
								 | 
							
								        public static void DeletePartyHistoryStudyById(string partyHistoryStudyId)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            Model.Party_PartyHistoryStudy partyHistoryStudy = Funs.DB.Party_PartyHistoryStudy.FirstOrDefault(e => e.PartyHistoryStudyId == partyHistoryStudyId);
							 | 
						|||
| 
								 | 
							
								            if (partyHistoryStudy != null)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                CommonService.DeleteAttachFileById(partyHistoryStudyId);
							 | 
						|||
| 
								 | 
							
								                Funs.DB.Party_PartyHistoryStudy.DeleteOnSubmit(partyHistoryStudy);
							 | 
						|||
| 
								 | 
							
								                Funs.DB.SubmitChanges();
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |