예제 #1
0
 /// <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;
 }
예제 #2
0
        /// <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);
        }
예제 #3
0
 /// <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);
 }
예제 #4
0
        /// <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);
            }
        }
예제 #5
0
        /// <summary>
        /// 获取全部的Smtp设置
        /// </summary>
        /// <param name="service"></param>
        /// <returns></returns>
        public static IEnumerable <SmtpSettings> GetAll(this EmailService service)
        {
            ISmtpSettingsRepository smtpSettingsRepository = new SmtpSettingsRepository();

            return(smtpSettingsRepository.GetAll());
        }
예제 #6
0
        /// <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));
        }
예제 #7
0
        /// <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));
        }
예제 #8
0
 /// <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);
 }
예제 #9
0
 /// <summary>
 /// 获取全部的Smtp设置
 /// </summary>
 /// <param name="service"></param>
 /// <returns></returns>
 public static IEnumerable<SmtpSettings> GetAll(this EmailService service)
 {
     ISmtpSettingsRepository smtpSettingsRepository = new SmtpSettingsRepository();
     return smtpSettingsRepository.GetAll();
 }
예제 #10
0
 /// <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);
 }