コード例 #1
0
ファイル: Program.cs プロジェクト: czzsharp/Sample
        /// <summary>
        /// 模拟产生接口数据
        /// </summary>
        /// <returns></returns>
        private static string GetJsonData()
        {
            List<ReportOnlineOut> listOutData = new List<ReportOnlineOut>();
            ReportOnlineOut Online = new ReportOnlineOut();
            Online.Date = DateTime.Now;
            Online.CityID = "1";
            Online.CityName = "杭州";
            Online.RegionID = "1"; ;
            Online.RegionName = "西湖区";
            Online.CompanyID = "1";
            Online.CompanyName = "星软集团";
            Online.CarNum = 200;
            Online.OnlineNum = 100;
            Online.OfflineNum = 100;
            listOutData.Add(Online);


            ReportOnlineOut online2 = new ReportOnlineOut();
            online2.Date = DateTime.Now;
            online2.CityID = "1";
            online2.CityName = "杭州";
            online2.RegionID = "2"; ;
            online2.RegionName = "拱墅区";
            online2.CompanyID = "2";
            online2.CompanyName = "拱墅区政府";
            online2.CarNum = 400;
            online2.OnlineNum = 200;
            online2.OfflineNum = 200;
            listOutData.Add(online2);

            return MyJSON.ToJSON(listOutData);
            //List<ReportOnlineOut> listTempData = MyJSON.ToObject<List<ReportOnlineOut>>(json);
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: RainSong/Sample
        /// <summary>
        /// 模拟产生接口数据
        /// </summary>
        /// <returns></returns>
        private static string GetJsonData()
        {
            List<ReportOnlineOut> listOutData = new List<ReportOnlineOut>();
            ReportOnlineOut Online = new ReportOnlineOut();
            Online.Date = DateTime.Now;
            Online.CityID = "1";
            Online.CityName = "杭州";
            Online.RegionID = "1"; ;
            Online.RegionName = "西湖区";
            Online.CompanyID = "1";
            Online.CompanyName = "星软集团";
            Online.CarNum = 200;
            Online.OnlineNum = 100;
            Online.OfflineNum = 100;
            listOutData.Add(Online);

            ReportOnlineOut online2 = new ReportOnlineOut();
            online2.Date = DateTime.Now;
            online2.CityID = "1";
            online2.CityName = "杭州";
            online2.RegionID = "2"; ;
            online2.RegionName = "拱墅区";
            online2.CompanyID = "2";
            online2.CompanyName = "拱墅区政府";
            online2.CarNum = 400;
            online2.OnlineNum = 200;
            online2.OfflineNum = 200;
            listOutData.Add(online2);

            return MyJSON.ToJSON(listOutData);
            //List<ReportOnlineOut> listTempData = MyJSON.ToObject<List<ReportOnlineOut>>(json);
        }