yangle
2024-07-11 fb4349497ef239dab5cd97bb6de79ace28102d5c
WebAPI/Controllers/QC_ManagementController.cs
@@ -9,6 +9,7 @@
using System.Data;
using Newtonsoft.Json.Linq;
using Pub_Class;
using Newtonsoft.Json;
namespace WebAPI.Controllers
{
@@ -33,12 +34,21 @@
        {
            try
            {
                List<object> a = new List<object>();
                //添加列名
                foreach (DataColumn col in ds.Tables[0].Columns)
                {
                    Type dataType = col.DataType;
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}";
                    a.Add(JsonConvert.DeserializeObject(ColmString));//获取到DataColumn列对象的列名
                }
                //if (ds.Tables[0].Rows.Count != 0 || ds != null)
                //{
                objJsonResult.code = "1";
                objJsonResult.count = 1;
                objJsonResult.Message = "Sucess!";
                objJsonResult.data = ds.Tables[0];
                objJsonResult.list = a;
                return objJsonResult;
                //}
                //else