Exemplo n.º 1
0
        public HeartbeatEntity GetDeviceInfomation(string deviceID)
        {
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(Properties.Settings.Default.StorageConnectionString);
            CloudTableClient    tableClient    = storageAccount.CreateCloudTableClient();

            CloudTable heartbeatTable = tableClient.GetTableReference("heartbeat");

            TableOperation searchOp = TableOperation.Retrieve <HeartbeatEntity>(deviceID.Substring(5), deviceID);
            TableResult    result   = heartbeatTable.Execute(searchOp);

            HeartbeatEntity resultboj = (HeartbeatEntity)result.Result;

            return(resultboj);
        }
Exemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            DataAccess      dac        = new DataAccess();
            HeartbeatEntity deviceInfo = dac.GetDeviceInfomation(textBox1.Text);

            if (deviceInfo == null)
            {
                MessageBox.Show("the device is not yet registered");
                return;
            }
            this.propertyGrid1.SelectedObject = deviceInfo;
            this.propertyGrid2.SelectedObject = deviceInfo.DeviceData;
            //MessageBox.Show(deviceInfo.LASTDATARECIEVED.ToLocalTime().ToString());
            //HeartbeatEntity deviceInfo = (dac.GetDeviceInfomation(textBox1.Text).Wait();
        }