ChooseCard.cs 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  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,CBD;
  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. CBD = "";
  69. if (cbCBD.Text != "")
  70. {
  71. Global.pat.insuplc_admdvs = Global.pat.card.SearchAdmCode;
  72. CBD = cbCBD.Text;
  73. }
  74. DialogResult = DialogResult.OK;
  75. }
  76. private void ChooseCard_Load(object sender, EventArgs e)
  77. {
  78. rbgCardType.SelectedIndex = 2; //身份证
  79. cbBusinessType.SelectedIndex = 0; //社保卡
  80. rbgOtherProv.SelectedIndex = 0; //本地
  81. if (Global.inf.interfaceDr == 12)//安徽省基线版-瑶海
  82. {
  83. rbgOtherProv.SelectedIndex = 1;
  84. }
  85. if (Global.inf.interfaceDr == 15)//安徽省基线版-蜀山老院
  86. {
  87. rbgOtherProv.SelectedIndex = 1;
  88. }
  89. }
  90. private void rbgCardType_ValueChanged(object sender, int index, string text)
  91. {
  92. if (rbgCardType.SelectedIndex == 0)
  93. {
  94. cbBusinessType.Enabled = true;
  95. }
  96. else
  97. {
  98. cbBusinessType.Enabled = false;
  99. }
  100. if (rbgCardType.SelectedIndex == 1)
  101. {
  102. hIS.GetHisPatBaseInfo(out string errMsg);
  103. tbID.Text = Global.pat.certNO;
  104. tbName.Text = Global.pat.name;
  105. }
  106. if (rbgCardType.SelectedIndex == 2)
  107. {
  108. cbCardType.SelectedIndex = 0;
  109. cbCardLevel.SelectedIndex = 2;
  110. cbCardType.Enabled = true;
  111. tbPassword.Enabled = true;
  112. //tbPassword.Text = "";
  113. }
  114. else
  115. {
  116. cbCardType.Enabled = false;
  117. tbPassword.Enabled = false;
  118. }
  119. if (rbgCardType.SelectedIndex != 1)
  120. {
  121. tbID.Text = "";
  122. }
  123. }
  124. private void btCancle_Click(object sender, EventArgs e)
  125. {
  126. DialogResult = DialogResult.Cancel;
  127. }
  128. private void uiButton1_Click(object sender, EventArgs e)
  129. {
  130. string sInput = "", errorMsg="";
  131. JObject joData = new JObject();
  132. joData.Add("", "");
  133. JObject joInput = new JObject();
  134. joInput.Add("data", joData);
  135. InvokeHelper invoker = new InvokeHelper();
  136. // 重庆为1163?
  137. sInput = JsonHelper.setCenterInpar("1193", "");
  138. JObject joRtn =invoker.invokeCenterService("1193", sInput);
  139. if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)
  140. {
  141. MessageBox.Show("修改卡密码失败:" + errorMsg);
  142. }
  143. else
  144. {
  145. MessageBox.Show("修改卡密码成功!");
  146. }
  147. }
  148. private void SearchAdmdvs()
  149. {
  150. JObject joAdmdvsInfo = new JObject();
  151. SearchAdmdvs Adm = new SearchAdmdvs();
  152. try
  153. {
  154. Global.pat.card.SearchAdmKey = cbCBD.Text;
  155. Adm.StartPosition = FormStartPosition.CenterParent;
  156. if (Adm.ShowDialog() == DialogResult.OK)
  157. {
  158. cbCBD.Text = Global.pat.card.SearchAdmName;
  159. }
  160. }
  161. catch (Exception ex)
  162. {
  163. MessageBox.Show("异常:" + ex.Message);
  164. return;
  165. }
  166. }
  167. private void tbID_TextChanged(object sender, EventArgs e)
  168. {
  169. }
  170. private void rbgOtherProv_ValueChanged(object sender, int index, string text)
  171. {
  172. }
  173. private void cbCBD_DoEnter(object sender, EventArgs e)
  174. {
  175. SearchAdmdvs();
  176. }
  177. }
  178. }