Beispiel #1
0
        public ServerResponse<int> UpdateBuzzer(UpdateBuzzerModel model)
        {
            if (model == null)
                throw new Exception("Could not deserialize model!");

            //var nurse = Portal.Instance().VerifyPin(model.Pin);

            var patient = Portal.Instance().FindPatientById(model.PatientId);

            if (patient == null)
                return new ServerResponse<int>
                {
                    Success = false
                };

            patient.Buzzer = true;

            Portal.Instance().UpdatePatient(patient);

            var nurse = Portal.Instance().FindNurseById(model.NurseId);
            var name = nurse != null ? nurse.Name : "unknown";
            Portal.Instance()
                .Log(model.NurseId, "Buzzer was used on patient name = " + patient.Name + " by " + name);
            return new ServerResponse<int>();
        }
Beispiel #2
0
        public object UpdateBlinking(UpdateBuzzerModel model)
        {
            var patient = Portal.Instance().FindPatientById(model.PatientId);

            patient.Blink = true;

            Portal.Instance().UpdatePatient(patient);
            var nurse = Portal.Instance().FindNurseById(model.NurseId);
            var name = nurse != null ? nurse.Name : "unknown";
            Portal.Instance()
                .Log(model.NurseId, "blinking was used on patient name = " + patient.Name + " by " + name);

            return new { Success = true };
        }