Exemple #1
0
        //alarm triggering
        public bool triggerAlarm(MySqlConnection conn, double value, int patientId, int readingId, int specificId, string remark)
        {
            bool         status          = false;
            DateTime     currentDateTime = DateTime.Now;
            AlarmHandler alarmHandler    = new AlarmHandler();
            Alarm        newAlarm        = new Alarm();

            newAlarm.PatientId       = patientId;
            newAlarm.ReadingId       = readingId;
            newAlarm.SpecificId      = specificId;
            newAlarm.TriggerValue    = value;
            newAlarm.DateTimeTrigger = currentDateTime;
            newAlarm.DateTimeMuted   = new DateTime(1001, 1, 1, 0, 0, 0);
            newAlarm.Remark          = remark;
            int result = alarmHandler.addNewAlarm(conn, newAlarm);

            if (result == 1)
            {
                status = true;
            }
            else
            {
                status = false;
            }

            return(status);
        }
Exemple #2
0
        //fetch patient alarm id
        public void FetchPatientAlarmId(ComboBox selectedcomboBox)
        {
            selectedcomboBox.Items.Add("--Select ID--");

            selectedcomboBox.SelectedIndex = 0;
            DBConnector dbC = new DBConnector();

            dbC.connect();
            AlarmHandler alarmhd   = new AlarmHandler();
            List <Alarm> alarmList = new List <Alarm>();

            alarmList = alarmhd.getAllAlarm(dbC.getConn());
            for (int i = 0; i < alarmList.Count; i++)
            {
                if ((alarmList[i].PatientId == 0))
                {
                    selectedcomboBox.Items.Add(alarmList[i].SpecificId);
                }
            }
        }