OutpatientRegistration.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. using Newtonsoft.Json;
  2. using Newtonsoft.Json.Linq;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.ComponentModel;
  6. using System.Data;
  7. using System.Drawing;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows.Forms;
  12. using PTMedicalInsurance.Common;
  13. using PTMedicalInsurance.Helper;
  14. using PTMedicalInsurance.Variables;
  15. namespace PTMedicalInsurance.Forms
  16. {
  17. public partial class OutpatientRegistration : Form
  18. {
  19. public OutpatientRegistration()
  20. {
  21. InitializeComponent();
  22. //字典类,目录类查询都用区域医保对应的接口目录DR
  23. string sqlCondition = " and A.Interface_Dr = '" + Global.inf.InsuRegionInterfaceDr.ToString() + "'";
  24. //险种
  25. string sqlStr = "SELECT B.Code,B.Descripts AS Name FROM HB_Dictionary A JOIN HB_DictionaryDataDetail B ON A.ID = B.HBDictionary_Dr WHERE A.InsuCode = 'ykb065'" + sqlCondition;
  26. SetDBLKCombox(ref dblkcbxInsuranceType, sqlStr);
  27. //医疗类别
  28. sqlStr = "SELECT B.Code,B.Descripts AS Name FROM HB_Dictionary A JOIN HB_DictionaryDataDetail B ON A.ID = B.HBDictionary_Dr WHERE A.InsuCode = 'aka130'" + sqlCondition;
  29. SetDBLKCombox(ref dblkcbxMedicalType, sqlStr);
  30. personAccountUsedFlag = "1";
  31. Global.pat.payByQrCode = false;
  32. }
  33. private DataTable dtDisease;
  34. private DataTable dtInsuranceType;
  35. private DataTable dtMedicalType;
  36. //险种
  37. public string insuType { get; set; }
  38. public string insuTypeName { get; set; }
  39. //医疗类别
  40. public string med_type { get; set; }
  41. public string med_type_name { get; set; }
  42. public DataTable DtDiagnose { get; set; }
  43. public string personAccountUsedFlag = "0";
  44. private DataTable GetDBLKComboxTable(string sqlStr)
  45. {
  46. InvokeHelper invoker = new InvokeHelper();
  47. dynamic joInparm = new JObject();
  48. dynamic joTmp = new JObject();
  49. joTmp.sqlStr = sqlStr;
  50. JArray jaParams = new JArray();
  51. jaParams.Add(joTmp);
  52. joInparm.Add("params", JArray.FromObject(jaParams));
  53. joInparm.code = "09010014";
  54. string inParam = joInparm.ToString();
  55. JObject joRtn = invoker.invokeInsuService(inParam,"获取下拉框消息");
  56. //dynamic jsonRtn = JsonConvert.DeserializeObject(strRtn);
  57. DataTable dt = (DataTable)joRtn["result"].ToObject(typeof(DataTable));
  58. //dt.Columns[0].ColumnName = "编码";
  59. //dt.Columns[1].ColumnName = "名称";
  60. //dt.Columns[2].ColumnName = "拼音查找码";
  61. return dt;
  62. }
  63. private void SetDBLKCombox(ref PTControl.DBLookupCombox dblcbx, string sqlStr)
  64. {
  65. dblcbx.sDisplayField = "Code,Name,SearchCode";
  66. dblcbx.sDisplayMember = "名称";
  67. dblcbx.sKeyWords = "Code,SearchCode";
  68. dblcbx.DataSource = GetDBLKComboxTable(sqlStr);
  69. dblcbx.RowFilterVisible = true;
  70. dblcbx.TextBox.Width = 400;
  71. dblcbx.DataGridView.Width = 400;
  72. dblcbx.DataGridView.Columns[0].Name = "编码";
  73. dblcbx.DataGridView.Columns[1].Name = "名称";
  74. dblcbx.DataGridView.Columns[2].Name = "查找码";
  75. dblcbx.DataGridView.Columns[0].Width = 100;
  76. dblcbx.DataGridView.Columns[1].Width = 200;
  77. }
  78. private void OutpatientRegistration_Load(object sender, EventArgs e)
  79. {
  80. dgvDiagnose.AutoGenerateColumns = false;
  81. dgvDiagnose.DataSource = DtDiagnose;
  82. //DtDiagnose.AcceptChanges();
  83. dgvDiagnose.ReadOnly = true;
  84. }
  85. private void button1_Click_1(object sender, EventArgs e)
  86. {
  87. if (cbxQrCodePay.Checked)
  88. {
  89. Global.pat.payByQrCode = true;
  90. }
  91. Global.pat.patExtend.isMutualAid = cbMutualAid.Checked;
  92. this.DialogResult = DialogResult.OK;
  93. }
  94. private void dblkcbxInsuranceType_AfterSelector(object sender, PTControl.AfterSelectorEventArgs e)
  95. {
  96. DataGridViewRow row = e.Value as DataGridViewRow;
  97. DataRowView dataRow = row.DataBoundItem as DataRowView;
  98. insuType = dataRow["Code"].ToString().Trim();
  99. insuTypeName = dataRow["Name"].ToString().Trim();
  100. }
  101. private void dblkcbxMedicalType_AfterSelector(object sender, PTControl.AfterSelectorEventArgs e)
  102. {
  103. DataGridViewRow row = e.Value as DataGridViewRow;
  104. DataRowView dataRow = row.DataBoundItem as DataRowView;
  105. med_type = dataRow["Code"].ToString().Trim();
  106. med_type_name = dataRow["Name"].ToString().Trim();
  107. Global.pat.medType = med_type;
  108. }
  109. private void button2_Click(object sender, EventArgs e)
  110. {
  111. this.DialogResult = DialogResult.Cancel;
  112. }
  113. }
  114. }