ChooseCard.cs 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Data.SqlTypes;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Threading.Tasks;
  10. using System.Windows.Forms;
  11. using PTMedicalInsurance.Common;
  12. using PTMedicalInsurance.Helper;
  13. using Newtonsoft.Json.Linq;
  14. using PTMedicalInsurance.Forms;
  15. using PTMedicalInsurance.Variables;
  16. using PTMedicalInsurance.Business;
  17. namespace PTMedicalInsurance.Forms
  18. {
  19. public partial class ChooseCard : Form
  20. {
  21. public string cardType;
  22. public string businessType;
  23. public string ID,PatName;
  24. public int sL_CardType;
  25. //设置业务实例
  26. InvokeHelper invoker = new InvokeHelper();
  27. private HisIrisServices hIS = new HisIrisServices();
  28. public ChooseCard()
  29. {
  30. InitializeComponent();
  31. this.StartPosition = FormStartPosition.CenterParent;
  32. }
  33. private void btOk_Click(object sender, EventArgs e)
  34. {
  35. cardType = "0" + (rbgCardType.SelectedIndex +1).ToString();
  36. businessType = "01" + cbBusinessType.Text.Substring(0,3);
  37. Global.pat.OtherProv = rbgOtherProv.SelectedIndex;
  38. if ((rbgOtherProv.SelectedIndex == 1)&&(cbCBD.Text=="")&&(rbgCardType.SelectedIndex==1))
  39. {
  40. MessageBox.Show("身份证异地结算,请选择统筹区!");
  41. return;
  42. }
  43. // 身份证
  44. if (rbgCardType.SelectedIndex == 1)
  45. {
  46. if (tbID.Text == "")
  47. {
  48. ID = "";
  49. MessageBox.Show("身份证结算,需要输入身份证号");
  50. return;
  51. }
  52. else
  53. {
  54. ID = tbID.Text;
  55. }
  56. PatName = tbName.Text;
  57. }
  58. //社保卡
  59. if (rbgCardType.SelectedIndex == 2)
  60. {
  61. if (cbCardType.Text == "")
  62. {
  63. MessageBox.Show("读社保卡时需要选择卡类型!");
  64. return;
  65. }
  66. sL_CardType = int.Parse(cbCardType.Text.Trim().Substring(0, 1)); //卡类型
  67. }
  68. DialogResult = DialogResult.OK;
  69. }
  70. private void ChooseCard_Load(object sender, EventArgs e)
  71. {
  72. rbgCardType.SelectedIndex = 2; //身份证
  73. cbBusinessType.SelectedIndex = 0; //社保卡
  74. rbgOtherProv.SelectedIndex = 0; //本地
  75. if (Global.inf.interfaceDr == 12)//安徽省基线版-瑶海
  76. {
  77. rbgOtherProv.SelectedIndex = 1;
  78. }
  79. if (Global.inf.interfaceDr == 15)//安徽省基线版-蜀山老院
  80. {
  81. rbgOtherProv.SelectedIndex = 1;
  82. }
  83. }
  84. private void rbgCardType_ValueChanged(object sender, int index, string text)
  85. {
  86. if (rbgCardType.SelectedIndex == 0)
  87. {
  88. cbBusinessType.Enabled = true;
  89. }
  90. else
  91. {
  92. cbBusinessType.Enabled = false;
  93. }
  94. if (rbgCardType.SelectedIndex == 1)
  95. {
  96. hIS.GetHisPatBaseInfo(out string errMsg);
  97. tbID.Text = Global.pat.certNO;
  98. }
  99. if (rbgCardType.SelectedIndex == 2)
  100. {
  101. cbCardType.SelectedIndex = 0;
  102. cbCardLevel.SelectedIndex = 2;
  103. cbCardType.Enabled = true;
  104. tbPassword.Enabled = true;
  105. //tbPassword.Text = "";
  106. }
  107. else
  108. {
  109. cbCardType.Enabled = false;
  110. tbPassword.Enabled = false;
  111. }
  112. if (rbgCardType.SelectedIndex != 1)
  113. {
  114. tbID.Text = "";
  115. }
  116. }
  117. private void btCancle_Click(object sender, EventArgs e)
  118. {
  119. DialogResult = DialogResult.Cancel;
  120. }
  121. private void uiButton1_Click(object sender, EventArgs e)
  122. {
  123. string sInput = "", errorMsg="";
  124. JObject joData = new JObject();
  125. joData.Add("", "");
  126. JObject joInput = new JObject();
  127. joInput.Add("data", joData);
  128. InvokeHelper invoker = new InvokeHelper();
  129. // 重庆为1163?
  130. sInput = JsonHelper.setCenterInpar("1193", "");
  131. JObject joRtn =invoker.invokeCenterService("1193", sInput);
  132. if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)
  133. {
  134. MessageBox.Show("修改卡密码失败:" + errorMsg);
  135. }
  136. else
  137. {
  138. MessageBox.Show("修改卡密码成功!");
  139. }
  140. }
  141. private void SearchAdmdvs()
  142. {
  143. JObject joAdmdvsInfo = new JObject();
  144. SearchAdmdvs Adm = new SearchAdmdvs();
  145. try
  146. {
  147. Global.pat.card.SearchAdmKey = cbCBD.Text;
  148. Adm.StartPosition = FormStartPosition.CenterParent;
  149. if (Adm.ShowDialog() == DialogResult.OK)
  150. {
  151. cbCBD.Text = Global.pat.card.SearchAdmName;
  152. }
  153. }
  154. catch (Exception ex)
  155. {
  156. MessageBox.Show("异常:" + ex.Message);
  157. return;
  158. }
  159. }
  160. private void tbID_TextChanged(object sender, EventArgs e)
  161. {
  162. }
  163. private void rbgOtherProv_ValueChanged(object sender, int index, string text)
  164. {
  165. }
  166. private void cbCBD_DoEnter(object sender, EventArgs e)
  167. {
  168. SearchAdmdvs();
  169. }
  170. }
  171. }