PatientInsuInfo.cs 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. using Newtonsoft.Json.Linq;
  11. using PTMedicalInsurance.Helper;
  12. using PTMedicalInsurance.Variables;
  13. using PTMedicalInsurance.Business;
  14. //using Microsoft.Office.Interop.Excel;
  15. namespace PTMedicalInsurance.Forms
  16. {
  17. public partial class PatientInsuInfo : Form
  18. {
  19. public DataTable dtInsuInfo;
  20. public DataTable dtIDInfo;
  21. public JObject joSelectedInsuInfo;
  22. public int insuInfoIndex = 0;
  23. public int idInfoIndex = 0;
  24. //1.声明自适应类实例
  25. AutoResizeForm asc = new AutoResizeForm();
  26. public PatientInsuInfo()
  27. {
  28. InitializeComponent();
  29. this.StartPosition = FormStartPosition.CenterParent;
  30. asc.controllInitializeSize(this);
  31. asc.controlAutoSize(this);
  32. }
  33. public PatientInsuInfo(JObject jo)
  34. {
  35. InitializeComponent();
  36. dtInsuInfo = (DataTable)jo["insuinfo"].ToObject(typeof(DataTable));
  37. dtIDInfo = (DataTable)jo["idetinfo"].ToObject(typeof(DataTable));
  38. JObject joBaseInfo = JObject.FromObject(jo["baseinfo"]);
  39. this.tbName.Text = joBaseInfo["psn_name"].ToString();
  40. this.tbPsnNO.Text = joBaseInfo["psn_no"].ToString();
  41. this.tbGend.Text = joBaseInfo["gend"].ToString();
  42. this.tbBirthDay.Text = joBaseInfo["brdy"].ToString();
  43. this.tbNaty.Text = joBaseInfo["naty"].ToString();
  44. this.tbCertType.Text = joBaseInfo["psn_cert_type"].ToString();
  45. this.tbCertNO.Text = joBaseInfo["certno"].ToString();
  46. this.tbAge.Text = joBaseInfo["age"].ToString();
  47. string expContent = joBaseInfo["exp_content"].ToString(); //字段扩展 只有居民返回
  48. //JObject joInsuInfo = JObject.FromObject(jo["insuinfo"]);
  49. //Global.pat.insuType= joInsuInfo["insutypeNo"].ToString();
  50. setDgvIDInfo();
  51. setDgvInsuInfo();
  52. dgvInsuInfo.DataSource = dtInsuInfo;
  53. dgvIDInfo.DataSource = dtIDInfo;
  54. }
  55. private void AddDGVColumn(DataGridView dgv, string headerText, string dataPropertyName, int width = 120)
  56. {
  57. DataGridViewColumn newColumn = new DataGridViewTextBoxColumn();
  58. newColumn.HeaderText = headerText;
  59. newColumn.Width = width;
  60. newColumn.DataPropertyName = dataPropertyName;
  61. newColumn.Name = dataPropertyName;
  62. dgv.Columns.Add(newColumn);
  63. }
  64. private void setDgvInsuInfo()
  65. {
  66. AddDGVColumn(dgvInsuInfo, "余额", "balc", 80);
  67. AddDGVColumn(dgvInsuInfo, "险种类型", "insutype",200);
  68. AddDGVColumn(dgvInsuInfo, "人员类别", "psn_type",100);
  69. AddDGVColumn(dgvInsuInfo, "人员参保状态", "psn_insu_stas");
  70. AddDGVColumn(dgvInsuInfo, "个人参保日期", "psn_insu_date");
  71. AddDGVColumn(dgvInsuInfo, "暂停参保日期", "paus_insu_date");
  72. AddDGVColumn(dgvInsuInfo, "公务员标志", "cvlserv_flag",80);
  73. AddDGVColumn(dgvInsuInfo, "参保地医保区划", "insuplc_admdvs");
  74. AddDGVColumn(dgvInsuInfo, "单位名称", "emp_name",300);
  75. AddDGVColumn(dgvInsuInfo, "险种类型编码", "insutypeNo", 150);
  76. dgvInsuInfo.ColumnHeadersDefaultCellStyle.Font = new Font("宋体", 9, FontStyle.Bold);
  77. dgvInsuInfo.ColumnHeadersHeight = 40;
  78. }
  79. private void setDgvIDInfo()
  80. {
  81. AddDGVColumn(dgvIDInfo, "人员身份类别", "psn_idet_type", 140);
  82. AddDGVColumn(dgvIDInfo, "人员类别等级", "psn_type_lv", 140);
  83. AddDGVColumn(dgvIDInfo, "备注", "memo", 150);
  84. AddDGVColumn(dgvIDInfo, "开始时间", "begntime", 200);
  85. AddDGVColumn(dgvIDInfo, "结束时间", "endtime", 200);
  86. dgvIDInfo.ColumnHeadersDefaultCellStyle.Font = new Font("宋体", 9, FontStyle.Bold);
  87. dgvIDInfo.ColumnHeadersHeight = 40;
  88. }
  89. private void uiButton1_Click(object sender, EventArgs e)
  90. {
  91. insuInfoIndex = dgvInsuInfo.CurrentRow.Index;
  92. if (dtIDInfo.Rows.Count != 0 )
  93. idInfoIndex = dgvIDInfo.CurrentRow.Index;
  94. joSelectedInsuInfo = new JObject();
  95. for (int i = 0; i < dtInsuInfo.Columns.Count; i++)
  96. {
  97. string key = dtInsuInfo.Columns[i].ColumnName;
  98. string value = dgvInsuInfo.CurrentRow.Cells[key].Value.ToString();
  99. joSelectedInsuInfo.Add(key, value);
  100. }
  101. DialogResult = DialogResult.OK;
  102. }
  103. private void uiButton2_Click(object sender, EventArgs e)
  104. {
  105. DialogResult = DialogResult.Cancel;
  106. }
  107. private void uiButton3_Click(object sender, EventArgs e)
  108. {
  109. string errorMsg = "";
  110. InvokeHelper invoker = new InvokeHelper();
  111. String sInput = JsonHelper.setCenterInpar("YH04", "");
  112. JObject joRtn= new JObject();
  113. joRtn=invoker.invokeCenterService("YH04", sInput);
  114. if (JsonHelper.parseCenterRtnValue(joRtn, out errorMsg) != 0)
  115. {
  116. MessageBox.Show("修改卡密码失败:" + errorMsg);
  117. }
  118. else
  119. {
  120. MessageBox.Show("修改卡密码成功!");
  121. }
  122. }
  123. }
  124. }