AlarmHelper.cs 711 B

123456789101112131415161718192021222324
  1. using ProjectBase.Data.Logs;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace SIMDP.Device
  8. {
  9. public class AlarmHelper
  10. {
  11. public static void LogAndNotice(string title, int type, string content)
  12. {
  13. if (type == 3)
  14. LogHelper.log.Error($"{title}:{content}");
  15. else if (type == 2)
  16. LogHelper.log.Warn($"{title}:{content}");
  17. else if (type == 1)
  18. LogHelper.log.Info($"{title}:{content}");
  19. ProjectBase.Data.BaseDAL.BLLFactory<BLL.BlSystemNotice>.Instance.PublishSysMessage(title, type, content);
  20. }
  21. }
  22. }