private void verificaAlertas() { var ba = web.listAlertsBPs(da, dn); var ha = web.listAlertsHRs(da, dn); var sa = web.listAlertsSPOes(da, dn); // var al = web.listAlertas(da, dn); // enventos continuos e intermitentes warnings e critos List <Alertas> all = al.ToList(); foreach (Alertas item in all.Where((i => i.Date > dataU))) { MessageBox.Show(item.Tipo + " " + Environment.NewLine + "SNS:" + item.SNS + Environment.NewLine + "Name:" + item.FirstName + " " + item.LastName + Environment.NewLine + "Age:" + item.Alert + Environment.NewLine + "Date:" + item.Date + Environment.NewLine); } //Lista enventos criticos anytime List <BPs> bps = ba.Where(i => i.Value2 < 60).ToList(); List <HRs> hrs = ha.Where(i => i.Value < 30 || i.Value > 180).ToList(); List <SPOes> spo = sa.Where(i => i.Value < 80).ToList(); foreach (BPs item in bps.Where(i => i.Date > dataU)) { MessageBox.Show("Critical Alert! Limit Values " + Environment.NewLine + "SNS:" + item.SNS + Environment.NewLine + "Name:" + item.FirstName + " " + item.LastName + Environment.NewLine + "Age:" + item.Age + Environment.NewLine + "Type" + "Blood Pressure" + Environment.NewLine + "Value" + item.Value1 + "-" + item.Value2 + Environment.NewLine + "Date:" + item.Date + Environment.NewLine); } foreach (HRs item in hrs.Where(i => i.Date > dataU)) { MessageBox.Show("Critical Alert! Limit Values " + Environment.NewLine + "SNS:" + item.SNS + Environment.NewLine + "Name:" + item.FirstName + " " + item.LastName + Environment.NewLine + "Age:" + item.Age + Environment.NewLine + "Type" + "Heart Rate" + Environment.NewLine + "Value" + item.Value + Environment.NewLine + "Date:" + item.Date + Environment.NewLine); } foreach (SPOes item in spo.Where(i => i.Date > dataU)) { MessageBox.Show("Critical Alert! Limit Values " + Environment.NewLine + "SNS:" + item.SNS + Environment.NewLine + "Name:" + item.FirstName + " " + item.LastName + Environment.NewLine + "Age:" + item.Age + Environment.NewLine + "Type" + "Oxygen Saturation" + Environment.NewLine + "Value" + item.Value + Environment.NewLine + "Date:" + item.Date + Environment.NewLine); } //data da ultima vez que o programa correu dataU = DateTime.Now; Properties.Settings.Default.dataU = dataU; Properties.Settings.Default.Save(); }