Form1.cs 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. using Newtonsoft.Json.Linq;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  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 ChengDuMedInsu2
  13. {
  14. public partial class Form1 : Form
  15. {
  16. public Form1()
  17. {
  18. InitializeComponent();
  19. }
  20. dynamic Jo = new JObject();
  21. string HosptialID = "H51010604235", HospitalName = "成都普瑞眼科医院", signno = "", ErrorMessage = "", result = "";
  22. string CurrentPath;
  23. string LogName;
  24. private void button2_Click(object sender, EventArgs e)
  25. {
  26. }
  27. private void button3_Click(object sender, EventArgs e)
  28. {
  29. dynamic jo = new JObject();
  30. dynamic jo1 = new JObject();
  31. jo.ver = textBox3.Text;
  32. //jo.list_type = "";
  33. jo1.data = jo;
  34. string InParam = jo1.ToString();
  35. string funName = textBox2.Text;
  36. string InParm_A = GlobalVariables.SetJsonParam(funName, InParam);
  37. CenterServices Invoke = new CenterServices();
  38. GlobalVariables.writeLog("入参:" + InParm_A);
  39. string outParam = Invoke.Post(GlobalVariables.centerURL, InParm_A);
  40. GlobalVariables.writeLog("出参:" + outParam);
  41. JObject joRtn = (JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(outParam);
  42. string file_qury_no = (string)joRtn["output"]["file_qury_no"];
  43. string filename = (string)joRtn["output"]["filename"];
  44. JObject jo2 = new JObject(); JObject jo3 = new JObject();
  45. jo2["fixmedins_code"] = GlobalVariables.hospitalNO;
  46. jo2["file_qury_no"] = file_qury_no;
  47. jo2["filename"] = filename;
  48. jo3["fsDownloadIn"] = jo2;
  49. InParam = jo3.ToString();
  50. MessageBox.Show(InParam);
  51. InParm_A = GlobalVariables.SetJsonParam("9102", InParam);
  52. MessageBox.Show("2");
  53. GlobalVariables.writeLog("入参:" + InParm_A);
  54. Invoke.Download(GlobalVariables.centerURL, InParm_A);
  55. }
  56. private void button4_Click(object sender, EventArgs e)
  57. {
  58. signno = textBox1.Text;
  59. }
  60. private void Form1_Load(object sender, EventArgs e)
  61. {
  62. }
  63. Log Log;
  64. Common common = new Common();
  65. private void button1_Click(object sender, EventArgs e)
  66. {
  67. signno = textBox1.Text;
  68. dynamic jo = new JObject();
  69. dynamic jo1 = new JObject();
  70. jo.ver = "0";
  71. //jo.list_type = "";
  72. jo1.data = jo;
  73. string InParam = jo1.ToString();
  74. string url = "http://10.109.103.59:8080/mss/web/api/fsi/callService", InParm_A = GlobalVariables.SetJsonParam("1301", InParam);
  75. CurrentPath = System.Environment.CurrentDirectory + "\\Log";
  76. LogName = DateTime.Now.ToString("yyyy-MM-dd") + "_YW.Log";
  77. Log = new Log(CurrentPath, LogName);
  78. Log.Write("入参:" + InParam);
  79. Log.Write("Url:" + url);
  80. Log.Write("入参:" + InParm_A);
  81. CenterServices Invoke = new CenterServices();
  82. string outParam = Invoke.Post(url, InParm_A);
  83. Log.Write("出参:" + outParam);
  84. JObject joRtn = (JObject)Newtonsoft.Json.JsonConvert.DeserializeObject(outParam);
  85. MessageBox.Show(joRtn.ToString());
  86. string file_qury_no = (string)joRtn["output"]["file_qury_no"];
  87. string filename = (string)joRtn["output"]["filename"];
  88. JObject jo2 = new JObject(); JObject jo3 = new JObject();
  89. jo2["fixmedins_code"] = "H51010604235";
  90. jo2["file_qury_no"] = file_qury_no;
  91. jo2["filename"] = filename;
  92. jo3["fsDownloadIn"] = jo2;
  93. InParam = jo3.ToString();
  94. MessageBox.Show(InParam);
  95. InParm_A = GlobalVariables.SetJsonParam("9102", InParam);
  96. Log.Write("Url:" + url);
  97. Log.Write("入参:" + InParm_A);
  98. Invoke.Download(url, InParm_A);
  99. }
  100. }
  101. }