InvokeOcxCenter.cs 3.7 KB

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