Ejemplo n.º 1
0
        /*
         * methode that returns the latest 50 records from the fez board
         */
        public static List <TmpDataSet> ParseDateTmpResponse()
        {
            string url = "http://itwem.azurewebsites.net/GetTempStatus.ashx";

            Uri serviceUri = new Uri(url, UriKind.Absolute);


            HttpWebRequest webRequest = (HttpWebRequest)System.Net.WebRequest.Create(serviceUri);


            HttpWebResponse response     = (HttpWebResponse)webRequest.GetResponse();
            string          jsonResponse = string.Empty;
            StreamReader    sr           = new StreamReader(response.GetResponseStream());

            jsonResponse = sr.ReadToEnd();


            List <TmpDataSet> list = new List <TmpDataSet>();

            string[] words = jsonResponse.Split(';');
            foreach (string str in words)
            {
                string[]   strDateTmp = str.Split(',');
                TmpDataSet foo        = new TmpDataSet();
                foo.date = new DateTime(Convert.ToInt64(strDateTmp[0]));
                foo.tmp  = Convert.ToDouble(strDateTmp[0]);
                list.Add(foo);
            }
            return(list);
        }
Ejemplo n.º 2
0
        /*
         * methode that returns the latest 50 records from the fez board
         */
        public static List<TmpDataSet> ParseDateTmpResponse() {
            string url = "http://itwem.azurewebsites.net/GetTempStatus.ashx";

            Uri serviceUri = new Uri(url, UriKind.Absolute);


            HttpWebRequest webRequest = (HttpWebRequest)System.Net.WebRequest.Create(serviceUri);


            HttpWebResponse response = (HttpWebResponse)webRequest.GetResponse();
            string jsonResponse = string.Empty;
            StreamReader sr = new StreamReader(response.GetResponseStream());

            jsonResponse = sr.ReadToEnd();


            List<TmpDataSet> list = new List<TmpDataSet>();
            string[] words = jsonResponse.Split(';');
            foreach (string str in words) {
                string[] strDateTmp = str.Split(',');
                TmpDataSet foo = new TmpDataSet();
                foo.date = new DateTime(Convert.ToInt64(strDateTmp[0]));
                foo.tmp = Convert.ToDouble(strDateTmp[0]);
                list.Add(foo);
            }
            return list;
        }
Ejemplo n.º 3
0
 private void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
 {
     if (e.Error == null)
     {
         List <TmpDataSet> list  = new List <TmpDataSet>();
         string[]          words = e.Result.Split(';');
         foreach (string str in words)
         {
             string[]   strDateTmp = str.Split(',');
             TmpDataSet foo        = new TmpDataSet();
             foo.time = new DateTime(Convert.ToInt64(strDateTmp[0]));
             foo.tmp  = strDateTmp[1];
             list.Add(foo);
         }
         tempLogList1.ItemsSource = list;
     }
     else
     {
         tempLogList1.ItemsSource = e.Error.Message;
     }
 }
Ejemplo n.º 4
0
 private void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
 {
     if (e.Error == null)
     {
         List<TmpDataSet> list = new List<TmpDataSet>();
         string[] words = e.Result.Split(';');
         foreach (string str in words)
         {
             string[] strDateTmp = str.Split(',');
             TmpDataSet foo = new TmpDataSet();
             foo.time = new DateTime(Convert.ToInt64(strDateTmp[0]));
             foo.tmp = strDateTmp[1];
             list.Add(foo);
         }
         tempLogList1.ItemsSource = list;
     }
     else
     {
         tempLogList1.ItemsSource = e.Error.Message;
     }
 }