yangle
2024-07-11 39a43039bbb6491f33783fb675a111c61e749891
WebAPI/Controllers/²Ö´æ¹ÜÀí/ÁìÁÏ·¢»õ/Kf_MateOutBillController.cs
@@ -1,4 +1,5 @@
using DBUtility;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
@@ -21,13 +22,14 @@
        public DLL.ClsKf_MateOutBill BillOld0 = new DLL.ClsKf_MateOutBill();   //模具报废入库对应单据类
        #region ç”Ÿäº§é¢†æ–™å•列表
        [Route("Kf_MateOutBill/GetMateOutBillList")]
        [HttpGet]
        public object GetMateOutBillList(string sWhere,string user)
        {
            try
            {
                List<object> columnNameList = new List<object>();  //定义声明变量 ï¼ŒæŠŠé€šè¿‡ new List<object>()创建的 å®žä¾‹ï¼Œèµ‹å€¼ç»™å˜é‡
                //判断是否有查询权限
                if (!DBUtility.ClsPub.Security_Log("Kf_MateOutBillQuery", 1, false, user))
                {
@@ -39,13 +41,19 @@
                }
                ds = oCn.RunProcReturn("select * from h_v_IF_MateOutBillList_Search " + sWhere + " order by æ—¥æœŸ desc, hmainid desc", "h_v_IF_MateOutBillList_Search");
                foreach (DataColumn col in ds.Tables[0].Columns)//遍历ds中第一个表(Tables[0])的所有列(Columns)每次循环中,col变量会持有当前列的引用
                {
                    Type dataType = col.DataType; //获取当前数据类型传入 è‡ªå®šä¹‰å˜é‡datadataType
                    string ColmString = "{\"ColmCols\":\"" + col.ColumnName + "\",\"ColmType\":\"" + dataType.Name + "\"}"; //字符串拼接         // å°†åˆ—名和数据类型信息拼接成一个JSON格式的字符串
                    columnNameList.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 = columnNameList;
                return objJsonResult;
                //}
                //else