You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

EmailBLL.cs 2.6 KiB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. 
  2. using Learun.Application.OA.Email.EmailSend;
  3. using Learun.Util;
  4. using System;
  5. using System.Collections.Generic;
  6. namespace Learun.Application.OA.Email
  7. {
  8. /// <summary>
  9. /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
  10. /// Copyright (c) 2013-2017
  11. /// 创建人:陈彬彬
  12. /// 日 期:2018.06.04
  13. /// 描 述:邮件管理
  14. /// </summary>
  15. public class EmailBLL:EmailIBLL
  16. {
  17. private EmailService emailService = new EmailService();
  18. private EmailSendService emailSendService = new EmailSendService();
  19. #region 获取数据
  20. /// <summary>
  21. /// 获取邮件
  22. /// </summary>
  23. /// <param name="keyValue">主键</param>
  24. /// <returns></returns>
  25. public List<MailModel> GetMail(MailAccount account, int receiveCount)
  26. {
  27. try
  28. {
  29. return MailHelper.Get(account,receiveCount);
  30. }
  31. catch (Exception ex)
  32. {
  33. if (ex is ExceptionEx)
  34. {
  35. throw;
  36. }
  37. else
  38. {
  39. throw ExceptionEx.ThrowBusinessException(ex);
  40. }
  41. }
  42. }
  43. /// <summary>
  44. /// 发送邮件
  45. /// </summary>
  46. /// <param name="account">邮箱账户</param>
  47. /// <param name="mailModel">邮箱类</param>
  48. /// <returns></returns>
  49. public void SendMail(MailAccount account, MailModel mailModel)
  50. {
  51. try
  52. {
  53. MailHelper.Send(account, mailModel);
  54. }
  55. catch (Exception ex)
  56. {
  57. if (ex is ExceptionEx)
  58. {
  59. throw;
  60. }
  61. else
  62. {
  63. throw ExceptionEx.ThrowBusinessException(ex);
  64. }
  65. }
  66. }
  67. /// <summary>
  68. /// 删除邮件
  69. /// </summary>
  70. /// <param name="account">邮箱账户</param>
  71. /// <param name="UID">UID</param>
  72. /// <returns></returns>
  73. public void DeleteMail(MailAccount account, string UID)
  74. {
  75. try
  76. {
  77. MailHelper.Delete(account, UID);
  78. }
  79. catch (Exception ex)
  80. {
  81. if (ex is ExceptionEx)
  82. {
  83. throw;
  84. }
  85. else
  86. {
  87. throw ExceptionEx.ThrowBusinessException(ex);
  88. }
  89. }
  90. }
  91. #endregion
  92. #region 提交数据
  93. #endregion
  94. }
  95. }