Beispiel #1
0
        public async Task <IActionResult> CloseLinkIncident(SimsSignalCloseLinkIncident closeLink)
        {
            try
            {
                await this.simsApp.Signals.CloseLinkIncident(closeLink);

                return(this.Ok());
            }
            catch (SIMSException ex)
            {
                return(BadRequest(ex));
            }
        }
 public Task CloseLinkIncident(SimsSignalCloseLinkIncident close)
 {
     if (close.SignalId == 0)
     {
         throw new SimsSignalMissingException("Signal id missing");
     }
     if (close.IncidentId == 0)
     {
         throw new SimsSignalMissingException("Incident id missing");
     }
     if (string.IsNullOrEmpty(close.ReasonNote))
     {
         throw new SimsSignalMissingException("Incident id missing");
     }
     return(dbHost.Signals.CloseLinkIncident(close.ReasonNote, close.SignalId, close.IncidentId));
 }