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();
            rbBaseInsu.Checked = true;
            this.StartPosition = FormStartPosition.CenterParent;
        }

        private void btOk_Click(object sender, EventArgs e)
        {
            businessType = "01" + cbBusinessType.Text.Substring(0, 3);
            Global.pat.isWorkInjury = rbWorkerInsu.Checked;
            DialogResult = DialogResult.OK;
        }

        private void ChooseCard_Load(object sender, EventArgs e)
        {
            cbBusinessType.SelectedIndex = 0;   //挂号
        }

        private void btCancle_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.Cancel;
        }

        private void uiButton1_Click(object sender, EventArgs e)
        {
            string sInput = "", errorMsg="";

            JObject joData = new JObject();
            joData.Add("", "");

            JObject joInput = new JObject();
            joInput.Add("data", joData);

            InvokeHelper invoker = new InvokeHelper();
            // 重庆为1163?
            sInput = JsonHelper.setCenterInpar("1193", "");
            JObject joRtn =invoker.invokeCenterService("1193", sInput);
            if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)
            {
                MessageBox.Show("修改卡密码失败：" + errorMsg);
            }
            else
            {
                MessageBox.Show("修改卡密码成功！");
            }
        }

    }
}
