74 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			74 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			C#
		
	
	
	
| using System;
 | |
| using System.Collections.Generic;
 | |
| using System.Linq;
 | |
| using System.Text;
 | |
| using System.Threading.Tasks;
 | |
| 
 | |
| namespace BLL
 | |
| {
 | |
|     /// <summary>
 | |
|     /// 支部党小组会
 | |
|     /// </summary>
 | |
|     public class PartyMeetingService
 | |
|     {
 | |
|         /// <summary>
 | |
|         /// 根据主键获取支部党小组会
 | |
|         /// </summary>
 | |
|         /// <param name="partyMeetingId"></param>
 | |
|         /// <returns></returns>
 | |
|         public static Model.Party_PartyMeeting GetPartyMeetingById(string partyMeetingId)
 | |
|         {
 | |
|             return Funs.DB.Party_PartyMeeting.FirstOrDefault(e => e.PartyMeetingId == partyMeetingId);
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 添加支部党小组会
 | |
|         /// </summary>
 | |
|         /// <param name="partyMeeting"></param>
 | |
|         public static void AddPartyMeeting(Model.Party_PartyMeeting partyMeeting)
 | |
|         {
 | |
|             Model.Party_PartyMeeting newPartyMeeting = new Model.Party_PartyMeeting
 | |
|             {
 | |
|                 PartyMeetingId = partyMeeting.PartyMeetingId,
 | |
|                 Year = partyMeeting.Year,
 | |
|                 Month = partyMeeting.Month,
 | |
|                 CompileMan = partyMeeting.CompileMan,
 | |
|                 CompileDate = partyMeeting.CompileDate
 | |
|             };
 | |
|             Funs.DB.Party_PartyMeeting.InsertOnSubmit(newPartyMeeting);
 | |
|             Funs.DB.SubmitChanges();
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 修改支部党小组会
 | |
|         /// </summary>
 | |
|         /// <param name="partyMeeting"></param>
 | |
|         public static void UpdatePartyMeeting(Model.Party_PartyMeeting partyMeeting)
 | |
|         {
 | |
|             Model.Party_PartyMeeting newPartyMeeting = Funs.DB.Party_PartyMeeting.FirstOrDefault(e => e.PartyMeetingId == partyMeeting.PartyMeetingId);
 | |
|             if (newPartyMeeting != null)
 | |
|             {
 | |
|                 newPartyMeeting.Month = partyMeeting.Month;
 | |
|                 Funs.DB.SubmitChanges();
 | |
|             }
 | |
|         }
 | |
| 
 | |
|         /// <summary>
 | |
|         /// 根据主键删除支部党小组会
 | |
|         /// </summary>
 | |
|         /// <param name="partyMeetingId"></param>
 | |
|         public static void DeletePartyMeetingById(string partyMeetingId)
 | |
|         {
 | |
|             Model.Party_PartyMeeting partyMeeting = Funs.DB.Party_PartyMeeting.FirstOrDefault(e => e.PartyMeetingId == partyMeetingId);
 | |
|             if (partyMeeting != null)
 | |
|             {
 | |
|                 CommonService.DeleteAttachFileById(partyMeetingId);
 | |
|                 CommonService.DeleteAttachFileById(partyMeetingId + "2");
 | |
|                 CommonService.DeleteAttachFileById(partyMeetingId + "3");
 | |
|                 Funs.DB.Party_PartyMeeting.DeleteOnSubmit(partyMeeting);
 | |
|                 Funs.DB.SubmitChanges();
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| }
 |