InvokeOcxCenter.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. using Newtonsoft.Json.Linq;
  2. using PTMedicalInsurance.Variables;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows.Forms;
  9. namespace PTMedicalInsurance.Helper
  10. {
  11. class InvokeOcxCenter : IInvokeCenter
  12. {
  13. public int Business(string inputData, ref string outputData, ref string pErrMsg)
  14. {
  15. pErrMsg = "";
  16. outputData = "";
  17. JObject joRtn = new JObject();
  18. try
  19. {
  20. try
  21. {
  22. //chsinterfaceyn.chsdllClass InterfaceBase_Yn1 = new chsinterfaceyn.chsdllClass();
  23. //InterfaceBase_Yn1.SetDir(IntPath);
  24. }
  25. catch (Exception ex)
  26. {
  27. pErrMsg = "invokeInitByDLL.SetDir 异常:" + ex.Message;
  28. MessageBox.Show(pErrMsg);
  29. }
  30. finally
  31. {
  32. //Global.writeLog("invokeInitByDLL.SetDir设置医保动态库目录(" + IntPath + ")", "", pErrMsg);
  33. }
  34. inputData = inputData.Replace("\n", "").Replace("\t", "").Replace("\r", "");
  35. //chsinterfaceyn.chsdllClass InterfaceBase_Yn = new chsinterfaceyn.chsdllClass();
  36. //调用业务函数
  37. //string pRtn =InterfaceBase_Yn.BusinessHandleW(fixmedins_code, infosyscode, infosyssign, inputData);
  38. //string pRtn = InterfaceBase_Yn.UploadFile(fixmedins_code, infosyscode, infosyssign, Global.inf.fileName,inputData);
  39. //joRtn = JObject.Parse(pRtn);
  40. if (joRtn["infcode"].ToString() != "0")
  41. {
  42. pErrMsg = joRtn["err_msg"].ToString();
  43. //outputData = pRtn;
  44. return -1;
  45. }
  46. else
  47. {
  48. //outputData = pRtn;
  49. return 0;
  50. }
  51. }
  52. catch (Exception ex)
  53. {
  54. pErrMsg = "invokeInitByDLL.BusinessHandle 异常:" + ex.Message;
  55. return -1;
  56. }
  57. finally
  58. {
  59. Global.writeLog("invokeInitByDLL.BusinessHandle医保动态库通用业务函数", inputData, outputData);
  60. }
  61. }
  62. public int BusinessExt(string inputData, ref string outputData, ref string pErrMsg)
  63. {
  64. throw new NotImplementedException();
  65. }
  66. public int DownloadFile(string inputData, ref string outputData)
  67. {
  68. throw new NotImplementedException();
  69. }
  70. public int Init(ref string pErrMsg)
  71. {
  72. pErrMsg = "";
  73. JObject joRtn = new JObject();
  74. try
  75. {
  76. //chsinterfaceyn.chsdllClass InterfaceBase_Yn = new chsinterfaceyn.chsdllClass();
  77. //string pRtn = InterfaceBase_Yn.Init(fixmedins_code, infosyscode, infosyssign, url);
  78. //joRtn = JObject.Parse(pRtn);
  79. if (joRtn["infcode"].ToString() != "0")
  80. {
  81. pErrMsg = joRtn["err_msg"].ToString();
  82. return -1;
  83. }
  84. else
  85. {
  86. return 0;
  87. }
  88. }
  89. catch (Exception ex)
  90. {
  91. pErrMsg = "invokeInitByDLL.Init 异常:" + ex.Message;
  92. return -1;
  93. }
  94. finally
  95. {
  96. Global.writeLog("invokeInitByDLL.Init医保动态库初始化(" + ")", "", pErrMsg);
  97. }
  98. }
  99. public int UploadFile(string inputData, ref string outputData, ref string pErrMsg)
  100. {
  101. throw new NotImplementedException();
  102. }
  103. }
  104. }