BlSystemNotice.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using ProjectBase.Data.BaseDAL;
  2. using ProjectBase.Data.Redis;
  3. using SIMDP.DAL.IDALSQL;
  4. using SIMDP.Model;
  5. using ProjectBase.Util;
  6. using System;
  7. using System.Collections.Generic;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. namespace SIMDP.BLL
  12. {
  13. public class BlSystemNotice : BaseBLL<MoSystemNotice>
  14. {
  15. private IDalSystemNotice dalSystemNotice;
  16. /// <summary>
  17. /// 构造函数
  18. /// </summary>
  19. public BlSystemNotice() : base()
  20. {
  21. base.Init(this.GetType().FullName, System.Reflection.Assembly.GetExecutingAssembly().GetName().Name);
  22. dalSystemNotice = baseDal as IDalSystemNotice;
  23. dalSystemNotice.OnOperationLog += new OperationLogEventHandler(BlLogOperation.OnOperationLog);
  24. }
  25. /// <summary>
  26. /// 发布系统消息
  27. /// </summary>
  28. /// <param name="title">标题</param>
  29. /// <param name="type">类别1:提示;2:警告;3:报警</param>
  30. /// <param name="content">内容</param>
  31. public void PublishSysMessage(string title, int type, string content)
  32. {
  33. string message = null;
  34. message = title + "|" + type + "|" + content + "|" + DateTime.Now.ToString() + "|" + "False";
  35. RedisHelper redis = new RedisHelper();
  36. redis.Publish(SysEnvironment.SystemMessage, message);
  37. }
  38. }
  39. }