/// <summary> /// 重新加载全部的Smtp设置 /// </summary> /// <returns></returns> public static IEnumerable<SmtpSettings> ReLoadSmtpSettings(this EmailService service) { ISmtpSettingsRepository smtpSettingsRepository = new SmtpSettingsRepository(); IEnumerable<SmtpSettings> smtpSettings = smtpSettingsRepository.GetAll(); EmailService.AllSmtpSettings = smtpSettings == null ? new List<SmtpSettings>() : smtpSettings.Select(n => new SmtpSettingsChild(n) as SmtpSettings).ToList(); return EmailService.AllSmtpSettings; }
/// <summary> /// 重新加载全部的Smtp设置 /// </summary> /// <returns></returns> public static IEnumerable <SmtpSettings> ReLoadSmtpSettings(this EmailService service) { ISmtpSettingsRepository smtpSettingsRepository = new SmtpSettingsRepository(); IEnumerable <SmtpSettings> smtpSettings = smtpSettingsRepository.GetAll(); EmailService.AllSmtpSettings = smtpSettings == null ? new List <SmtpSettings>() : smtpSettings.Select(n => new SmtpSettingsChild(n) as SmtpSettings).ToList(); return(EmailService.AllSmtpSettings); }
/// <summary> /// 保存 /// </summary> /// <param name="smtpSettings"></param> public static void SaveSmtpSetting(this EmailService service, SmtpSettings smtpSettings) { ISmtpSettingsRepository smtpSettingsRepository = new SmtpSettingsRepository(); if (smtpSettings.Id > 0) smtpSettingsRepository.Update(smtpSettings); else smtpSettingsRepository.Insert(smtpSettings); }
/// <summary> /// 保存 /// </summary> /// <param name="smtpSettings"></param> public static void SaveSmtpSetting(this EmailService service, SmtpSettings smtpSettings) { ISmtpSettingsRepository smtpSettingsRepository = new SmtpSettingsRepository(); if (smtpSettings.Id > 0) { smtpSettingsRepository.Update(smtpSettings); } else { smtpSettingsRepository.Insert(smtpSettings); } }
/// <summary> /// 获取全部的Smtp设置 /// </summary> /// <param name="service"></param> /// <returns></returns> public static IEnumerable <SmtpSettings> GetAll(this EmailService service) { ISmtpSettingsRepository smtpSettingsRepository = new SmtpSettingsRepository(); return(smtpSettingsRepository.GetAll()); }
/// <summary> /// 删除一条Smtp设置 /// </summary> /// <param name="service"></param> /// <param name="id"></param> /// <returns></returns> public static int DeleteSmtpSettings(this EmailService service, long id) { ISmtpSettingsRepository smtpSettingsRepository = new SmtpSettingsRepository(); return(smtpSettingsRepository.DeleteByEntityId(id)); }
/// <summary> /// 获取单个的Smtp设置 /// </summary> /// <param name="service"></param> /// <param name="id"></param> /// <returns></returns> public static SmtpSettings GetSmtpSettings(this EmailService service, long id) { ISmtpSettingsRepository smtpSettingsRepository = new SmtpSettingsRepository(); return(smtpSettingsRepository.Get(id)); }
/// <summary> /// 获取单个的Smtp设置 /// </summary> /// <param name="service"></param> /// <param name="id"></param> /// <returns></returns> public static SmtpSettings GetSmtpSettings(this EmailService service, long id) { ISmtpSettingsRepository smtpSettingsRepository = new SmtpSettingsRepository(); return smtpSettingsRepository.Get(id); }
/// <summary> /// 获取全部的Smtp设置 /// </summary> /// <param name="service"></param> /// <returns></returns> public static IEnumerable<SmtpSettings> GetAll(this EmailService service) { ISmtpSettingsRepository smtpSettingsRepository = new SmtpSettingsRepository(); return smtpSettingsRepository.GetAll(); }
/// <summary> /// 删除一条Smtp设置 /// </summary> /// <param name="service"></param> /// <param name="id"></param> /// <returns></returns> public static int DeleteSmtpSettings(this EmailService service, long id) { ISmtpSettingsRepository smtpSettingsRepository = new SmtpSettingsRepository(); return smtpSettingsRepository.DeleteByEntityId(id); }