using Newtonsoft.Json.Linq; using PTMedicalInsurance.Business; using PTMedicalInsurance.Helper; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using PTMedicalInsurance.Variables; using PTMedicalInsurance.FormSetter; using Sunny.UI; using FastReport.DevComponents.Editors; using FastReport.Utils; namespace CCunMI.Forms { public partial class AssistSelect : Form { public AssistSelect() { InitializeComponent(); } HisMainBusiness hBus = new HisMainBusiness(); private InvokeHelper invoker = new InvokeHelper(); InsuServices rIS= new InsuServices(); GridViewSetter grdSetter = new GridViewSetter(); private void AssistSelect_Load(object sender, EventArgs e) { uiDatetimePicker1.Text = DateTime.Now.ToString("yyyy-MM-01 00:00:00"); uiDatetimePicker2.Value = DateTime.Now.AddDays(1 - DateTime.Now.Day).AddMonths(1).AddDays(-1); //ComboxSetter cbxSetter = new ComboxSetter(); //cbxSetter.setCbxDictionaryDataSource(Global.inf.interfaceDr.ToString(), "insutype", uiComboBox3); uiDatetimePicker3.Text = DateTime.Now.ToString("yyyy-MM-01 00:00:00"); uiDatetimePicker4.Text = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd 23:59:59"); } private void uiButton1_Click(object sender, EventArgs e) { string outParam; //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息 if (hBus.readCard(out outParam) != 0) { MessageBox.Show(JsonHelper.setExceptionJson(-100, "读卡失败!", outParam).ToString()); } else { //展示患者信息界面 if (hBus.showPatInfo(outParam, out outParam) != 0) { MessageBox.Show(JsonHelper.setIrisReturnValue(0, "展示患者信息失败", JObject.Parse(outParam)).ToString()); } else { } } uiTextBox1.Text = Global.pat.psn_no; } private void uiMbyyButton1_Click(object sender, EventArgs e) { grdSetter.SetMbMedicationHistory(uiDataGridView1); JObject jo5205 = new JObject(); jo5205.Add("psn_no", uiTextBox1.Text);//必填 jo5205.Add("begntime", uiDatetimePicker1.Text);//yyyy-MM-dd HH:mm:ss必填 jo5205.Add("endtime", uiDatetimePicker2.Text);//yyyy-MM-dd HH:mm:ss JObject data5205 = new JObject(); data5205.Add("data", jo5205); JObject out5205 = invoker.invokeCenterService("5205", JObject.Parse(JsonHelper.setCenterInpar("5205", data5205))); DataTable dt = (DataTable)out5205["output"]["feedetail"].ToObject(typeof(DataTable)); uiDataGridView1.DataSource = dt; } private void uiPanel1_Click(object sender, EventArgs e) { } private void uiButton2_Click(object sender, EventArgs e) { string Yllb = ""; if (uiComboBox3.SelectedIndex == 0) { Yllb = "11"; }else if (uiComboBox3.SelectedIndex == 1) { Yllb = "21"; } else if (uiComboBox3.SelectedIndex == 2) { Yllb = "26"; } //人员待遇享受检查 string errMsg = ""; JObject joData2001 = new JObject(); joData2001.Add("psn_no", uiTextBox2.Text); joData2001.Add("insutype", uiTextBox4.Text); joData2001.Add("fixmedins_code", Global.inf.hospitalNO); joData2001.Add("med_type", Yllb); joData2001.Add("begntime", uiDatetimePicker3.Text); joData2001.Add("endtime", uiDatetimePicker4.Text); joData2001.Add("dise_codg", ""); joData2001.Add("dise_name", ""); joData2001.Add("oprn_oprt_code", ""); joData2001.Add("oprn_oprt_name", ""); joData2001.Add("matn_type", ""); joData2001.Add("birctrl_type", ""); JObject joInput = new JObject(); joInput.Add("data", joData2001); InvokeHelper invoker = new InvokeHelper(); JObject joRtn2001 = invoker.invokeCenterService("2001", JsonHelper.setCenterInpar("2001", joInput)); JObject OutIDInfo=new JObject(); JArray joDic; if (JsonHelper.parseCenterRtnValue(joRtn2001, out errMsg) != 0) { MessageBox.Show("人员待遇享受检查调用失败,中心返回错误信息:" + errMsg); } else { JArray joTrtinfo = JArray.Parse(JsonHelper.getDestValue(joRtn2001, "output.trtinfo")); // MessageBox.Show("获取到返回值数组" + joTrtinfo.ToString()); // MessageBox.Show("数组数量" + joTrtinfo.Count); if (joTrtinfo.Count > 0) { for(int i=0; i 1) { joRtn2001["output"]["trtinfo"][i]["fund_pay_type"] = joDic[1]["name"].ToString(); } } } //MessageBox.Show("转换后数据" + joRtn2001["output"]["trtinfo"].ToString()); DataTable dt = (DataTable)joRtn2001["output"]["trtinfo"].ToObject(typeof(DataTable)); grdSetter.SetTreatmentEnjoyVerify(DGrV2001); DGrV2001.DataSource= dt; } } private void uiButton3_Click(object sender, EventArgs e) { string outParam; //打开读卡窗口,操作员选择读卡类型后进行读卡器读卡,再进行1101获取参保信息 if (hBus.readCard(out outParam) != 0) { MessageBox.Show(JsonHelper.setExceptionJson(-100, "读卡失败!", outParam).ToString()); } else { //展示患者信息界面 if (hBus.showPatInfo(outParam, out outParam) != 0) { MessageBox.Show(JsonHelper.setIrisReturnValue(0, "展示患者信息失败", JObject.Parse(outParam)).ToString()); } else { JObject joPatInfo = JObject.Parse(outParam); Global.pat.insuType = JsonHelper.getDestValue(joPatInfo, "selectedInsuInfo.insutype"); Global.pat.psn_no = JsonHelper.getDestValue(joPatInfo, "output.baseinfo.psn_no"); uiTextBox2.Text = Global.pat.psn_no; uiTextBox4.Text = Global.pat.insuType; } } } private DataTable GetDBLKComboxTable(string sqlStr) { InvokeHelper invoker = new InvokeHelper(); dynamic joInparm = new JObject(); dynamic joTmp = new JObject(); joTmp.sqlStr = sqlStr; JArray jaParams = new JArray(); jaParams.Add(joTmp); joInparm.Add("params", JArray.FromObject(jaParams)); joInparm.code = "09010014"; string inParam = joInparm.ToString(); JObject joRtn = invoker.invokeInsuService(inParam, "获取下拉框消息"); //dynamic jsonRtn = JsonConvert.DeserializeObject(strRtn); DataTable dt = (DataTable)joRtn["result"].ToObject(typeof(DataTable)); //dt.Columns[0].ColumnName = "编码"; //dt.Columns[1].ColumnName = "名称"; //dt.Columns[2].ColumnName = "拼音查找码"; return dt; } } }