ChooseCard.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 MedicalInsurance.Common;
  12. namespace MedicalInsurance.Forms
  13. {
  14. public partial class ChooseCard : Form
  15. {
  16. public string cardType;
  17. public string businessType;
  18. public string ID;
  19. public ChooseCard()
  20. {
  21. InitializeComponent();
  22. }
  23. private void uiPanel2_Click(object sender, EventArgs e)
  24. {
  25. }
  26. private void btOk_Click(object sender, EventArgs e)
  27. {
  28. // 市医保密码860228
  29. cardType = "0" + (rbgCardType.SelectedIndex +1).ToString();
  30. businessType = "01" + cbBusinessType.Text.Substring(0,3);
  31. GlobalVariables.business_type = businessType;
  32. if (rbgCardType.SelectedIndex == 1)
  33. {
  34. if (tbID.Text == "")
  35. {
  36. ID = "";
  37. }
  38. else
  39. {
  40. ID = tbID.Text;
  41. }
  42. }
  43. DialogResult = DialogResult.OK;
  44. }
  45. private void ChooseCard_Load(object sender, EventArgs e)
  46. {
  47. rbgCardType.SelectedIndex = 0;
  48. cbBusinessType.SelectedIndex = 0;
  49. }
  50. private void rbgCardType_ValueChanged(object sender, int index, string text)
  51. {
  52. if (rbgCardType.SelectedIndex == 0)
  53. {
  54. cbBusinessType.Enabled = true;
  55. }
  56. else
  57. {
  58. cbBusinessType.Enabled = false;
  59. }
  60. if (rbgCardType.SelectedIndex == 1)
  61. {
  62. tbID.Enabled = true;
  63. tbName.Enabled = true;
  64. }
  65. else
  66. {
  67. tbID.Enabled = false;
  68. tbName.Enabled = false;
  69. }
  70. if (rbgCardType.SelectedIndex == 2)
  71. {
  72. cbCardType.SelectedIndex = 0;
  73. cbCardLevel.SelectedIndex = 2;
  74. cbCardType.Enabled = true;
  75. tbPassword.Enabled = true;
  76. //tbPassword.Text = "";
  77. }
  78. else
  79. {
  80. cbCardType.Enabled = false;
  81. tbPassword.Enabled = false;
  82. }
  83. }
  84. private void btCancle_Click(object sender, EventArgs e)
  85. {
  86. DialogResult = DialogResult.Cancel;
  87. }
  88. }
  89. }