74 lines
2.4 KiB
C#
74 lines
2.4 KiB
C#
using Model;
|
|
using System.Linq;
|
|
|
|
namespace BLL
|
|
{
|
|
public static class Email_PopService
|
|
{
|
|
#region 获取邮件设置
|
|
/// <summary>
|
|
/// 获取邮件设置
|
|
/// </summary>
|
|
/// <param name="EmailID">邮件设置Id</param>
|
|
/// <returns></returns>
|
|
public static Email_Pop GetEmail_Pop(string EmailID)
|
|
{
|
|
return Funs.DB.Email_Pop.FirstOrDefault(x => x.EmailID == EmailID);
|
|
}
|
|
#endregion
|
|
|
|
#region 邮件管理
|
|
/// <summary>
|
|
/// 邮件设置
|
|
/// </summary>
|
|
/// <param name="eProject"></param>
|
|
public static void AddEmail_Pop(Email_Pop email_Pop)
|
|
{
|
|
Email_Pop pf = Funs.DB.Email_Pop.FirstOrDefault(e => e.EmailID == email_Pop.EmailID);
|
|
if (pf == null)
|
|
{
|
|
pf = new Email_Pop();
|
|
pf.EmailID = email_Pop.EmailID;
|
|
pf.EmailFwq = email_Pop.EmailFwq;
|
|
pf.EmailDk = email_Pop.EmailDk;
|
|
pf.EmailYx = email_Pop.EmailYx;
|
|
pf.EmailUsername = email_Pop.EmailUsername;
|
|
pf.EmailPass = email_Pop.EmailPass;
|
|
pf.CreateTime = email_Pop.CreateTime;
|
|
pf.CreateName = email_Pop.CreateName;
|
|
pf.CreateUserId = email_Pop.CreateUserId;
|
|
pf.UpdateTime = email_Pop.UpdateTime;
|
|
pf.UpdateName = email_Pop.UpdateName;
|
|
pf.UpdateUserId = email_Pop.UpdateUserId;
|
|
|
|
Funs.DB.Email_Pop.InsertOnSubmit(pf);
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 修改
|
|
/// <summary>
|
|
/// 修改
|
|
/// </summary>
|
|
/// <param name="email_Params"></param>
|
|
public static void UpdateEmail_Pop(Email_Pop email_Pop)
|
|
{
|
|
Email_Pop pf = Funs.DB.Email_Pop.FirstOrDefault(e => e.EmailID == email_Pop.EmailID);
|
|
|
|
pf.EmailID = email_Pop.EmailID;
|
|
pf.EmailFwq = email_Pop.EmailFwq;
|
|
pf.EmailDk = email_Pop.EmailDk;
|
|
pf.EmailYx = email_Pop.EmailYx;
|
|
pf.EmailUsername = email_Pop.EmailUsername;
|
|
pf.EmailPass = email_Pop.EmailPass;
|
|
pf.UpdateTime = email_Pop.UpdateTime;
|
|
pf.UpdateName = email_Pop.UpdateName;
|
|
pf.UpdateUserId = email_Pop.UpdateUserId;
|
|
|
|
Funs.DB.SubmitChanges();
|
|
}
|
|
#endregion
|
|
}
|
|
}
|