| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 | using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Data.SqlTypes;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;using PTMedicalInsurance.Common;using PTMedicalInsurance.Helper;using Newtonsoft.Json.Linq;using PTMedicalInsurance.Forms;using PTMedicalInsurance.Variables;namespace PTMedicalInsurance.Forms{    public partial class ChooseCard : Form    {        public string cardType;        public string businessType;        public string ID,PatName;        public int sL_CardType;        //设置业务实例        InvokeHelper invoker = new InvokeHelper();        public ChooseCard()        {            InitializeComponent();            this.StartPosition = FormStartPosition.CenterParent;        }        private void btOk_Click(object sender, EventArgs e)        {            cardType = "0" + (rbgCardType.SelectedIndex +1).ToString();            businessType = cbBusinessType.Text.Substring(0,3);            Global.pat.OtherProv = rbgOtherProv.SelectedIndex;            if (rbgCardType.SelectedIndex == 0)            {                if (string.IsNullOrEmpty(tbID.Text.Trim()))                {                    MessageBox.Show("请先扫电子医保码!");                    tbID.Focus();                    return;                } else                {                    Global.pat.ecCardNo = tbID.Text.Trim();                }            }            if ((rbgOtherProv.SelectedIndex == 1)&&(cbCBD.Text==""))            {                MessageBox.Show("异地结算,请选择统筹区!");                return;            }            // 身份证            if (rbgCardType.SelectedIndex == 1)            {                if (tbID.Text == "")                {                    ID = "";                }                else                {                    ID = tbID.Text;                }                                PatName = tbName.Text;            }            //社保卡            if (rbgCardType.SelectedIndex == 2)            {                if (cbCardType.Text == "")                {                    MessageBox.Show("读社保卡时需要选择卡类型!");                    return;                }                sL_CardType = int.Parse(cbCardType.Text.Trim().Substring(0, 1));     //卡类型                            }            DialogResult = DialogResult.OK;        }        private void ChooseCard_Load(object sender, EventArgs e)        {            rbgCardType.SelectedIndex = 2;      //身份证            cbBusinessType.SelectedIndex = 0;   //社保卡            rbgOtherProv.SelectedIndex = 0;     //本地                   }        private void rbgCardType_ValueChanged(object sender, int index, string text)        {            if (rbgCardType.SelectedIndex == 0)            {                // 电子凭证                cbBusinessType.Enabled = true;                lblNo.Text = "电子凭证号";                tbID.Focus();            }            else            {                lblNo.Text = "身份证号";                cbBusinessType.Enabled = false;            }            if (rbgCardType.SelectedIndex == 2)            {                cbCardType.SelectedIndex = 0;                cbCardLevel.SelectedIndex = 2;                cbCardType.Enabled = true;                tbPassword.Enabled = true;                //tbPassword.Text = "";            }            else            {                cbCardType.Enabled = false;                tbPassword.Enabled = false;            }            if (rbgCardType.SelectedIndex != 1)            {                tbID.Text = "";            }        }        private void btCancle_Click(object sender, EventArgs e)        {            DialogResult = DialogResult.Cancel;        }        /// <summary>        /// 修改密码        /// </summary>        /// <param name="sender"></param>        /// <param name="e"></param>        private void uiButton1_Click(object sender, EventArgs e)        {            string errorMsg="";            JObject joData = new JObject();            joData.Add("", "");            JObject joInput = new JObject();            joInput.Add("data", joData);            InvokeHelper invoker = new InvokeHelper();            JObject joRtn =invoker.invokeCenterService(TradeEnum.ModifyPassword, joInput);            if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)            {                MessageBox.Show("修改卡密码失败:" + errorMsg);            }            else            {                MessageBox.Show("修改卡密码成功!");            }        }        private void SearchAdmdvs()        {            JObject joAdmdvsInfo = new JObject();            SearchAdmdvs Adm = new SearchAdmdvs();            try            {                Global.pat.card.SearchAdmKey = cbCBD.Text;                Adm.StartPosition = FormStartPosition.CenterParent;                if (Adm.ShowDialog() == DialogResult.OK)                {                    if (!string.IsNullOrEmpty(Global.pat.card.SearchAdmCode))                    {                        //自动选择异地                        if (Utils.isOtherCity(Global.pat.card.SearchAdmCode))                        {                            rbgOtherProv.SelectedIndex = 1;                        }                    }                    cbCBD.Text = Global.pat.card.SearchAdmName;                }            }            catch (Exception ex)            {                MessageBox.Show("异常:" + ex.Message);                return;            }        }        private void cbCBD_DoEnter(object sender, EventArgs e)        {            //初始化            Global.pat.card.SearchAdmCode = "";            SearchAdmdvs();        }    }}
 |