using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
///
/// 主题党日活动
///
public class ThemePartyDayService
{
///
/// 根据主键获取主题党日活动
///
///
///
public static Model.Party_ThemePartyDay GetThemePartyDayById(string themePartyDayId)
{
return Funs.DB.Party_ThemePartyDay.FirstOrDefault(e => e.ThemePartyDayId == themePartyDayId);
}
///
/// 添加主题党日活动
///
///
public static void AddThemePartyDay(Model.Party_ThemePartyDay themePartyDay)
{
Model.Party_ThemePartyDay newThemePartyDay = new Model.Party_ThemePartyDay
{
ThemePartyDayId = themePartyDay.ThemePartyDayId,
Year = themePartyDay.Year,
ConveneDate = themePartyDay.ConveneDate,
Theme = themePartyDay.Theme,
CompileMan = themePartyDay.CompileMan,
CompileDate = themePartyDay.CompileDate
};
Funs.DB.Party_ThemePartyDay.InsertOnSubmit(newThemePartyDay);
Funs.DB.SubmitChanges();
}
///
/// 修改主题党日活动
///
///
public static void UpdateThemePartyDay(Model.Party_ThemePartyDay themePartyDay)
{
Model.Party_ThemePartyDay newThemePartyDay = Funs.DB.Party_ThemePartyDay.FirstOrDefault(e => e.ThemePartyDayId == themePartyDay.ThemePartyDayId);
if (newThemePartyDay != null)
{
newThemePartyDay.ConveneDate = themePartyDay.ConveneDate;
newThemePartyDay.Theme = themePartyDay.Theme;
Funs.DB.SubmitChanges();
}
}
///
/// 根据主键删除主题党日活动
///
///
public static void DeleteThemePartyDayById(string themePartyDayId)
{
Model.Party_ThemePartyDay themePartyDay = Funs.DB.Party_ThemePartyDay.FirstOrDefault(e => e.ThemePartyDayId == themePartyDayId);
if (themePartyDay != null)
{
CommonService.DeleteAttachFileById(themePartyDayId);
Funs.DB.Party_ThemePartyDay.DeleteOnSubmit(themePartyDay);
Funs.DB.SubmitChanges();
}
}
}
}