ChooseCard.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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. namespace PTMedicalInsurance.Forms
  17. {
  18. public partial class ChooseCard : Form
  19. {
  20. public string EcCodeType; //电子凭证类型
  21. public string cardType;
  22. public string businessType;
  23. public string ID,PatName;
  24. //设置业务实例
  25. InvokeHelper invoker = new InvokeHelper();
  26. public ChooseCard()
  27. {
  28. InitializeComponent();
  29. this.StartPosition = FormStartPosition.CenterParent;
  30. }
  31. private void btOk_Click(object sender, EventArgs e)
  32. {
  33. cardType = "0" + (rbgCardType.SelectedIndex +1).ToString();
  34. businessType = "01" + cbBusinessType.Text.Substring(0,3);
  35. EcCodeType = rbgEcType.SelectedIndex.ToString();
  36. Global.pat.OtherProv = rbgOtherProv.SelectedIndex;
  37. if ((rbgOtherProv.SelectedIndex == 1)&&(cbCBD.Text==""))
  38. {
  39. MessageBox.Show("异地结算,请选择统筹区!");
  40. return;
  41. }
  42. if (rbgCardType.SelectedIndex == 1)
  43. {
  44. if (tbID.Text == "")
  45. {
  46. ID = "";
  47. }
  48. else
  49. {
  50. ID = tbID.Text;
  51. }
  52. PatName = tbName.Text;
  53. }
  54. else
  55. {
  56. PatName = "";
  57. }
  58. DialogResult = DialogResult.OK;
  59. }
  60. private void ChooseCard_Load(object sender, EventArgs e)
  61. {
  62. rbgCardType.SelectedIndex = 2; //身份证
  63. cbBusinessType.SelectedIndex = 0; //社保卡
  64. rbgOtherProv.SelectedIndex = 0; //本地
  65. rbgEcType.SelectedIndex = -1; //电子二维码
  66. }
  67. private void rbgCardType_ValueChanged(object sender, int index, string text)
  68. {
  69. if (rbgCardType.SelectedIndex == 0)
  70. {
  71. cbBusinessType.Enabled = true;
  72. rbgEcType.SelectedIndex = 0;
  73. }
  74. else
  75. {
  76. cbBusinessType.Enabled = false;
  77. rbgEcType.SelectedIndex = -1;
  78. }
  79. if (rbgCardType.SelectedIndex == 2)
  80. {
  81. cbCardType.SelectedIndex = 0;
  82. cbCardLevel.SelectedIndex = 2;
  83. cbCardType.Enabled = true;
  84. tbPassword.Enabled = true;
  85. //tbPassword.Text = "";
  86. }
  87. else
  88. {
  89. cbCardType.Enabled = false;
  90. tbPassword.Enabled = false;
  91. }
  92. if (rbgCardType.SelectedIndex != 1)
  93. tbID.Text = "";
  94. }
  95. private void btCancle_Click(object sender, EventArgs e)
  96. {
  97. DialogResult = DialogResult.Cancel;
  98. }
  99. private void uiButton1_Click(object sender, EventArgs e)
  100. {
  101. string sInput = "", errorMsg="";
  102. JObject joData = new JObject();
  103. joData.Add("", "");
  104. JObject joInput = new JObject();
  105. joInput.Add("data", joData);
  106. InvokeHelper invoker = new InvokeHelper();
  107. sInput = JsonHelper.setCenterInpar("1193", "");
  108. JObject joRtn =invoker.invokeCenterService("1193", sInput);
  109. if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)
  110. {
  111. MessageBox.Show("修改卡密码失败:" + errorMsg);
  112. }
  113. else
  114. {
  115. MessageBox.Show("修改卡密码成功!");
  116. }
  117. }
  118. private void SearchAdmdvs()
  119. {
  120. JObject joAdmdvsInfo = new JObject();
  121. SearchAdmdvs Adm = new SearchAdmdvs();
  122. try
  123. {
  124. Global.pat.card.SearchAdmKey = cbCBD.Text;
  125. Adm.StartPosition = FormStartPosition.CenterParent;
  126. if (Adm.ShowDialog() == DialogResult.OK)
  127. {
  128. cbCBD.Text = Global.pat.card.SearchAdmName;
  129. }
  130. }
  131. catch (Exception ex)
  132. {
  133. MessageBox.Show("异常:" + ex.Message);
  134. return;
  135. }
  136. }
  137. private void btnScanCode_Click(object sender, EventArgs e)
  138. {
  139. cardType = "01";
  140. businessType = "01" + cbBusinessType.Text.Substring(0, 3);
  141. EcCodeType = "0";
  142. Global.pat.OtherProv = rbgOtherProv.SelectedIndex;
  143. if ((rbgOtherProv.SelectedIndex == 1) && (cbCBD.Text == ""))
  144. {
  145. MessageBox.Show("异地结算,请选择统筹区!");
  146. return;
  147. }
  148. PatName = "";
  149. DialogResult = DialogResult.OK;
  150. }
  151. private void btnFaceIdentify_Click(object sender, EventArgs e)
  152. {
  153. cardType = "01";
  154. businessType = "01" + cbBusinessType.Text.Substring(0, 3);
  155. EcCodeType = "1";
  156. Global.pat.OtherProv = rbgOtherProv.SelectedIndex;
  157. if ((rbgOtherProv.SelectedIndex == 1) && (cbCBD.Text == ""))
  158. {
  159. MessageBox.Show("异地结算,请选择统筹区!");
  160. return;
  161. }
  162. PatName = "";
  163. DialogResult = DialogResult.OK;
  164. }
  165. private void rbgEcType_ValueChanged(object sender, int index, string text)
  166. {
  167. rbgCardType.SelectedIndex = 0;
  168. }
  169. private void cbCBD_DoEnter(object sender, EventArgs e)
  170. {
  171. SearchAdmdvs();
  172. }
  173. }
  174. }