private static EventMessageCollection FillMessageCollection(IDataReader dr) { var arr = new EventMessageCollection(); try { EventMessage obj; while (dr.Read()) { //fill business object obj = FillMessage(dr, false); //add to collection arr.Add(obj); } } catch (Exception exc) { Exceptions.Exceptions.LogException(exc); } finally { //close datareader CBO.CloseDataReader(dr, true); } return(arr); }
public EventMessageCollection GetMessages( string eventName ) { EventMessageCollection oEventMessageCollection = new EventMessageCollection(); string[] EventMessageFiles; string EventMessageFile; string[] subscribers = new string[0]; if( EventQueueConfiguration.GetConfig().PublishedEvents[eventName] != null ) { subscribers = EventQueueConfiguration.GetConfig().PublishedEvents[eventName].Subscribers.Split( ";".ToCharArray() ); } else { subscribers[0] = ""; } for( int indx = 0; indx <= subscribers.Length - 1; indx++ ) { EventMessageFiles = Directory.GetFiles( m_messagePath, MessageName( eventName, subscribers[indx], "*" ) ); foreach( string tempLoopVar_EventMessageFile in EventMessageFiles ) { EventMessageFile = tempLoopVar_EventMessageFile; oEventMessageCollection.Add( DeserializeMessage( EventMessageFile, subscribers[indx] ) ); } } return oEventMessageCollection; }
public EventMessageCollection GetMessages(string eventName) { EventMessageCollection oEventMessageCollection = new EventMessageCollection(); string[] EventMessageFiles; string EventMessageFile; string[] subscribers = new string[0]; if (EventQueueConfiguration.GetConfig().PublishedEvents[eventName] != null) { subscribers = EventQueueConfiguration.GetConfig().PublishedEvents[eventName].Subscribers.Split(";".ToCharArray()); } else { subscribers[0] = ""; } for (int indx = 0; indx <= subscribers.Length - 1; indx++) { EventMessageFiles = Directory.GetFiles(m_messagePath, MessageName(eventName, subscribers[indx], "*")); foreach (string tempLoopVar_EventMessageFile in EventMessageFiles) { EventMessageFile = tempLoopVar_EventMessageFile; oEventMessageCollection.Add(DeserializeMessage(EventMessageFile, subscribers[indx])); } } return(oEventMessageCollection); }
public EventMessageCollection GetMessages(string eventName, string subscriberId) { EventMessageCollection oEventMessageCollection = new EventMessageCollection(); string[] EventMessageFiles; string EventMessageFile; EventMessageFiles = Directory.GetFiles(m_messagePath, MessageName(eventName, subscriberId, "*")); foreach (string tempLoopVar_EventMessageFile in EventMessageFiles) { EventMessageFile = tempLoopVar_EventMessageFile; oEventMessageCollection.Add(DeserializeMessage(EventMessageFile, subscriberId)); } return(oEventMessageCollection); }
private static EventMessageCollection FillMessageCollection(IDataReader dr) { var arr = new EventMessageCollection(); try { EventMessage obj; while (dr.Read()) { //fill business object obj = FillMessage(dr, false); //add to collection arr.Add(obj); } } catch (Exception exc) { Exceptions.Exceptions.LogException(exc); } finally { //close datareader CBO.CloseDataReader(dr, true); } return arr; }
public EventMessageCollection GetMessages( string eventName, string subscriberId ) { EventMessageCollection oEventMessageCollection = new EventMessageCollection(); string[] EventMessageFiles; string EventMessageFile; EventMessageFiles = Directory.GetFiles( m_messagePath, MessageName( eventName, subscriberId, "*" ) ); foreach( string tempLoopVar_EventMessageFile in EventMessageFiles ) { EventMessageFile = tempLoopVar_EventMessageFile; oEventMessageCollection.Add( DeserializeMessage( EventMessageFile, subscriberId ) ); } return oEventMessageCollection; }