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.
 
 
 
 
 
 

103 lines
2.6 KiB

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