CenterResult.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using PTMedicalInsurance.Common;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.IO;
  8. using System.Linq;
  9. using System.Text;
  10. using System.Threading.Tasks;
  11. using System.Windows.Forms;
  12. namespace PTMedicalInsurance.Forms
  13. {
  14. public partial class CenterResult : Form
  15. {
  16. public string returnData;
  17. private string tradeNo;
  18. public CenterResult()
  19. {
  20. InitializeComponent();
  21. }
  22. private void btnCancel_Click(object sender, EventArgs e)
  23. {
  24. this.returnData = "{infcode:-1}";
  25. DialogResult = DialogResult.OK;
  26. Close();
  27. }
  28. public void setTradeNo(string no,string input)
  29. {
  30. this.tradeNo = no;
  31. this.txtInput.AppendText(input);
  32. this.label4.Text = string.Format("请输入【{0}】交易的返回结果:",no);
  33. }
  34. private void btnOK_Click(object sender, EventArgs e)
  35. {
  36. this.returnData = txtOutput.Text.Trim();
  37. DialogResult = DialogResult.OK;
  38. Close();
  39. }
  40. private void btnConfig_Click(object sender, EventArgs e)
  41. {
  42. // TODO: 可自动提供基线版JSON
  43. //JsonMappingForm form = new JsonMappingForm("",txtOutput.Text,tradeNo,false);
  44. //form.ShowDialog();
  45. }
  46. private void btnLoad_Click(object sender, EventArgs e)
  47. {
  48. txtOutput.Clear();
  49. txtOutput.AppendText(Utils.MockData(false,tradeNo));
  50. }
  51. private void CenterResult_Load(object sender, EventArgs e)
  52. {
  53. btnLoad_Click(sender,e);
  54. }
  55. private void btnSaveMock_Click(object sender, EventArgs e)
  56. {
  57. Utils.WriteMockData(false, tradeNo, txtOutput.Text);
  58. }
  59. }
  60. }