Ejemplo n.º 1
0
        public int addRealTime(MySqlConnection conn, realtimeclass realtimeclass)
        {
            string sql = "INSERT INTO patientrealtime (p_id, p_systolic, p_diastolic, p_breathing, p_pulse, p_temperature)"
                         + " VALUES (" + realtimeclass.P_id + "  ," + realtimeclass.P_systolic + "   , " + realtimeclass.P_diastolic
                         + "   , " + realtimeclass.P_breathing + "   , " + realtimeclass.P_pulse + "   , " + realtimeclass.P_temperature + ")";

            MySqlCommand sqlComm = new MySqlCommand(sql, conn);

            return(sqlComm.ExecuteNonQuery());
        }
Ejemplo n.º 2
0
        public List <realtimeclass> getAlldetails(MySqlConnection conn)
        {
            List <realtimeclass> listdetail = new List <realtimeclass>();
            string          sql             = "SELECT * FROM patientrealtime";
            MySqlCommand    sqlComm         = new MySqlCommand(sql, conn);
            MySqlDataReader myReader;

            myReader = sqlComm.ExecuteReader();
            while (myReader.Read())
            {
                realtimeclass realtimeclass = new realtimeclass();
                realtimeclass.Pm_id         = (int)myReader.GetValue(0);
                realtimeclass.P_id          = (int)myReader.GetValue(1);
                realtimeclass.P_systolic    = (int)myReader.GetValue(2);
                realtimeclass.P_diastolic   = (int)myReader.GetValue(3);
                realtimeclass.P_breathing   = (int)myReader.GetValue(4);
                realtimeclass.P_pulse       = (int)myReader.GetValue(5);
                realtimeclass.P_temperature = (int)myReader.GetValue(6);
                listdetail.Add(realtimeclass);
            }
            return(listdetail);
        }
Ejemplo n.º 3
0
        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;
        }