STA.cs 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Forms;
  7. using Newtonsoft.Json.Linq;
  8. using PTMedicalInsurance.Common;
  9. using PTMedicalInsurance.Forms;
  10. using PTMedicalInsurance.Helper;
  11. using PTMedicalInsurance.Variables;
  12. namespace PTMedicalInsurance.Business
  13. {
  14. class STA
  15. {
  16. //设置业务实例
  17. CenterBusiness cBus = new CenterBusiness();
  18. HisMainBusiness hBus = new HisMainBusiness();
  19. HisIrisServices hIS = new HisIrisServices();
  20. MIIrisServices mIS = new MIIrisServices();
  21. InvokeHelper invoker = new InvokeHelper();
  22. private XmlHelper xmler = new XmlHelper();
  23. public delegate void callBack(string errMsg);
  24. public void CallBack(string errMsg)
  25. {
  26. MessageBox.Show(errMsg);
  27. }
  28. [STAThread]
  29. public void Exception(object o)
  30. {
  31. try
  32. {
  33. //显示异常处理界面
  34. HandleException frmEX = new HandleException();
  35. frmEX.WindowState = FormWindowState.Maximized;
  36. frmEX.ShowDialog();
  37. }
  38. catch (Exception ex)
  39. {
  40. CallBack(ex.Message);
  41. }
  42. }
  43. [STAThread]
  44. public void CheckAndClearing(object o)
  45. {
  46. try
  47. {
  48. //显示对账界面
  49. Clearing frm = new Clearing();
  50. frm.WindowState = FormWindowState.Maximized;
  51. tools.ShowAppDiaglog(frm);
  52. }
  53. catch (Exception ex)
  54. {
  55. CallBack(ex.Message);
  56. }
  57. }
  58. [STAThread]
  59. public void BasicData(object o)
  60. {
  61. try
  62. {
  63. //显示异常处理界面
  64. BasicData frm = new BasicData();
  65. frm.WindowState = FormWindowState.Maximized;
  66. frm.ShowDialog();
  67. }
  68. catch (Exception ex)
  69. {
  70. CallBack(ex.Message);
  71. }
  72. }
  73. //[STAThread]
  74. //public void CenterQuery(object o)
  75. //{
  76. // try
  77. // {
  78. // //显示异常处理界面
  79. // CenterQuery frm = new CenterQuery();
  80. // frm.WindowState = FormWindowState.Maximized;
  81. // frm.ShowDialog();
  82. // }
  83. // catch (Exception ex)
  84. // {
  85. // CallBack(ex.Message);
  86. // }
  87. //}
  88. [STAThread]
  89. public void PrescribeCirculation(object o)
  90. {
  91. try
  92. {
  93. //显示处方上传
  94. PrescriptionCirculation PresCir = new PrescriptionCirculation("");
  95. //PresCir.WindowState = FormWindowState.Minimized;
  96. PresCir.ShowDialog();
  97. //if (PresCir.ShowDialog() != DialogResult.OK)
  98. //{
  99. // rtnResult = JsonHelper.setExceptionJson(-100, "", "已退出医保电子处方流转界面").ToString();
  100. // return rtnResult;
  101. //}
  102. }
  103. catch (Exception ex)
  104. {
  105. CallBack(ex.Message);
  106. }
  107. }
  108. }
  109. public class WindowWrapper : System.Windows.Forms.IWin32Window
  110. {
  111. public WindowWrapper(IntPtr handle)
  112. {
  113. _hwnd = handle;
  114. }
  115. public IntPtr Handle
  116. {
  117. get { return _hwnd; }
  118. }
  119. private IntPtr _hwnd;
  120. }
  121. }