0813
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
/// <summary>
|
||||
/// 主题党日活动
|
||||
/// </summary>
|
||||
public class ThemePartyDayService
|
||||
{
|
||||
/// <summary>
|
||||
/// 根据主键获取主题党日活动
|
||||
/// </summary>
|
||||
/// <param name="themePartyDayId"></param>
|
||||
/// <returns></returns>
|
||||
public static Model.Party_ThemePartyDay GetThemePartyDayById(string themePartyDayId)
|
||||
{
|
||||
return Funs.DB.Party_ThemePartyDay.FirstOrDefault(e => e.ThemePartyDayId == themePartyDayId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加主题党日活动
|
||||
/// </summary>
|
||||
/// <param name="themePartyDay"></param>
|
||||
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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改主题党日活动
|
||||
/// </summary>
|
||||
/// <param name="themePartyDay"></param>
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键删除主题党日活动
|
||||
/// </summary>
|
||||
/// <param name="themePartyDayId"></param>
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user