private void History_Load(object sender, EventArgs e) { DatabaseConnertor database = new DatabaseConnertor(); database.connect(); realtimeHandler realtimeHandler = new realtimeHandler(); dgvHistory.DataSource = realtimeHandler.getAlldetails(database.getconn()); database.connect(); addPatientHandler addPatientHandler = new addPatientHandler(); dgvPatient.DataSource = addPatientHandler.getAllPatient(database.getconn()); }
private void timer1_Tick(object sender, EventArgs e) { DatabaseConnertor databaseConnertor = new DatabaseConnertor(); databaseConnertor.connect(); realtimeclass realtimeclass = new realtimeclass(); realtimeclass.P_id = int.Parse(pID.Text); realtimeclass.P_systolic = int.Parse(lbSys.Text); realtimeclass.P_diastolic = int.Parse(lbDia.Text); realtimeclass.P_breathing = int.Parse(lbBre.Text); realtimeclass.P_pulse = int.Parse(lbPul.Text); realtimeclass.P_temperature = int.Parse(lbTem.Text); realtimeHandler realtimeHandler = new realtimeHandler(); int recordCnt1 = realtimeHandler.addRealTime(databaseConnertor.getconn(), realtimeclass); bsrandomnum = random.Next(105, 145); bdrandomnum = random.Next(65, 100); prandomnum = random.Next(65, 75); //prandomnum = random.Next(0); brandomnum = random.Next(12, 20); trandomnum = random.Next(36, 37); lbSys.Text = bsrandomnum.ToString(); lbDia.Text = bdrandomnum.ToString(); lbPul.Text = prandomnum.ToString(); lbBre.Text = brandomnum.ToString(); lbTem.Text = trandomnum.ToString(); chart1.Series[0].Points.AddXY(bstime++, bsrandomnum); chart1.Series[0].Color = Color.LightGreen; chart1.Series[1].Points.AddXY(bdtime++, bdrandomnum); if (chart1.Series[0].Points.Count > 5) { chart1.Series[0].Points.Remove(chart1.Series[0].Points[0]); chart1.ChartAreas[0].AxisX.Minimum = chart1.Series[0].Points[0].XValue; chart1.ChartAreas[0].AxisX.Maximum = bstime; } chart2.Series[0].Points.AddXY(ptime++, prandomnum); chart2.Series[0].Color = Color.LightGreen; if (chart2.Series[0].Points.Count > 5) { chart2.Series[0].Points.Remove(chart2.Series[0].Points[0]); chart2.ChartAreas[0].AxisX.Minimum = chart2.Series[0].Points[0].XValue; chart2.ChartAreas[0].AxisX.Maximum = ptime; } chart3.Series[0].Points.AddXY(btime++, brandomnum); chart3.Series[0].Color = Color.LightGreen; if (chart3.Series[0].Points.Count > 5) { chart3.Series[0].Points.Remove(chart3.Series[0].Points[0]); chart3.ChartAreas[0].AxisX.Minimum = chart3.Series[0].Points[0].XValue; chart3.ChartAreas[0].AxisX.Maximum = btime; } chart4.Series[0].Points.AddXY(ttime++, trandomnum); chart4.Series[0].Color = Color.LightGreen; if (chart4.Series[0].Points.Count > 5) { chart4.Series[0].Points.Remove(chart4.Series[0].Points[0]); chart4.ChartAreas[0].AxisX.Minimum = chart4.Series[0].Points[0].XValue; chart4.ChartAreas[0].AxisX.Maximum = ttime; } if (lbPul.Text == "0") { timer.Stop(); // SoundPlayer player = new System.Media.SoundPlayer(); SoundPlayer player1 = new SoundPlayer(Properties.Resources.BedsideSoundss); player1.Play(); // player.Stop(); } else { System.Media.SoundPlayer player = new System.Media.SoundPlayer(Properties.Resources.BedsideSounds); player.Play(); } passingtext1 = lbSys.Text; passingtext2 = lbDia.Text; passingtext3 = lbPul.Text; passingtext4 = lbBre.Text; passingtext5 = lbTem.Text; passingtext6 = pID.Text; }