SettlementInfo.cs 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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.Variables;
  12. using PTMedicalInsurance.Business;
  13. using PTMedicalInsurance.Helper;
  14. namespace PTMedicalInsurance.Forms
  15. {
  16. public partial class SettlementInfo : Form
  17. {
  18. //1.声明自适应类实例
  19. AutoResizeForm asc = new AutoResizeForm();
  20. public DataTable dtSettlmentDetail;
  21. //险种
  22. public string insuType { get; set; }
  23. public SettlementInfo()
  24. {
  25. InitializeComponent();
  26. //this.StartPosition = FormStartPosition.CenterParent;
  27. asc.controllInitializeSize(this);
  28. asc.controlAutoSize(this);
  29. }
  30. public string DefutValue(string InValue)
  31. {
  32. string sRtn = "0";
  33. if (InValue == "")
  34. return sRtn;
  35. else
  36. return InValue;
  37. }
  38. public SettlementInfo(JObject jo)
  39. {
  40. InitializeComponent();
  41. JObject joSettlmentInfo = JObject.FromObject(jo["setlinfo"]);
  42. dtSettlmentDetail = (DataTable)jo["setldetail"].ToObject(typeof(DataTable));
  43. this.tbAdmCertType.Text = joSettlmentInfo["mdtrt_cert_type"].ToString();
  44. this.tbPsnCertType.Text = joSettlmentInfo["psn_cert_type"].ToString();
  45. this.tbPsnCertNO.Text = joSettlmentInfo["certno"].ToString();
  46. this.tbInsuType.Text = joSettlmentInfo["insutype"].ToString();
  47. this.tbPersonType.Text = joSettlmentInfo["psn_type"].ToString();
  48. this.tbMedType.Text = joSettlmentInfo["med_type"].ToString();
  49. this.tbSumamt.Text = joSettlmentInfo["medfee_sumamt"].ToString();
  50. this.tbFullOwnPay.Text = joSettlmentInfo["fulamt_ownpay_amt"].ToString();
  51. this.tbOverLimitOwnPay.Text = joSettlmentInfo["overlmt_selfpay"].ToString();
  52. this.tbPreSelfPay.Text = joSettlmentInfo["preselfpay_amt"].ToString();
  53. this.tbInScopyAmount.Text = joSettlmentInfo["inscp_scp_amt"].ToString();
  54. this.tbActualPayDeduLine.Text = joSettlmentInfo["act_pay_dedc"].ToString();
  55. this.tbInsuFundPay.Text = joSettlmentInfo["hifp_pay"].ToString();
  56. this.tbInsuFundPayRito.Text = joSettlmentInfo["pool_prop_selfpay"].ToString();
  57. this.tbCvlserv_pay.Text = joSettlmentInfo["cvlserv_pay"].ToString();
  58. this.tbHifes_pay.Text = joSettlmentInfo["hifes_pay"].ToString();
  59. this.tbHifmi_pay.Text = joSettlmentInfo["hifmi_pay"].ToString();
  60. this.tbWorkerLargeMedical.Text = joSettlmentInfo["hifob_pay"].ToString();
  61. this.tbAssian.Text = joSettlmentInfo["maf_pay"].ToString();
  62. this.tbOtherPay.Text = joSettlmentInfo["oth_pay"].ToString();
  63. this.tbFundPaySummat.Text = joSettlmentInfo["fund_pay_sumamt"].ToString();
  64. this.tbPsnSummat.Text = joSettlmentInfo["psn_part_amt"].ToString();
  65. this.tbPsnAccountPaySummat.Text = joSettlmentInfo["acct_pay"].ToString();
  66. this.tbPsnCashPay.Text = joSettlmentInfo["psn_cash_pay"].ToString();
  67. this.tbHospitalPartAmount.Text = joSettlmentInfo["hosp_part_amt"].ToString();
  68. this.tbBalc.Text = joSettlmentInfo["balc"].ToString();
  69. this.tbAccountMutualAidAmount.Text = joSettlmentInfo["acct_mulaid_pay"].ToString();
  70. this.tbClearingWay.Text = joSettlmentInfo["clr_way"].ToString();
  71. this.tbClearingType.Text = joSettlmentInfo["clr_type"].ToString();
  72. this.tbCommercialReimamt.Text = joSettlmentInfo["commercial_reimamt"].ToString();
  73. this.tbCommercialRenflag.Text = joSettlmentInfo["commercial_renflag"].ToString();
  74. if (joSettlmentInfo["exp_content"] != null && joSettlmentInfo["exp_content"].Type != JTokenType.Null)
  75. {
  76. JObject joExpContent = JObject.Parse(joSettlmentInfo["exp_content"].ToString());
  77. tbMedInsWalletBalance.Text = JsonHelper.getDestValue(joExpContent, "medIns_wallet_balance");
  78. tbMedInsWalletPay.Text = JsonHelper.getDestValue(joExpContent, "medIns_wallet_pay");
  79. }
  80. Global.Set.acctPay = joSettlmentInfo["acct_pay"].ToString();
  81. setDgvSettlDetailHeader();
  82. dgvSetlDetail.DataSource = dtSettlmentDetail;
  83. }
  84. private void AddDGVColumn(DataGridView dgv, string headerText, string dataPropertyName, int width = 120)
  85. {
  86. DataGridViewColumn newColumn = new DataGridViewTextBoxColumn();
  87. newColumn.HeaderText = headerText;
  88. newColumn.Width = width;
  89. newColumn.DataPropertyName = dataPropertyName;
  90. newColumn.Name = dataPropertyName;
  91. dgv.Columns.Add(newColumn);
  92. }
  93. private void setDgvSettlDetailHeader()
  94. {
  95. AddDGVColumn(dgvSetlDetail, "基金支付类型", "fund_pay_type", 80);
  96. AddDGVColumn(dgvSetlDetail, "符合政策范围金额", "inscp_scp_amt");
  97. AddDGVColumn(dgvSetlDetail, "本次可支付限额金额", "crt_payb_lmt_amt");
  98. AddDGVColumn(dgvSetlDetail, "基金支付金额", "fund_payamt");
  99. AddDGVColumn(dgvSetlDetail, "基金支付类型名称", "fund_pay_type_name", 300);
  100. AddDGVColumn(dgvSetlDetail, "结算过程信息", "setl_proc_info", 200);
  101. dgvSetlDetail.ColumnHeadersDefaultCellStyle.Font = new Font("宋体", 9, FontStyle.Bold);
  102. dgvSetlDetail.ColumnHeadersHeight = 40;
  103. }
  104. private void uiButton1_Click(object sender, EventArgs e)
  105. {
  106. decimal fYBZFJE, fYYCDJE, fJJZFJE;
  107. fYYCDJE = decimal.Parse(DefutValue(tbHospitalPartAmount.Text));
  108. fJJZFJE = decimal.Parse(DefutValue(tbFundPaySummat.Text));
  109. Global.Set.fZFY = tbSumamt.Text;
  110. Global.Set.fZHZFJE = DefutValue(tbPsnAccountPaySummat.Text);
  111. Global.Set.fYBZFJE = (fYYCDJE + fJJZFJE).ToString();
  112. DialogResult = DialogResult.OK;
  113. }
  114. private void uiButton2_Click(object sender, EventArgs e)
  115. {
  116. DialogResult = DialogResult.Cancel;
  117. }
  118. }
  119. }