Пример #1
0
        public void GetForecastJSON()
        {
            if (_data == null)
            {
                var _data = MakeQuery();
            }
            else
            {
                if (dateTime < DateTime.Now)
                {
                    dateTime = DateTime.Now;
                    _data    = MakeQuery();
                }
            }
            JavaScriptSerializer js = new JavaScriptSerializer();

            Context.Response.Clear();
            //Context.Response.AppendHeader("Access-Control-Allow-Origin", "null");
            //Context.Response.AddHeader("Access-Control-Allow-Methods", "POST,GET,OPTIONS,PUT,DELETE");
            //Context.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Authorization, Accept");
            Context.Response.ContentType = "application/json";
            Context.Response.Write(js.Serialize(_data));

            //return new JavaScriptSerializer().Serialize(_data);
        }
Пример #2
0
        public string GetForecastJSON()
        {
            if (_data == null)
            {
                var _data = MakeQuery();
            }
            else
            {
                if (dateTime < DateTime.Now)
                {
                    dateTime = DateTime.Now;
                    _data    = MakeQuery();
                }
            }

            return(new JavaScriptSerializer().Serialize(_data));
        }
Пример #3
0
 public Thermals_today()
 {
     dateTime = DateTime.Now.Date;
     _data    = MakeQuery();
 }