public static List <Configuration> GetMessagePosition(MessageGroupInstance messageGroupInstance) { List <Configuration> configurations = new List <Configuration>(); SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.SERVICE_VIEW_GET_MESSAGE_POSITION; command.Parameters.AddWithValue(ConfigurationDAO.AT_MESSAGE_GROUP_INSTANCE_ID, messageGroupInstance.id); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { configurations.Add(new Configuration(reader, Configuration.View.GetMessagePosition)); } } } catch (Exception e) { ErrorLogger.LogError(e, "getMessagePosition(MessageGroupInstance messageGroupInstance)", messageGroupInstance.id.ToString()); } } return(configurations); }
public static List <Configuration> getApplications() { List <Configuration> configurations = new List <Configuration>(); SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.SERVICE_VIEW_GET_ALL_APPLICATION_CONFIG; try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { configurations.Add(new Configuration(reader, Configuration.View.GetApplicationConfiguration)); } } } catch (Exception e) { ErrorLogger.LogError(e, "getSingleApplication(Application application)", "-9"); } } return(configurations); }
public static List <Configuration> GetWebserviceObjectProperties(WebserviceObject webserviceObject) { List <Configuration> configurations = new List <Configuration>(); SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.SERVICE_VIEW_GET_WEBSERVICE_PROPERTIES; command.Parameters.AddWithValue(ConfigurationDAO.AT_WEBSERVICE_OBJECT_ID, webserviceObject.id); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { configurations.Add(new Configuration(reader, Configuration.View.GetWebserviceObjectProperties)); } } } catch (Exception e) { ErrorLogger.LogError(e, "GetWebserviceObjectProperties(WebserviceObject webserviceObject)", webserviceObject.id.ToString()); } } return(configurations); }
public static List <Configuration> GetDatabaseColumns(DatabaseTable databaseTable) { List <Configuration> configurations = new List <Configuration>(); SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.SERVICE_VIEW_GET_DATABASE_COLUMNS; command.Parameters.AddWithValue(ConfigurationDAO.AT_DATABASE_TABLE_ID, databaseTable.id); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { configurations.Add(new Configuration(reader, Configuration.View.GetDatabaseColumns)); } } } catch (Exception e) { ErrorLogger.LogError(e, "getDatabaseColumns(DatabaseTable databaseTable)", databaseTable.id.ToString()); } } return(configurations); }
public static List <Configuration> GetInterfaceConfigration(Communication communucation) { List <Configuration> configurations = new List <Configuration>(); SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.SERVICE_VIEW_GET_APPLICATION_INTERFACE_CONFIG; command.Parameters.AddWithValue(ConfigurationDAO.AT_COMMUNICATION_ID, communucation.id); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { configurations.Add(new Configuration(reader, Configuration.View.GetApplicationInterfaceConfig)); } } } catch (Exception e) { ErrorLogger.LogError(e, "getInterfaceConfigration(Communication communucation)", communucation.id.ToString()); } } return(configurations); }
private static List <DatabaseTable> getDatabaseTables() { List <DatabaseTable> databaseTables = new List <DatabaseTable>(); SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.GET_ALL_DATABASE_TABLE; try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { databaseTables.Add(new DatabaseTable(reader)); } } } catch (Exception e) { ErrorLogger.LogError(e, "getDatabaseTables()"); } } return(databaseTables); }
private static bool deleteWebservicePropertySet(WebservicePropertySet WebservicePropertySet) { SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.DELETE_WEBSERVICE_PROPERTY_SET; command.Parameters.AddWithValue(WebservicePropertySetDAO.AT_ID, WebservicePropertySet.id); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { WebservicePropertySet.id = DAOUtility.GetData <int>(reader, WebservicePropertySetDAO.ID); } } } catch (Exception e) { ErrorLogger.LogError(e, "DeleteWebservicePropertySet()", WebservicePropertySet.name); } } return(true); }
public static MessageLog insertIntoMessageLog(MessageLog messageLog) { SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.StoredProcedure; command.CommandText = das.POST_MESSAGE_LOG_PROCEDURE; command.Parameters.AddWithValue(MessageLogDAO.AT_MESSAGE_ID, messageLog.messageId); command.Parameters.AddWithValue(MessageLogDAO.AT_MESSAGE_LOG_TYPE_ID, messageLog.messageLogTypeId); command.Parameters.AddWithValue(MessageLogDAO.AT_CREATED_DTTM, messageLog.createdDttm); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { messageLog = new MessageLog(reader); } } } catch (Exception e) { ErrorLogger.LogError(e, "insertIntoMessageLog(MessageLog messageLog)", messageLog.messageId.ToString()); } } return(messageLog); }
private static List <Broker> getSingleBroker(Broker broker) { List <Broker> brokers = new List <Broker>(); SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.GET_SINGLE_BROKER; command.Parameters.AddWithValue(BrokerDAO.AT_ID, broker.id); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { brokers.Add(new Broker(reader)); } } } catch (Exception e) { ErrorLogger.LogError(e, "getSingleBroker(Broker broker)", broker.id.ToString()); } } return(brokers); }
private static List <Application> getSingleApplication(Application application) { List <Application> applications = new List <Application>(); SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.GET_SINGLE_APPLICATION; command.Parameters.AddWithValue(ApplicationDAO.AT_ID, application.id); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { applications.Add(new Application(reader)); } } } catch (Exception e) { ErrorLogger.LogError(e, "getSingleApplication(Application application)", application.id.ToString()); } } return(applications); }
private static List <WebserviceObject> getWebserviceObjects() { List <WebserviceObject> webserviceObjects = new List <WebserviceObject>(); SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.GET_ALL_WEBSERVICE_OBJECT; try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { webserviceObjects.Add(new WebserviceObject(reader)); } } } catch (Exception e) { ErrorLogger.LogError(e, "getWebserviceObjects()"); } } return(webserviceObjects); }
private static CommunicationType postUpdateCommunicationType(CommunicationType communicationType) { SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.StoredProcedure; command.CommandText = das.PUT_COMMUNICATION_TYPE; command.Parameters.AddWithValue(CommunicationTypeDAO.AT_NAME, communicationType.name); command.Parameters.AddWithValue(CommunicationTypeDAO.AT_ID, communicationType.id); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { communicationType.id = DAOUtility.GetData <int>(reader, CommunicationTypeDAO.ID); } } } catch (Exception e) { ErrorLogger.LogError(e, "postUpdateCommunicationType()", communicationType.id.ToString()); } } return(communicationType); }
private static List <CommunicationType> getSingleCommunicationType(CommunicationType communicationType) { List <CommunicationType> communicationTypes = new List <CommunicationType>(); SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.GET_SINGLE_COMMUNICATION_TYPE; command.Parameters.AddWithValue(CommunicationTypeDAO.AT_ID, communicationType.id); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { communicationTypes.Add(new CommunicationType(reader)); } } } catch (Exception e) { ErrorLogger.LogError(e, "getSingleCommunicationType(CommunicationType CommunicationType)", communicationType.id.ToString()); } } return(communicationTypes); }
private static bool risResendAllMissing() { // set the flag which determines the reprocess bool isProcessed = false; try { SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.StoredProcedure; command.CommandText = das.EXTERNAL_REPROCESS_RIS_REPORT; command.Parameters.AddWithValue(MessageBucketDAO.AT_ACCESSION_NO, DBNull.Value); command.ExecuteNonQuery(); isProcessed = true; } } catch (Exception e) { ErrorLogger.LogError(e, "BrokerDAO.risResendSpecificaReport()"); } return(isProcessed); }
private static List <Communication> getCommunications() { List <Communication> communications = new List <Communication>(); SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.GET_ALL_COMMUNICATION; try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { communications.Add(new Communication(reader)); } } } catch (Exception e) { ErrorLogger.LogError(e, "getCommunications()"); } } return(communications); }
public static List <Broker> GetBrokerWorklist() { List <Broker> brokers = new List <Broker>(); SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.SERVICE_VIEW_GET_BROKER_WORKLIST; try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { brokers.Add(new Broker(reader, true)); } } } catch (Exception e) { ErrorLogger.LogError(e, "GetBrokerWorklist()"); } } return(brokers); }
private static List <Interface> getSingleInterface(Interface _interface) { List <Interface> _interfaces = new List <Interface>(); SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.GET_SINGLE_INTERFACE; command.Parameters.AddWithValue(InterfaceDAO.AT_ID, _interface.id); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { _interfaces.Add(new Interface(reader)); } } } catch (Exception e) { ErrorLogger.LogError(e, "getSingleInterface(Interface Interface)", _interface.id.ToString()); } } return(_interfaces); }
private static bool deleteApplication(Application application) { SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.DELETE_APPLICATION; command.Parameters.AddWithValue(ApplicationDAO.AT_ID, application.id); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { application.id = DAOUtility.GetData <int>(reader, ApplicationDAO.ID); } } } catch (Exception e) { ErrorLogger.LogError(e, "DeleteApplication()", application.name); } } return(true); }
private static void updateLastMessageStats(Broker broker) { SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); try { using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { SqlCommand command = new SqlCommand(); conn.Open(); command.Connection = conn; command.CommandText = das.UPDATE_MESSAGE_STATS; command.CommandType = System.Data.CommandType.StoredProcedure; command.Parameters.AddWithValue(BrokerDAO.AT_LAST_MESSAGE_ID, broker.lastMessageId); command.Parameters.AddWithValue(BrokerDAO.AT_LAST_MESSAGE_DTTM, broker.lastMessageDTTM); command.Parameters.AddWithValue(BrokerDAO.AT_QUEUE_COUNT, broker.queueCount); command.Parameters.AddWithValue(BrokerDAO.ID, broker.id); command.ExecuteNonQuery(); } } catch (Exception ex) { ErrorLogger.LogError(ex, "BrokerDAO.updateLastMessageStats(Broker broker", broker.id.ToString() + "|" + broker.lastMessageDTTM.ToString()); } }
private static List <WebservicePropertySet> getSingleWebservicePropertySet(WebservicePropertySet WebservicePropertySet) { List <WebservicePropertySet> webservicePropertySets = new List <WebservicePropertySet>(); SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.GET_SINGLE_WEBSERVICE_PROPERTY_SET; command.Parameters.AddWithValue(WebservicePropertySetDAO.AT_ID, WebservicePropertySet.id); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { webservicePropertySets.Add(new WebservicePropertySet(reader)); } } } catch (Exception e) { ErrorLogger.LogError(e, "getSingleWebservicePropertySet(WebservicePropertySet WebservicePropertySet)", WebservicePropertySet.id.ToString()); } } return(webservicePropertySets); }
private static List <MessagePart> getSingleMessagePart(MessagePart messagePart) { List <MessagePart> messageParts = new List <MessagePart>(); SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.GET_SINGLE_MESSAGE_PART; command.Parameters.AddWithValue(MessagePartDAO.AT_ID, messagePart.id); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { messageParts.Add(new MessagePart(reader)); } } } catch (Exception e) { ErrorLogger.LogError(e, "getSingleMessagePart(MessagePart MessagePart)", messagePart.id.ToString()); } } return(messageParts); }
public static Acknowledgement insertIntoAcknowledgement(Acknowledgement ack) { SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.StoredProcedure; command.CommandText = das.POST_ACKNOWLEDGEMENT_PROCEDURE; command.Parameters.AddWithValue(AcknowledgementDAO.AT_MESSAGE_ID, ack.messageId); command.Parameters.AddWithValue(AcknowledgementDAO.AT_ACKNOWLEDGEMENT_TYPE_ID, ack.acknowledgementTypeId); command.Parameters.AddWithValue(AcknowledgementDAO.AT_RAW, ack.raw); command.Parameters.AddWithValue(AcknowledgementDAO.AT_CREATED_DTTM, ack.createdDttm); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { ack = new Acknowledgement(reader); } } } catch (Exception e) { ErrorLogger.LogError(e, "insertIntoAcknowledgement(Acknowledgement ack)", ack.messageId.ToString()); } } return(ack); }
private static List <MessageHeaderInstance> getMessageHeaderInstances() { List <MessageHeaderInstance> messageHeaderInstances = new List <MessageHeaderInstance>(); SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.GET_ALL_MESSAGE_HEADER_INSTANCE; try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { messageHeaderInstances.Add(new MessageHeaderInstance(reader)); } } } catch (Exception e) { ErrorLogger.LogError(e, "getMessageHeaderInstances()"); } } return(messageHeaderInstances); }
private static List <ApplicationSetting> getApplicationSettings() { List <ApplicationSetting> applicationSettings = new List <ApplicationSetting>(); SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.GET_ALL_APPLICATION_SETTING; try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { applicationSettings.Add(new ApplicationSetting(reader)); } } } catch (Exception e) { ErrorLogger.LogError(e, "GetApplicationSettings()"); } } return(applicationSettings); }
private static bool deleteInterface(Interface _interface) { SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.Text; command.CommandText = das.DELETE_INTERFACE; command.Parameters.AddWithValue(InterfaceDAO.AT_ID, _interface.id); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { _interface.id = DAOUtility.GetData <int>(reader, InterfaceDAO.ID); } } } catch (Exception e) { ErrorLogger.LogError(e, "DeleteInterface()", _interface.id.ToString()); } } return(true); }
public static string GetConnectionString(SysDataAccessCredential credential) { DataAccess dataAccessSettings = new DataAccess(); string connection_string = dataAccessSettings.BASE_CONNECTION_STRING; //// build custom connectionstring connection_string = connection_string.Replace("[SERVER]", credential.server); connection_string = connection_string.Replace("[DATABASE]", credential.database); connection_string = connection_string.Replace("[USERNAME]", credential.username); connection_string = connection_string.Replace("[PASSWORD]", credential.password); return(connection_string); }
public static bool UpdateProcessedFlagAndMessageLog(MessageHeaderInstance messageHeaderInstance, Message message, bool isReprocess = false) { SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); // set the flag which determines the reprocess bool isProcessed = false; using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.StoredProcedure; command.CommandText = das.UPDATE_MESSAGE_HEADER_INSTANCE_PROCESS; command.Parameters.AddWithValue(MessageBucketDAO.AT_ID, messageHeaderInstance.id); command.Parameters.AddWithValue(MessageBucketDAO.AT_MESSAGE_ID, message.id); command.Parameters.AddWithValue(MessageBucketDAO.AT_ISREPROCESS, isReprocess); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { isProcessed = DAOUtility.GetData <bool>(reader, MessageBucketDAO.ID); } } } catch (Exception e) { ErrorLogger.LogError(e, "MessageHeaderInstance messageHeaderInstance, Message message", messageHeaderInstance.id.ToString() + "|" + message.id.ToString()); ErrorLogger.LogError(new Exception("Message UpdateProcessedFlagAndMessageLog Retry"), "MessageHeaderInstance messageHeaderInstance, Message message", messageHeaderInstance.id.ToString() + "|" + message.id.ToString()); isProcessed = UpdateProcessedFlagAndMessageLog(messageHeaderInstance, message, isReprocess); } } return(isProcessed); }
private static bool reprocessMessage(int messageHeaderInstanceId, string messageControlId) { if (messageHeaderInstanceId == Convert.ToInt32(ZERO) && messageControlId == BLANK) { throw new ArgumentNullException("There is no message header instance id or message control id, can't reprocess"); } SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); // set the flag which determines the reprocess bool isProcessed = false; using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.StoredProcedure; command.CommandText = das.UPDATE_MESSAGE_HEADER_INSTANCE_FOR_REPROCESS; command.Parameters.AddWithValue(MessageBucketDAO.AT_ID, messageHeaderInstanceId); command.Parameters.AddWithValue(MessageBucketDAO.AT_MESSAGE_CONTROL_ID, messageControlId); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { isProcessed = DAOUtility.GetData <bool>(reader, MessageBucketDAO.ID); } } } catch (Exception e) { ErrorLogger.LogError(e, "reprocessMessage(int messageHeaderInstanceId, string messageControlId)", messageHeaderInstanceId.ToString() + "|" + messageControlId); } } return(isProcessed); }
private static Broker postUpdateBroker(Broker broker) { SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.StoredProcedure; command.CommandText = das.PUT_BROKER; command.Parameters.AddWithValue(BrokerDAO.AT_INTERFACE_STATUS_ID, broker.interfaceStatusId); command.Parameters.AddWithValue(BrokerDAO.AT_COMMUNICATION_ID, broker.communicationId); command.Parameters.AddWithValue(BrokerDAO.PROCESS_ID, broker.processId); command.Parameters.AddWithValue(BrokerDAO.LAST_MESSAGE_ID, broker.lastMessageId); command.Parameters.AddWithValue(BrokerDAO.QUEUE_COUNT, broker.queueCount); command.Parameters.AddWithValue(BrokerDAO.LAST_MESSAGE_DTTM, broker.lastMessageDTTM); command.Parameters.AddWithValue(BrokerDAO.AT_ID, broker.id); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { broker.id = DAOUtility.GetData <int>(reader, BrokerDAO.ID); } } } catch (Exception e) { ErrorLogger.LogError(e, "postUpdateBroker()", broker.id.ToString()); } } return(broker); }
private static Interface postUpdateInterface(Interface _interface) { SysDataAccessCredential dac = DAOUtility.GetSysCredentials(); DataAccess das = new DataAccess(); using (SqlConnection conn = new SqlConnection(DAOUtility.GetConnectionString(dac))) { conn.Open(); SqlCommand command = new SqlCommand(); command.Connection = conn; command.CommandType = System.Data.CommandType.StoredProcedure; command.CommandText = das.PUT_INTERFACE; command.Parameters.AddWithValue(InterfaceDAO.AT_COMMUNICATION_ID, _interface.communicationId); command.Parameters.AddWithValue(InterfaceDAO.AT_CREDENTIAL_ID, _interface.credentialId); command.Parameters.AddWithValue(InterfaceDAO.AT_IP_ADDRESS, _interface.ipAddress); command.Parameters.AddWithValue(InterfaceDAO.AT_PORT, _interface.port); command.Parameters.AddWithValue(InterfaceDAO.AT_MAX_CONNECTIONS, _interface.maxConnections); command.Parameters.AddWithValue(InterfaceDAO.AT_ID, _interface.id); try { SqlDataReader reader = command.ExecuteReader(); if (reader.HasRows) { while (reader.Read()) { _interface.id = DAOUtility.GetData <int>(reader, InterfaceDAO.ID); } } } catch (Exception e) { ErrorLogger.LogError(e, "postUpdateInterface()", _interface.id.ToString()); } } return(_interface); }