| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172 |
- using Newtonsoft.Json.Linq;
- using PTMedicalInsurance.Business;
- using PTMedicalInsurance.Helper;
- using PTMedicalInsurance.Variables;
- using Sunny.UI;
- 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;
- namespace HaErBinMIMI.Forms
- {
- public partial class AuxFun : Form
- {
- HisMainBusiness hBus = new HisMainBusiness();
- public AuxFun()
- {
- InitializeComponent();
- }
- private void tabPage1_Click(object sender, EventArgs e)
- {
- }
- private void uiLabel7_Click(object sender, EventArgs e)
- {
- }
- private void uiTextBox4_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar))
- {
- // 如果按键不是数字并且不是控制键,则不允许输入
- e.Handled = true;
- MessageBox.Show("密码只能是6位数字");
- }
- }
- private void uiTextBox5_KeyPress(object sender, KeyPressEventArgs e)
- {
- if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar))
- {
- // 如果按键不是数字并且不是控制键,则不允许输入
- e.Handled = true;
- MessageBox.Show("密码只能是6位数字");
- }
- }
- private void uiButton1_Click(object sender, EventArgs e)
- {
- string outParam = "";
- if (hBus.readCard(out outParam) != 0)
- {
- MessageBox.Show("读卡失败!" + outParam);
- }
- else
- {
- if ((Global.pat.insuplc_admdvs.Substring(0, 4) == "2301") && (Global.inf.areaCode == "239900"))
- {
- MessageBox.Show("该患者为市医保患者,请用市医保!" + outParam);
- }
- //展示患者信息界面
- if (hBus.showPatInfo(outParam, out outParam) != 0)
- {
- MessageBox.Show(outParam);
- }
- else
- {
- uiTextBox1.Text = Global.pat.mdtrtcertType;
- uiTextBox2.Text = Global.pat.certNO;
- uiTextBox3.Text = Global.pat.name;
- }
- }
- }
- private void uiButton2_Click(object sender, EventArgs e)
- {
- string malx = "";//密码修改类型
- string errorMsg = "";
- if (!(uiTextBox1.Text == "01" || uiTextBox1.Text == "02" || uiTextBox1.Text == "03"))
- {
- MessageBox.Show("就诊凭证只能是01或02或03,其中01电子凭证,02身份证,03医保卡!");
- return;
- }
- if (uiTextBox2.Text == "")
- {
- MessageBox.Show("请输入身份证号或者点击医保读卡获取身份证号");
- return;
- }
- if (uiTextBox2.Text == "")
- {
- MessageBox.Show("请输入姓名或者点击医保读卡获取姓名");
- return;
- }
- if (uiComboBox1.SelectedIndex == 0)
- {
- malx = "01";
- }
- else if (uiComboBox1.SelectedIndex == 1)
- {
- malx = "02";
- }
- //调用1161密码修改
- JObject joData = new JObject();
- joData.Add("mdtrt_cert_type", uiTextBox1.Text);
- joData.Add("certno", uiTextBox2.Text);
- joData.Add("psn_name", uiTextBox3.Text);
- joData.Add("opt_type", malx);
- joData.Add("card_pwd_old", uiTextBox4.Text);
- joData.Add("card_pwd_new", uiTextBox5.Text);
- JObject joInput = new JObject();
- joInput.Add("data", joData);
- InvokeHelper invoker = new InvokeHelper();
- JObject joRtn = invoker.invokeCenterService("1161", joInput);
- if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)
- {
- MessageBox.Show("密码修改调用失败,请重试:" + errorMsg);
- }
- else
- {
- string ts= JsonHelper.getDestValue(joRtn, "output.returninfo.msg_code");
- //MessageBox.Show("返回值" + ts);
- string xx = JsonHelper.getDestValue(joRtn, "output.returninfo.msg_info");
- if (ts == "01")
- {
- MessageBox.Show("修改成功!!!");
- }else if (ts == "02")
- {
- MessageBox.Show("修改保存失败"+ xx);
- }
- else if (ts == "03")
- {
- MessageBox.Show("密码不存在"+ xx);
- }
- else if (ts == "04")
- {
- MessageBox.Show("密码错误"+ xx);
- }
- }
- }
- private void uiComboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- if (uiComboBox1.SelectedIndex == 0)
- {
- uiTextBox4.Text = "";
- uiTextBox4.Visible = false;
- uiLabel5.Visible = false;
- }
- else if (uiComboBox1.SelectedIndex == 1)
- {
- uiTextBox4.Visible = true;
- uiLabel5.Visible = true;
- }
- }
- }
- }
|