ChooseCard.cs 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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 cardType;
  21. public string businessType;
  22. public string ID,PatName;
  23. public int sL_CardType;
  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. Global.pat.OtherProv = rbgOtherProv.SelectedIndex;
  36. if ((rbgOtherProv.SelectedIndex == 1)&&(cbCBD.Text==""))
  37. {
  38. MessageBox.Show("异地结算,请选择统筹区!");
  39. return;
  40. }
  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. //社保卡
  55. if (rbgCardType.SelectedIndex == 2)
  56. {
  57. if (cbCardType.Text == "")
  58. {
  59. MessageBox.Show("读社保卡时需要选择卡类型!");
  60. return;
  61. }
  62. sL_CardType = int.Parse(cbCardType.Text.Trim().Substring(0, 1)); //卡类型
  63. }
  64. DialogResult = DialogResult.OK;
  65. }
  66. private void ChooseCard_Load(object sender, EventArgs e)
  67. {
  68. rbgCardType.SelectedIndex = 2; //身份证
  69. cbBusinessType.SelectedIndex = 0; //社保卡
  70. rbgOtherProv.SelectedIndex = 0; //本地
  71. }
  72. private void rbgCardType_ValueChanged(object sender, int index, string text)
  73. {
  74. if (rbgCardType.SelectedIndex == 0)
  75. {
  76. cbBusinessType.Enabled = true;
  77. }
  78. else
  79. {
  80. cbBusinessType.Enabled = false;
  81. }
  82. if (rbgCardType.SelectedIndex == 2)
  83. {
  84. cbCardType.SelectedIndex = 0;
  85. cbCardLevel.SelectedIndex = 2;
  86. cbCardType.Enabled = true;
  87. tbPassword.Enabled = true;
  88. //tbPassword.Text = "";
  89. }
  90. else
  91. {
  92. cbCardType.Enabled = false;
  93. tbPassword.Enabled = false;
  94. }
  95. if (rbgCardType.SelectedIndex != 1)
  96. {
  97. tbID.Text = "";
  98. }
  99. }
  100. private void btCancle_Click(object sender, EventArgs e)
  101. {
  102. DialogResult = DialogResult.Cancel;
  103. }
  104. /// <summary>
  105. /// 修改密码
  106. /// </summary>
  107. /// <param name="sender"></param>
  108. /// <param name="e"></param>
  109. private void uiButton1_Click(object sender, EventArgs e)
  110. {
  111. string errorMsg="";
  112. JObject joData = new JObject();
  113. joData.Add("", "");
  114. JObject joInput = new JObject();
  115. joInput.Add("data", joData);
  116. InvokeHelper invoker = new InvokeHelper();
  117. JObject joRtn =invoker.invokeCenterService(TradeEnum.ModifyPassword, joInput);
  118. if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)
  119. {
  120. MessageBox.Show("修改卡密码失败:" + errorMsg);
  121. }
  122. else
  123. {
  124. MessageBox.Show("修改卡密码成功!");
  125. }
  126. }
  127. private void SearchAdmdvs()
  128. {
  129. JObject joAdmdvsInfo = new JObject();
  130. SearchAdmdvs Adm = new SearchAdmdvs();
  131. try
  132. {
  133. Global.pat.card.SearchAdmKey = cbCBD.Text;
  134. Adm.StartPosition = FormStartPosition.CenterParent;
  135. if (Adm.ShowDialog() == DialogResult.OK)
  136. {
  137. cbCBD.Text = Global.pat.card.SearchAdmName;
  138. }
  139. }
  140. catch (Exception ex)
  141. {
  142. MessageBox.Show("异常:" + ex.Message);
  143. return;
  144. }
  145. }
  146. private void cbCBD_DoEnter(object sender, EventArgs e)
  147. {
  148. SearchAdmdvs();
  149. }
  150. }
  151. }