ChooseCard.cs 4.4 KB

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