ChooseCard.cs 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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. this.cbBusinessType.SelectedIndex = 8;
  33. }
  34. private void btOk_Click(object sender, EventArgs e)
  35. {
  36. cardType = "0" + (rbgCardType.SelectedIndex +1).ToString();
  37. businessType = "01" + cbBusinessType.Text.Substring(0,3);
  38. Global.pat.OtherProv = rbgOtherProv.SelectedIndex;
  39. if ((rbgOtherProv.SelectedIndex == 1)&&(cbCBD.Text=="")&&(rbgCardType.SelectedIndex==1))
  40. {
  41. MessageBox.Show("身份证异地结算,请选择统筹区!");
  42. return;
  43. }
  44. // 身份证
  45. if (rbgCardType.SelectedIndex == 1)
  46. {
  47. if (tbID.Text == "")
  48. {
  49. ID = "";
  50. MessageBox.Show("身份证结算,需要输入身份证号");
  51. return;
  52. }
  53. else
  54. {
  55. ID = tbID.Text;
  56. }
  57. PatName = tbName.Text;
  58. }
  59. //社保卡
  60. if (rbgCardType.SelectedIndex == 2)
  61. {
  62. if (cbCardType.Text == "")
  63. {
  64. MessageBox.Show("读社保卡时需要选择卡类型!");
  65. return;
  66. }
  67. sL_CardType = int.Parse(cbCardType.Text.Trim().Substring(0, 1)); //卡类型
  68. }
  69. CBD = "";
  70. if (cbCBD.Text != "")
  71. {
  72. Global.pat.insuplc_admdvs = Global.pat.card.SearchAdmCode;
  73. CBD = cbCBD.Text;
  74. }
  75. DialogResult = DialogResult.OK;
  76. }
  77. private void ChooseCard_Load(object sender, EventArgs e)
  78. {
  79. rbgCardType.SelectedIndex = 2; //身份证
  80. cbBusinessType.SelectedIndex = 8; //社保卡
  81. rbgOtherProv.SelectedIndex = 0; //本地
  82. if (Global.inf.interfaceDr == 12)//安徽省基线版-瑶海
  83. {
  84. rbgOtherProv.SelectedIndex = 1;
  85. }
  86. if (Global.inf.interfaceDr == 15)//安徽省基线版-蜀山老院
  87. {
  88. rbgOtherProv.SelectedIndex = 1;
  89. }
  90. }
  91. private void rbgCardType_ValueChanged(object sender, int index, string text)
  92. {
  93. if (rbgCardType.SelectedIndex == 0)
  94. {
  95. cbBusinessType.Enabled = true;
  96. }
  97. else
  98. {
  99. cbBusinessType.Enabled = false;
  100. }
  101. if (rbgCardType.SelectedIndex == 1)
  102. {
  103. hIS.GetHisPatBaseInfo(out string errMsg);
  104. tbID.Text = Global.pat.certNO;
  105. tbName.Text = Global.pat.name;
  106. }
  107. if (rbgCardType.SelectedIndex == 2)
  108. {
  109. cbCardType.SelectedIndex = 0;
  110. cbCardLevel.SelectedIndex = 2;
  111. cbCardType.Enabled = true;
  112. tbPassword.Enabled = true;
  113. //tbPassword.Text = "";
  114. }
  115. else
  116. {
  117. cbCardType.Enabled = false;
  118. tbPassword.Enabled = false;
  119. }
  120. if (rbgCardType.SelectedIndex != 1)
  121. {
  122. tbID.Text = "";
  123. }
  124. }
  125. private void btCancle_Click(object sender, EventArgs e)
  126. {
  127. DialogResult = DialogResult.Cancel;
  128. }
  129. private void uiButton1_Click(object sender, EventArgs e)
  130. {
  131. string sInput = "", errorMsg="";
  132. JObject joData = new JObject();
  133. joData.Add("", "");
  134. JObject joInput = new JObject();
  135. joInput.Add("data", joData);
  136. InvokeHelper invoker = new InvokeHelper();
  137. // 重庆为1163?
  138. sInput = JsonHelper.setCenterInpar("1193", "");
  139. JObject joRtn =invoker.invokeCenterService("1193", sInput);
  140. if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)
  141. {
  142. MessageBox.Show("修改卡密码失败:" + errorMsg);
  143. }
  144. else
  145. {
  146. MessageBox.Show("修改卡密码成功!");
  147. }
  148. }
  149. private void SearchAdmdvs()
  150. {
  151. JObject joAdmdvsInfo = new JObject();
  152. SearchAdmdvs Adm = new SearchAdmdvs();
  153. try
  154. {
  155. Global.pat.card.SearchAdmKey = cbCBD.Text;
  156. Adm.StartPosition = FormStartPosition.CenterParent;
  157. if (Adm.ShowDialog() == DialogResult.OK)
  158. {
  159. cbCBD.Text = Global.pat.card.SearchAdmName;
  160. }
  161. }
  162. catch (Exception ex)
  163. {
  164. MessageBox.Show("异常:" + ex.Message);
  165. return;
  166. }
  167. }
  168. private void tbID_TextChanged(object sender, EventArgs e)
  169. {
  170. }
  171. private void rbgOtherProv_ValueChanged(object sender, int index, string text)
  172. {
  173. }
  174. private void cbCBD_DoEnter(object sender, EventArgs e)
  175. {
  176. SearchAdmdvs();
  177. }
  178. }
  179. }