STA.cs 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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.Helper;
  12. using PTMedicalInsurance.Variables;
  13. namespace PTMedicalInsurance.Business
  14. {
  15. class STA
  16. {
  17. //设置业务实例
  18. CenterBusiness cBus = new CenterBusiness();
  19. HisMainBusiness hBus = new HisMainBusiness();
  20. HisIrisServices hIS = new HisIrisServices();
  21. MIIrisServices mIS = new MIIrisServices();
  22. InvokeHelper invoker = new InvokeHelper();
  23. public delegate void callBack(string errMsg);
  24. public void CallBack(string errMsg)
  25. {
  26. MessageBox.Show(errMsg);
  27. }
  28. [STAThread]
  29. public void PrintSettlementList(object o)
  30. {
  31. try
  32. {
  33. SettlementChecklist frmSettlList;
  34. JObject joInParam = (JObject)o;
  35. string insuAdmObj = JsonHelper.getDestValue(joInParam, "insuAdmObj");
  36. if (insuAdmObj == "")
  37. {
  38. frmSettlList = new SettlementChecklist();
  39. tools.ShowAppDiaglog(frmSettlList);
  40. }
  41. else
  42. {
  43. JObject joInsuAdmObj = JObject.Parse(insuAdmObj);
  44. frmSettlList = new SettlementChecklist(joInsuAdmObj);
  45. string groupID = JsonHelper.getDestValue((JObject)Global.curEvt.jaSession[0], "groupID");
  46. DataTable dt = (DataTable)frmSettlList.dgvSettlRecord.DataSource;
  47. frmSettlList.btnPrint_Click(null, null);
  48. }
  49. }
  50. catch (Exception ex)
  51. {
  52. CallBack(ex.Message);
  53. }
  54. }
  55. //[STAThread]
  56. //public void Test(object o)
  57. //{
  58. // try
  59. // {
  60. // //对账清分
  61. // PTMedicalInsurance.Forms.BasicDatas.BasicData frm = new PTMedicalInsurance.Forms.BasicDatas.BasicData();
  62. // frm.WindowState = FormWindowState.Maximized;
  63. // frm.ShowDialog();
  64. // }
  65. // catch (Exception ex)
  66. // {
  67. // CallBack(ex.Message);
  68. // }
  69. //}
  70. }
  71. public class WindowWrapper : System.Windows.Forms.IWin32Window
  72. {
  73. public WindowWrapper(IntPtr handle)
  74. {
  75. _hwnd = handle;
  76. }
  77. public IntPtr Handle
  78. {
  79. get { return _hwnd; }
  80. }
  81. private IntPtr _hwnd;
  82. }
  83. }