Global.cs 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /******************************************************************************
  2. * 文件名称: Global.cs
  3. * 文件说明: 全局变量及静态方法等
  4. * 当前版本: V1.0
  5. * 创建日期: 2022-06-20
  6. *
  7. * * 2020-06-20: 增加 Global 类
  8. * ***** 2020-06-20: 增加 CardReader 方法,获取URL地址,USER信息,地方版SSCard.dll使用
  9. ******************************************************************************/
  10. using System;
  11. using System.Collections.Generic;
  12. using System.Linq;
  13. using System.Text;
  14. using System.Threading.Tasks;
  15. using PTMedInsuInterface.Common;
  16. namespace PTMedInsuInterface.Variables
  17. {
  18. public static class Global
  19. {
  20. public static IrisConfigue hisConfig;
  21. public static IrisConfigue insuConfig;
  22. public static InterfaceInfo inf;
  23. public static DllInfo dll;
  24. public static Patients pat;
  25. public static currentEnvironment curEvt;
  26. public static User user;
  27. public static string businessType;
  28. public static Settlements settl;
  29. //写日志 二次封装
  30. public static void writeLog(string content)
  31. {
  32. string logDir = Global.curEvt.path + "\\Log", logName = DateTime.Now.ToString("yyyy-MM-dd") + "_Shell.Log";
  33. Log log = new Log(logDir, logName);
  34. string timeLine = "**********" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ffff") + "***********" + "\r\n";
  35. log.Write(timeLine + content);
  36. }
  37. public static void writeLog_debug(string content)
  38. {
  39. string logDir = Global.curEvt.path + "\\Log", logName = DateTime.Now.ToString("yyyy-MM-dd") + "_debug.Log";
  40. Log log = new Log(logDir, logName);
  41. string timeLine = "**********" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ffff") + "***********" + "\r\n";
  42. log.Write(timeLine + content);
  43. }
  44. public static void writeLog(string tradeName, string inParam, string outParam)
  45. {
  46. string logDir = Global.curEvt.path + "\\Log", logName = DateTime.Now.ToString("yyyy-MM-dd") + "_Shell.Log";
  47. Log log = new Log(logDir, logName);
  48. string content = "****************************交易开始(" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ffff") + ")****************************" + "\r\n";
  49. content = content + "交易名称:" + tradeName + "\r\n";
  50. content = content + "交易入参:" + "\t" + inParam + "\r\n";
  51. content = content + "交易出参:" + "\t" + outParam + "\r\n";
  52. //content = content + "****************************交易结束(" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss ffff") + ")****************************" + "\r\n";
  53. log.Write(content);
  54. }
  55. }
  56. }