/// <summary> /// Get the periodic updates check information /// </summary> /// <returns>Configuration of the periodic updates check</returns> public dc_InfoCheckPeriodicTime GetCheckPeriodicTimeInfo() { dc_InfoCheckPeriodicTime periodicTimeInfo = new dc_InfoCheckPeriodicTime(); periodicTimeInfo.available = false; string table = "updateSchedule"; string[] keyList = new string[1]; keyList[0] = "checkPeriodicAvailable"; string[] valueList = new string[1]; try { m_semaphoreData.WaitOne(); if (m_DBConnection.SelectQuery(keyList, table, ref valueList)) { periodicTimeInfo.available = bool.Parse(valueList[0]); } 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(periodicTimeInfo); }
/// <summary> /// Set periodic updates check /// </summary> /// <param name="infoCheckPeriodicTime">Periodic updates check configuration</param> /// <returns>True if the operation was successful</returns> public bool SetCheckPeriodicTime(dc_InfoCheckPeriodicTime infoCheckPeriodicTime) { bool bOk = m_localData.SetCheckPeriodicTimeInfo(infoCheckPeriodicTime); m_timerPeriodicUpdate.Stop(); ReScheduleTimers(); return(bOk); }
/// <summary> /// Set the periodic updates check information /// </summary> /// <param name="infoCheckPeriodicTime">Periodic updates check information</param> /// <returns>True if the operation was successful</returns> public bool SetCheckPeriodicTimeInfo(dc_InfoCheckPeriodicTime infoCheckPeriodicTime) { bool bRet = false; string table = "updateSchedule"; string[] keyList = new string[1]; keyList[0] = "checkPeriodicAvailable"; string[] valueList = new string[1]; if (infoCheckPeriodicTime.available) { valueList[0] = CONST_TRUE; } else { valueList[0] = CONST_FALSE; } 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> /// Schedule a periodic update verification /// </summary> /// <param name="infoCheckPeriodicTime">Periodic update verification configuration</param> /// <returns>True if the update verification schedule was succesful</returns> public bool SetCheckPeriodicTime(dc_InfoCheckPeriodicTime infoCheckPeriodicTime) { return(m_updatesManager.SetCheckPeriodicTime(infoCheckPeriodicTime)); }
/// <summary> /// Set periodic updates check /// </summary> /// <param name="infoCheckPeriodicTime">Periodic updates check configuration</param> /// <returns>True if the operation was successful</returns> public bool SetCheckPeriodicTime(dc_InfoCheckPeriodicTime infoCheckPeriodicTime) { return(m_scheduleUpdates.SetCheckPeriodicTime(infoCheckPeriodicTime)); }