Esempio n. 1
0
        public (bool, string) CloseIncident(Incident incident)
        {
            closeIncident closeIncident = new closeIncident();

            closeIncident.Message = GetMessage(incident);
            closeIncident.IncidentIdentification = new IdentificationType
            {
                Identification       = incident.ID.ToString(),
                IdentificationSchema = "UUID"
            };

            ppjInterfaceClient client = GetClient();

            var securityHeader = new SecurityHeaderType();
            var header         = new Header();
            var response       = client.closeIncident(ref securityHeader, ref header, closeIncident);

            if (response.Error != null)
            {
                return(response.Type == ControlType.POSITIVE, response.Error.Description);
            }
            else
            {
                return(response.Type == ControlType.POSITIVE, "");
            }
        }
Esempio n. 2
0
        public string CheckIAmAlive()
        {
            IAmAlive alive = new IAmAlive()
            {
                IAmAlive1 = new IAmAliveType()
                {
                    IAmAlive = true,
                    Reason   = ""
                }
            };

            var securityHeader = new SecurityHeaderType();
            var header         = new Header();

            ppjInterfaceClient client = GetClient();

            IAmAlive response = client.IAmAlive(ref securityHeader, ref header, alive);

            if (response.IAmAlive1 != null)
            {
                //return WriteIAmAliveToListBox(response);
                return(response.IAmAlive1.Reason);
            }
            else
            {
                return("Ingen svar fra kontrolrum - IAmAlive");
            }
        }
Esempio n. 3
0
        public (bool, string) UpdateJournal(Journal journal)
        {
            updateJournal updateJournal = new updateJournal();

            updateJournal.Message = GetMessage(journal.Incident);

            updateJournal.Journal = new JournalType();

            updateJournal.Journal.Identification               = GetJournalType(journal).Identification;
            updateJournal.Journal.Patient                      = new PatientType();
            updateJournal.Journal.Patient.FirstName            = journal.Name;
            updateJournal.Journal.Patient.LastName             = journal.Lastname;
            updateJournal.Journal.Patient.SocialSecurityNumber = journal.Cpr;
            updateJournal.Journal.IncidentIdentification       = GetIncidentType(journal.Incident).Identification;

            ppjInterfaceClient client = GetClient();

            var securityHeader = new SecurityHeaderType();
            var header         = new Header();
            var response       = client.updateJournal(ref securityHeader, ref header, updateJournal);

            if (response.Error != null)
            {
                return(response.Type == ControlType.POSITIVE, response.Error.Description);
            }
            else
            {
                return(response.Type == ControlType.POSITIVE, "");
            }
        }
Esempio n. 4
0
        public (bool, string) UpdateTask(Preparedness preparedness)
        {
            updateTask updateTask = new updateTask
            {
                Message            = GetMessage(preparedness.Incident),
                TaskIdentification = GetTaskType(preparedness).Identification,
                Task = new TaskType
                {
                    IncidentIdentification = GetIncidentType(preparedness.Incident).Identification,
                }
            };

            updateTask.Task.Identification = GetTaskType(preparedness).Identification;

            updateTask.Task.Vehicle = GetTaskType(preparedness).Vehicle;

            updateTask.Task.PriorityToIncident = preparedness.EmergencyCode.Code;

            //Status for Task
            updateTaskStatus updateTaskStatus = new updateTaskStatus
            {
                TaskIdentification = GetTaskType(preparedness).Identification,
                Message            = GetMessage(preparedness.Incident),
                Status             = new TaskStatusType
                {
                    Code = GetConvertedEnums(preparedness),
                    Time = DateTime.UtcNow.ToString("yyyy'-'MM'-'ddTHH':'mm':'ss':'fff")
                }
            };

            ppjInterfaceClient client = GetClient();

            var securityHeader = new SecurityHeaderType();
            var header         = new Header();

            var response           = client.updateTask(ref securityHeader, ref header, updateTask);
            var tastStatusResponse = client.updateTaskStatus(ref securityHeader, ref header, updateTaskStatus);

            if (response.Error != null || tastStatusResponse.Error != null)
            {
                return(response.Type == ControlType.POSITIVE, response.Error.Description);
            }
            else
            {
                return(response.Type == ControlType.POSITIVE, "");
            }
        }
Esempio n. 5
0
        public (bool, string) CloseTask(Preparedness preparedness)
        {
            closeTask closeTask = new closeTask
            {
                Message            = GetMessage(preparedness.Incident),
                TaskIdentification = GetTaskType(preparedness).Identification
            };

            ppjInterfaceClient client = GetClient();

            var securityHeader = new SecurityHeaderType();
            var header         = new Header();
            var response       = client.closeTask(ref securityHeader, ref header, closeTask);

            if (response.Error != null)
            {
                return(response.Type == ControlType.POSITIVE, response.Error.Description);
            }
            else
            {
                return(response.Type == ControlType.POSITIVE, "");
            }
        }
Esempio n. 6
0
        public (bool, string) UpdateIncident(Incident incident)
        {
            updateIncident updateIncident = new updateIncident
            {
                Message  = GetMessage(incident),
                Incident = new IncidentType()
            };

            updateIncident.Incident = GetIncidentType(incident);

            updateIncident.Incident.Address = new Address
            {
                StreetName  = incident.Address,
                HouseNumber = incident.Number,
                City        = incident.City,
                ZipCode     = incident.PostNr,
            };

            updateIncident.Incident.IncidentDescription = incident.Description;

            ppjInterfaceClient client = GetClient();

            var securityHeader = new SecurityHeaderType();
            var header         = new Header();
            var response       = client.updateIncident(ref securityHeader, ref header, updateIncident);

            if (response.Error != null)
            {
                //Return the code in ServiceLog in DB and message for the log
                return(response.Type == ControlType.POSITIVE, response.Error.Description);
            }
            else
            {
                //Return the code in ServiceLog in DB and message for the log
                return(response.Type == ControlType.POSITIVE, "");
            }
        }