/// <summary> /// Set the configuration information update notifications /// </summary> /// <param name="updateNotifications">Configuration information update notifications</param> /// <returns>True if the operation was successful</returns> public bool SetUpdateNotifications(dc_UpdateNotifications updateNotifications) { bool bRet = false; string table = "systemInfo"; string[] keyList = new string[2]; keyList[0] = "updateNotificationAvailable"; keyList[1] = "updateNotificationEmail"; string[] valueList = new string[2]; if (updateNotifications.emailAvailable) { valueList[0] = CONST_TRUE; } else { valueList[0] = CONST_FALSE; } valueList[1] = updateNotifications.emailAddress; try { m_semaphoreData.WaitOne(); bRet = m_DBConnection.UpdateQuery(keyList, table, valueList); if (!bRet) { LoggerModule.logger.Error(System.Reflection.MethodInfo.GetCurrentMethod().Name + ". Error with DB Update Query"); } } catch (Exception ex) { LoggerModule.logger.Error(System.Reflection.MethodInfo.GetCurrentMethod().Name + ". Error: " + ex.Message); } finally { m_semaphoreData.Release(); } return(bRet); }
/// <summary> /// Get the configuration information update notifications /// </summary> /// <returns>Configuration information update notifications</returns> public dc_UpdateNotifications GetUpdateNotifications() { dc_UpdateNotifications updateNotifications = new dc_UpdateNotifications(); updateNotifications.emailAvailable = false; updateNotifications.emailAddress = ""; string table = "systemInfo"; string[] keyList = new string[2]; keyList[0] = "updateNotificationAvailable"; keyList[1] = "updateNotificationEmail"; string[] valueList = new string[1]; try { m_semaphoreData.WaitOne(); if (m_DBConnection.SelectQuery(keyList, table, ref valueList)) { updateNotifications.emailAvailable = bool.Parse(valueList[0]); updateNotifications.emailAddress = valueList[1]; } else { LoggerModule.logger.Error(System.Reflection.MethodInfo.GetCurrentMethod().Name + ". Error with DB Select Query"); } } catch (Exception ex) { LoggerModule.logger.Error(System.Reflection.MethodInfo.GetCurrentMethod().Name + ". Error: " + ex.Message); } finally { m_semaphoreData.Release(); } return(updateNotifications); }
/// <summary> /// Set the information update notifications /// </summary> /// <param name="updateNotifications">Information update notifications</param> /// <returns>True if the operation was successful</returns> public bool SetUpdateNotifications(dc_UpdateNotifications updateNotifications) { return(m_updatesManager.SetUpdateNotifications(updateNotifications)); }
/// <summary> /// Set the configuration information update notifications /// </summary> /// <param name="updateNotifications">Configuration information update notifications</param> /// <returns>True if the operation was successful</returns> public bool SetUpdateNotifications(dc_UpdateNotifications updateNotifications) { return(m_localData.SetUpdateNotifications(updateNotifications)); }