ChooseCard.cs 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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. private void uiButton1_Click(object sender, EventArgs e)
  105. {
  106. string sInput = "", errorMsg="";
  107. JObject joData = new JObject();
  108. joData.Add("", "");
  109. JObject joInput = new JObject();
  110. joInput.Add("data", joData);
  111. InvokeHelper invoker = new InvokeHelper();
  112. // 重庆为1163?
  113. sInput = JsonHelper.setCenterInpar("1193", "");
  114. JObject joRtn =invoker.invokeCenterService("1193", sInput);
  115. if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)
  116. {
  117. MessageBox.Show("修改卡密码失败:" + errorMsg);
  118. }
  119. else
  120. {
  121. MessageBox.Show("修改卡密码成功!");
  122. }
  123. }
  124. private void SearchAdmdvs()
  125. {
  126. JObject joAdmdvsInfo = new JObject();
  127. SearchAdmdvs Adm = new SearchAdmdvs();
  128. try
  129. {
  130. Global.pat.card.SearchAdmKey = cbCBD.Text;
  131. Adm.StartPosition = FormStartPosition.CenterParent;
  132. if (Adm.ShowDialog() == DialogResult.OK)
  133. {
  134. cbCBD.Text = Global.pat.card.SearchAdmName;
  135. }
  136. }
  137. catch (Exception ex)
  138. {
  139. MessageBox.Show("异常:" + ex.Message);
  140. return;
  141. }
  142. }
  143. private void cbCBD_DoEnter(object sender, EventArgs e)
  144. {
  145. SearchAdmdvs();
  146. }
  147. }
  148. }