STA.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows.Forms;
  8. using Newtonsoft.Json.Linq;
  9. using PTMedicalInsurance.Common;
  10. using PTMedicalInsurance.Forms;
  11. using PTMedicalInsurance.Forms.ToPutOnRecord;
  12. using PTMedicalInsurance.Helper;
  13. using PTMedicalInsurance.Variables;
  14. namespace PTMedicalInsurance.Business
  15. {
  16. class STA
  17. {
  18. //设置业务实例
  19. CenterBusiness cBus = new CenterBusiness();
  20. HisMainBusiness hBus = new HisMainBusiness();
  21. HisIrisServices hIS = new HisIrisServices();
  22. MIIrisServices mIS = new MIIrisServices();
  23. InvokeHelper invoker = new InvokeHelper();
  24. public delegate void callBack(string errMsg);
  25. public void CallBack(string errMsg)
  26. {
  27. MessageBox.Show(errMsg);
  28. }
  29. [STAThread]
  30. public void PrescribeCirculation(object o)
  31. {
  32. try
  33. {
  34. //显示处方上传
  35. PrescriptionCirculation PresCir = new PrescriptionCirculation("");
  36. //PresCir.WindowState = FormWindowState.Minimized;
  37. PresCir.ShowDialog();
  38. }
  39. catch (Exception ex)
  40. {
  41. CallBack(ex.Message);
  42. }
  43. }
  44. [STAThread]
  45. public void ToPutOnRecord(object o)
  46. {
  47. try
  48. {
  49. //显示处方上传
  50. ToPutOnRecord frm = new ToPutOnRecord();
  51. frm.ShowDialog();
  52. }
  53. catch (Exception ex)
  54. {
  55. CallBack(ex.Message);
  56. }
  57. }
  58. [STAThread]
  59. public void Test(object o)
  60. {
  61. try
  62. {
  63. //显示处方上传
  64. Forms.Clearings.MainForm frm = new Forms.Clearings.MainForm();
  65. frm.ShowDialog();
  66. }
  67. catch (Exception ex)
  68. {
  69. CallBack(ex.Message);
  70. }
  71. }
  72. [STAThread]
  73. public void CenterQuery(object o)
  74. {
  75. try
  76. {
  77. //显示异常处理界面
  78. CenterQuery frm = new CenterQuery();
  79. frm.WindowState = FormWindowState.Maximized;
  80. frm.ShowDialog();
  81. }
  82. catch (Exception ex)
  83. {
  84. CallBack(ex.Message);
  85. }
  86. }
  87. }
  88. public class WindowWrapper : System.Windows.Forms.IWin32Window
  89. {
  90. public WindowWrapper(IntPtr handle)
  91. {
  92. _hwnd = handle;
  93. }
  94. public IntPtr Handle
  95. {
  96. get { return _hwnd; }
  97. }
  98. private IntPtr _hwnd;
  99. }
  100. }