InvokeOcxCenter.cs 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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 BusinessPresc(string inputData, ref string outputData, ref string pErrMsg)
  63. {
  64. pErrMsg = "";
  65. outputData = "";
  66. JObject joRtn = new JObject();
  67. try
  68. {
  69. try
  70. {
  71. //chsinterfaceyn.chsdllClass InterfaceBase_Yn1 = new chsinterfaceyn.chsdllClass();
  72. //InterfaceBase_Yn1.SetDir(IntPath);
  73. }
  74. catch (Exception ex)
  75. {
  76. pErrMsg = "invokeInitByDLL.SetDir 异常:" + ex.Message;
  77. MessageBox.Show(pErrMsg);
  78. }
  79. finally
  80. {
  81. //Global.writeLog("invokeInitByDLL.SetDir设置医保动态库目录(" + IntPath + ")", "", pErrMsg);
  82. }
  83. inputData = inputData.Replace("\n", "").Replace("\t", "").Replace("\r", "");
  84. //chsinterfaceyn.chsdllClass InterfaceBase_Yn = new chsinterfaceyn.chsdllClass();
  85. //调用业务函数
  86. //string pRtn =InterfaceBase_Yn.BusinessHandleW(fixmedins_code, infosyscode, infosyssign, inputData);
  87. //string pRtn = InterfaceBase_Yn.UploadFile(fixmedins_code, infosyscode, infosyssign, Global.inf.fileName,inputData);
  88. //joRtn = JObject.Parse(pRtn);
  89. if (joRtn["infcode"].ToString() != "0")
  90. {
  91. pErrMsg = joRtn["err_msg"].ToString();
  92. //outputData = pRtn;
  93. return -1;
  94. }
  95. else
  96. {
  97. //outputData = pRtn;
  98. return 0;
  99. }
  100. }
  101. catch (Exception ex)
  102. {
  103. pErrMsg = "invokeInitByDLL.BusinessHandle 异常:" + ex.Message;
  104. return -1;
  105. }
  106. finally
  107. {
  108. Global.writeLog("invokeInitByDLL.BusinessHandle医保动态库通用业务函数", inputData, outputData);
  109. }
  110. }
  111. public int BusinessExt(string inputData, ref string outputData, ref string pErrMsg)
  112. {
  113. throw new NotImplementedException();
  114. }
  115. public int DownloadFile(string inputData, ref string outputData)
  116. {
  117. throw new NotImplementedException();
  118. }
  119. public int Init(ref string pErrMsg)
  120. {
  121. pErrMsg = "";
  122. JObject joRtn = new JObject();
  123. try
  124. {
  125. //chsinterfaceyn.chsdllClass InterfaceBase_Yn = new chsinterfaceyn.chsdllClass();
  126. //string pRtn = InterfaceBase_Yn.Init(fixmedins_code, infosyscode, infosyssign, url);
  127. //joRtn = JObject.Parse(pRtn);
  128. if (joRtn["infcode"].ToString() != "0")
  129. {
  130. pErrMsg = joRtn["err_msg"].ToString();
  131. return -1;
  132. }
  133. else
  134. {
  135. return 0;
  136. }
  137. }
  138. catch (Exception ex)
  139. {
  140. pErrMsg = "invokeInitByDLL.Init 异常:" + ex.Message;
  141. return -1;
  142. }
  143. finally
  144. {
  145. Global.writeLog("invokeInitByDLL.Init医保动态库初始化(" + ")", "", pErrMsg);
  146. }
  147. }
  148. public int UploadFile(string inputData, ref string outputData, ref string pErrMsg)
  149. {
  150. throw new NotImplementedException();
  151. }
  152. }
  153. }