예제 #1
0
        internal static List <HimAppFile> GetHimAppUpdate(string himVersion, string facilityID)
        {
            List <HimAppFile> himAppFiles = new List <HimAppFile>();

            try
            {
                if (ValidateRequestParameter(facilityID, 8, false) && ValidateRequestParameter(himVersion, 8, false))
                {
                    // <TODO> when clients all updated - get file version from HimServiceConsole.exe?
                    HimAppFile appFile1 = new HimAppFile();
                    appFile1.fileName    = "HIM.exe";
                    appFile1.fileVersion = himVersion;

                    // get version of HIM.exe in updates folder (if none there, swallow exception)
                    try
                    {
                        appFile1.GetFileVersion();
                    }
                    catch { }

                    // record current version
                    HimOnLine.UpdateClientVersion(facilityID, himVersion);

                    // populate return List if the server contains a different version (not just a newer one, in case need to revert back)
                    if (appFile1.fileVersion != himVersion)
                    {
                        // backwards-compatibility - check if Console App exists, if so, just send this, otherwise HIM.EXE and HIM.pdb

                        HimAppFile appFile0 = new HimAppFile();
                        appFile0.fileName = "HimServiceConsole.exe";

                        if (appFile0.GetFileTextFromDisk())
                        {
                            himAppFiles.Add(appFile0);
                        }
                        else
                        {
                            if (appFile1.GetFileTextFromDisk())
                            {
                                himAppFiles.Add(appFile1);
                            }

                            HimAppFile appFile2 = new HimAppFile();
                            appFile2.fileName = "HIM.pdb";
                            if (appFile2.GetFileTextFromDisk())
                            {
                                himAppFiles.Add(appFile2);
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Write("ERROR: " + ex.ToString(), LogLevel.ExceptionOnly);
                throw;
            }

            return(himAppFiles);
        }
예제 #2
0
        internal static string PutFacilityOffLine(string facilityID)
        {
            List <HimDirectory> directory = new List <HimDirectory>();

            try
            {
                if (ValidateRequestParameter(facilityID, 8, false))
                {
                    // update On-Line status of passed Facility to false
                    HimOnLine.UpdateOnLineStatus(facilityID, false);
                }
            }
            catch (Exception ex)
            {
                Log.Write("ERROR: " + ex.ToString(), LogLevel.ExceptionOnly);
                throw;
            }

            return("OffLine");
        }
예제 #3
0
        internal static List <HimDirectory> GetHimDirectory(string facilityID)
        {
            List <HimDirectory> directory = new List <HimDirectory>();

            try
            {
                if (ValidateRequestParameter(facilityID, 8, false))
                {
                    // update On-Line status of passed Facility to true
                    HimOnLine.UpdateOnLineStatus(facilityID, true);

                    // get list of all Facilities using HPI Messaging
                    directory = HimSearch.GetFacilities();
                }
            }
            catch (Exception ex)
            {
                Log.Write("ERROR: " + ex.ToString(), LogLevel.ExceptionOnly);
                throw;
            }

            return(directory);
        }