安睿特接口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
4.2 KiB

using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using XS_BLL;
using XS_DAL;
using XS_Model;
namespace XS_HttpServer_LR
{
public partial class InterfaceLog : Form
{
public string InterfaceLogId;
public InterfaceLog(string dec_id)
{
InitializeComponent();
InterfaceLogId = dec_id;
}
private void InterfaceLog_Load(object sender, EventArgs e)
{
IO_INTERFACE_LOG model = new IO_INTERFACE_LOG();
DataTable dt = DBOperator.GetTableSql($"select top 1000 * from IO_INTERFACE_LOG where INTERFACE_ID = {InterfaceLogId}");
if (dt != null && dt.Rows.Count > 0)
{
this.txt_INTERFACE_ID.Text = dt.Rows[0]["INTERFACE_ID"].ToString();
this.txt_INTERFACE_FLOW.Text = dt.Rows[0]["INTERFACE_FLOW"].ToString();
this.txt_INTERFACE_DATETIME.Text = dt.Rows[0]["INTERFACE_DATETIME"].ToString();
this.txt_INTERFACE_NAME.Text = dt.Rows[0]["INTERFACE_NAME"].ToString();
this.txt_INTERFACE_MENO.Text = dt.Rows[0]["INTERFACE_MENO"].ToString();
//this.rtb_INTERFACE_REQUEST.Text = dt.Rows[0]["INTERFACE_REQUEST"].ToString();
//this.rtb_INTERFACE_REQUEST.Text = UtilityBLL.JsonToString(dt.Rows[0]["INTERFACE_REQUEST"].ToString());
this.rtb_INTERFACE_REQUEST.Text = conversion(dt.Rows[0]["INTERFACE_REQUEST"].ToString());// UtilityBLL.JsonToString(dt.Rows[0]["INTERFACE_REQUEST"].ToString());
//this.rtb_INTERFACE_FEEDBACK.Text = dt.Rows[0]["INTERFACE_FEEDBACK"].ToString();
//this.rtb_INTERFACE_FEEDBACK.Text = UtilityBLL.JsonToString(dt.Rows[0]["INTERFACE_FEEDBACK"].ToString());
this.rtb_INTERFACE_FEEDBACK.Text = conversion(dt.Rows[0]["INTERFACE_FEEDBACK"].ToString()); ;
}
}
public string conversion(string txt)
{
try
{
string text1 = txt;
string[] aaaa = text1.Split(new string[] { "\\r\\n" }, StringSplitOptions.None);
string txt2 = "";
for (int i = 0; i < aaaa.Length; i++)
{
string json = text1;
int stat = aaaa[i].IndexOf("{");
int end = aaaa[i].LastIndexOf("}");
int leng = aaaa[i].Length;
if (stat >= 0 && end >= 0)
{
if (stat == 0)
{
string temp = aaaa[i].Substring(stat, end + 1);
if (temp.StartsWith("{") && temp.EndsWith("}"))//传入的json串
{
txt2 += "\r\n" + UtilityBLL.JsonToString(temp);
}
if (aaaa[i].Length > end)
{
txt2 += "\r\n" + aaaa[i].Substring(end + 1, aaaa[i].Length - end - 1);
}
}
else
{
txt2 += "\r\n" + aaaa[i].Substring(0, stat);
string temp = aaaa[i].Substring(stat, end - stat + 1);
if (temp.StartsWith("{") && temp.EndsWith("}"))//传入的json串
{
txt2 += "\r\n" + UtilityBLL.JsonToString(temp);
}
if (aaaa[i].Length > end + 1)
{
txt2 += "\r\n" + aaaa[i].Substring(end + 1, aaaa[i].Length - end - 1);
}
}
}
else
{
txt2 += "\r\n" + aaaa[i];
}
txt2 += "\r\n";
}
return txt2;
}
catch (Exception)
{
return txt;
}
}
}
}