/// <summary> /// Calculate the correct message to reinsert so the PTMH2H table is updated /// </summary> /// <param name="ptm"></param> /// <returns></returns> public void CalculateErrorReprocessing(OSUSR_UUK_PAXMSGS ptm, int n) { System.Nullable <DateTime> lastPTMDateTime = this.SearchLastPTMForFlight(ptm); if (lastPTMDateTime != null && ptm.TIMESTAMP != null && ((DateTime)ptm.TIMESTAMP).CompareTo((DateTime)lastPTMDateTime) > 0) { OSUSR_UUK_FLT_INFO flightInfoI = null; // Obtain list of message from Baggage table if (ptm.IFLTNR != null && ptm.IDATE != null) { flightInfoI = this.SearchFlightInfo(ptm.IFLTNR, ptm.IDATE, ptm.IORIGIN, this.hub); if (flightInfoI != null && flightInfoI.FLT_NR != null) { this.EngineUpdatePTMH2H(flightInfoI, (DateTime)ptm.TIMESTAMP); } else { throw new EngineProcessingException("PTM TTY messagen with unrecognized flight"); } } else { throw new EngineProcessingException("PTM TTY messagen with unrecognized flight"); } } }
/// <summary> /// Process PTM logic /// </summary> /// <param name="messageObject"></param> /// <param name="n"></param> public void ProcessPTMTTYEngine(Object messageObject, int n) { BagTMLog.LogDebug("BagTM Engine PTM TTY", this); // Only process message if is a baggage message if (messageObject.GetType() != typeof(OSUSR_UUK_PAXMSGS)) { throw new EngineProcessingException("Not a PTM message."); } OSUSR_UUK_PAXMSGS ptm = (OSUSR_UUK_PAXMSGS)messageObject; BagTMLog.LogDebug("BagTM Engine Search FlightInfoI and FlightInfoF", this); OSUSR_UUK_FLT_INFO flightInfoI = null; // Obtain list of message from Baggage table if (ptm.IFLTNR != null && ptm.IDATE != null) { flightInfoI = this.SearchFlightInfo(ptm.IFLTNR, ptm.IDATE, ptm.IORIGIN, this.hub); if (flightInfoI != null && flightInfoI.FLT_NR != null) { this.EngineUpdatePTMH2H(flightInfoI, (DateTime)ptm.TIMESTAMP); } else { throw new EngineProcessingException("PTM TTY messagen with unrecognized flight"); } } else { throw new EngineProcessingException("PTM TTY messagen with unrecognized flight"); } BagTMLog.LogDebug("BagTM Engine Baggage PTM TTY End", this); }
/// <summary> /// Search for last PTM date for the flight /// </summary> /// <param name="ptm"></param> /// <returns>System.Nullable<DateTime></returns> public System.Nullable <DateTime> SearchLastPTMForFlight(OSUSR_UUK_PAXMSGS ptm) { return(this.SearchLastPTMForFlight(ptm.IFLTNR, ptm.IDATE, ptm.IORIGIN, ptm.OFLTNR, ptm.ODATE, ptm.ODEST)); }