コード例 #1
0
        /// <summary>
        /// Checks if exists an update form JBC's server
        /// </summary>
        /// <returns>Update information</returns>
        public stSwVersion GetInfoNewUpdate()
        {
            stSwVersion infoUpdateSw = new stSwVersion();

            //descargar el archivo de versiones del remote server
            m_systemFilesManager.DownloadFile(System.Convert.ToString(My.Settings.Default.VersionFileName));

            //obtener la información del archivo de versiones
            stSwVersion remoteSwVersion = m_versionFileParser.GetInfoLastSwVersion();

            //obtener la información de las versiones instaladas en la red local
            stSwVersion currentSwVersion = m_localData.GetSwInfo();

            //obtiene la fecha de la última actualización
            infoUpdateSw.lastUpdateDate = m_localData.GetLastUpdateDate();

            //Comprobar si hay actualizacion software del StationController
            if (remoteSwVersion.stationControllerSwDate > currentSwVersion.stationControllerSwDate)
            {
                infoUpdateSw.stationControllerSwAvailable = true;
                infoUpdateSw.stationControllerSwDate      = remoteSwVersion.stationControllerSwDate;
                infoUpdateSw.stationControllerSwVersion   = remoteSwVersion.stationControllerSwVersion;
                infoUpdateSw.stationControllerSwUrl       = remoteSwVersion.stationControllerSwUrl;
            }
            else
            {
                infoUpdateSw.stationControllerSwAvailable = false;
            }

            //Comprobar si hay actualizacion software del RemoteManager
            if (remoteSwVersion.remoteManagerSwDate > currentSwVersion.remoteManagerSwDate)
            {
                infoUpdateSw.remoteManagerSwAvailable = true;
                infoUpdateSw.remoteManagerSwDate      = remoteSwVersion.remoteManagerSwDate;
                infoUpdateSw.remoteManagerSwVersion   = remoteSwVersion.remoteManagerSwVersion;
                infoUpdateSw.remoteManagerSwUrl       = remoteSwVersion.remoteManagerSwUrl;
            }
            else
            {
                infoUpdateSw.remoteManagerSwAvailable = false;
            }

            //Comprobar si hay actualizacion software del HostController
            if (remoteSwVersion.hostControllerSwDate > currentSwVersion.hostControllerSwDate)
            {
                infoUpdateSw.hostControllerSwAvailable = true;
                infoUpdateSw.hostControllerSwDate      = remoteSwVersion.hostControllerSwDate;
                infoUpdateSw.hostControllerSwVersion   = remoteSwVersion.hostControllerSwVersion;
                infoUpdateSw.hostControllerSwUrl       = remoteSwVersion.hostControllerSwUrl;
            }
            else
            {
                infoUpdateSw.hostControllerSwAvailable = false;
            }

            //Comprobar si hay actualizacion software del WebManager
            if (remoteSwVersion.webManagerSwDate > currentSwVersion.webManagerSwDate)
            {
                infoUpdateSw.webManagerSwAvailable = true;
                infoUpdateSw.webManagerSwDate      = remoteSwVersion.webManagerSwDate;
                infoUpdateSw.webManagerSwVersion   = remoteSwVersion.webManagerSwVersion;
                infoUpdateSw.webManagerSwUrl       = remoteSwVersion.webManagerSwUrl;
            }
            else
            {
                infoUpdateSw.webManagerSwAvailable = false;
            }

            return(infoUpdateSw);
        }