コード例 #1
0
        public ActionResult QueryEquipRPTBySingleProject(ReportByProject item, Page page)
        {
            var apiUrl = string.Format("ProductionPlanning/QueryEquipRPTBySingleProjectAPI");
            HttpResponseMessage responMessage = APIHelper.APIPostAsync(item, page, apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            return(Content(result, "application/json"));
        }
コード例 #2
0
        public ActionResult QueryEquipRPTByFunc(ReportByProject item, Page page)
        {
            var apiUrl = string.Format("ProductionPlanning/QueryEquipRPTByFuncAPI");
            HttpResponseMessage responMessage = APIHelper.APIPostAsync(item, page, apiUrl);
            var result = responMessage.Content.ReadAsStringAsync().Result;

            var dt = JsonConvert.DeserializeObject <DataTable>(result) as DataTable;
            //获取动态列名
            List <string> columnList = new List <string>();

            for (int i = 0; i < dt.Columns.Count; i++)
            {
                var columnName = dt.Columns[i].ColumnName;
                if (columnName != "FunPlant" && columnName != "Equipment_Name")
                {
                    columnList.Add(columnName);
                }
            }
            var jsonName = JsonConvert.SerializeObject(columnList);
            var test     = "{\"columnList\":" + jsonName + "," + "\"data\":" + result + "}";

            return(Content(test, "application/json"));
        }