public JsonResult GetClData()
        {
            List<string> listString = new List<string>();
            string str = "002";
            //1.获取水质监测点的余氯值
            var meter = from m in db.METER
                        where m.Meter_Type == 3 || m.Meter_Type == 4
                        select m;
            var meter1 = meter.ToList();
            foreach(var m1 in meter1)
            {
                var m2 = m1.Station_Ke.ToString();
                var value0 = (from sh in db.BS_SCADA_TAG_HIS
                             where sh.Station_key == m2 && sh.Tag_key == str
                             orderby sh.Save_date descending
                             select sh).First();
                listString.Add(m1.ElementId.ToString());
                listString.Add(m1.Meter_Name);
                listString.Add(m1.Geo_x.ToString());
                listString.Add(m1.Geo_y.ToString());
                listString.Add(m1.Explain);
                listString.Add(value0.Tag_value.ToString());
                listString.Add(value0.Save_date.ToString());
            }
            DataContractJsonSerializer json = new DataContractJsonSerializer(listString.GetType());
            string szJson = "";
            using (MemoryStream stream = new MemoryStream())
            {
                json.WriteObject(stream, listString);
                szJson = Encoding.UTF8.GetString(stream.ToArray());
            }
            return Json(szJson);
        }

GitHub 加速计划 / js / json
41.72 K
6.61 K
下载
适用于现代 C++ 的 JSON。
最近提交(Master分支:1 个月前 )
960b763e 4 个月前
8c391e04 6 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐