123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using Newtonsoft.Json.Linq;
- using PTMedicalInsurance.Common;
- using PTMedicalInsurance.Entity;
- using PTMedicalInsurance.Forms;
- using PTMedicalInsurance.Helper;
- using PTMedicalInsurance.Variables;
- namespace PTMedicalInsurance.Business
- {
- class STA
- {
- //设置业务实例
- CenterBusiness cBus = new CenterBusiness();
- HisMainBusiness hBus = new HisMainBusiness();
- HisIrisServices hIS = new HisIrisServices();
- MIIrisServices mIS = new MIIrisServices();
- InvokeHelper invoker = new InvokeHelper();
- private XmlHelper xmler = new XmlHelper();
- public delegate void callBack(string errMsg);
- [STAThread]
- public void ReadCard(object o)
- {
- string outParam = "";
- ChooseCard cc = new ChooseCard();
- try
- {
- IntPtr hwnd = WinApi.GetWindowsHandle("prBrowser");
- if (cc.ShowDialog(new WindowWrapper(hwnd)) == DialogResult.OK)
- {
- Global.pat.card.ecBizType = cc.businessType;
- }
- else
- {
- ((object[])o)[0] = -1;
- ((object[])o)[1] = "收款员取消结算!";
- }
- InvokeComCenter carder = new InvokeComCenter();
- JObject joInput = new JObject();
- joInput.Add("akb020", "H65010200152");
- joInput.Add("psnNo", "111111");
- string input = joInput.ToString();
- if (carder.Business("1401", ref input, ref outParam) != 0)
- {
- ((object[])o)[0] = -1;
- ((object[])o)[1] = outParam;
- }
- else
- {
- Resp1101 info = JsonHelper.getOutput<Resp1101>(JObject.Parse(outParam));
- Global.pat.card.NO = info.data.cardNo;
- Global.pat.card.SN = info.data.cardSn;
- Global.pat.mdtrtcertType = info.data.mdtrtCertType;
- Global.pat.mdtrtcertNO = info.data.mdtrtCertNo;
- Global.pat.certNO = info.data.certNo;
- Global.pat.certType = info.data.psnCertType;
- Global.pat.name = info.data.psnName;
- Global.pat.insuplc_admdvs = info.data.insuplcAdmdvs;
- ((object[])o)[0] = 0;
- ((object[])o)[1] = outParam;
- }
- }
- catch (Exception ex)
- {
- outParam = JsonHelper.setIrisReturnValue(-1, "门诊结算异常:" + ex.Message, null).ToString();
- ((object[])o)[0] = -1;
- ((object[])o)[1] = outParam;
- }
- }
- public void CallBack(string errMsg)
- {
- MessageBox.Show(errMsg);
- }
- [STAThread]
- public void Exception(object o)
- {
- try
- {
- //显示异常处理界面
- HandleException frmEX = new HandleException();
- frmEX.WindowState = FormWindowState.Maximized;
- frmEX.ShowDialog();
- }
- catch (Exception ex)
- {
- CallBack(ex.Message);
- }
- }
- [STAThread]
- public void CheckAndClearing(object o)
- {
- try
- {
- //显示对账界面
- Clearing frm = new Clearing();
- frm.WindowState = FormWindowState.Maximized;
- frm.ShowDialog();
- }
- catch (Exception ex)
- {
- CallBack(ex.Message);
- }
- }
- [STAThread]
- public void BasicData(object o)
- {
- try
- {
- //显示异常处理界面
- BasicData frm = new BasicData();
- frm.WindowState = FormWindowState.Maximized;
- frm.ShowDialog();
- }
- catch (Exception ex)
- {
- CallBack(ex.Message);
- }
- }
- [STAThread]
- public void PrescribeCirculation(object o)
- {
- try
- {
- //显示处方上传
- PrescriptionCirculation PresCir = new PrescriptionCirculation("");
- //PresCir.WindowState = FormWindowState.Minimized;
- PresCir.ShowDialog();
- }
- catch (Exception ex)
- {
- CallBack(ex.Message);
- }
- }
- }
- public class WindowWrapper : System.Windows.Forms.IWin32Window
- {
- public WindowWrapper(IntPtr handle)
- {
- _hwnd = handle;
- }
- public IntPtr Handle
- {
- get { return _hwnd; }
- }
- private IntPtr _hwnd;
- }
- }
|