Ejemplo n.º 1
0
        public static System.Boolean GetInstalledPatches(out Ict.Petra.Shared.MSysMan.Data.SPatchLogTable APatchLogDT)
        {
            SPatchLogTable TmpTable = new SPatchLogTable();

            APatchLogDT = new SPatchLogTable();
            TDBTransaction ReadTransaction = new TDBTransaction();

            TLogging.LogAtLevel(9, "TSysManServerLookups.GetInstalledPatches called!");

            DBAccess.ReadTransaction(
                ref ReadTransaction,
                delegate
            {
                // Load data
                TmpTable = SPatchLogAccess.LoadAll(ReadTransaction);
            });

            /* Sort the data...
             */
            TmpTable.DefaultView.Sort = SPatchLogTable.GetDateRunDBName() + " DESC, " +
                                        SPatchLogTable.GetPatchNameDBName() + " DESC";

            /* ...and put it in the output table.
             */
            for (int Counter = 0; Counter < TmpTable.DefaultView.Count; ++Counter)
            {
                TLogging.LogAtLevel(7, "Patch: " + TmpTable.DefaultView[Counter][0]);
                APatchLogDT.ImportRow(TmpTable.DefaultView[Counter].Row);
            }

            return(true);
        }
Ejemplo n.º 2
0
        public static System.Boolean GetInstalledPatches(out Ict.Petra.Shared.MSysMan.Data.SPatchLogTable APatchLogDT)
        {
            SPatchLogTable TmpTable = new SPatchLogTable();

            APatchLogDT = new SPatchLogTable();
            TDBTransaction ReadTransaction;
            Boolean        NewTransaction = false;

            TLogging.LogAtLevel(9, "TSysManServerLookups.GetInstalledPatches called!");

            ReadTransaction = DBAccess.GDBAccessObj.GetNewOrExistingTransaction(IsolationLevel.Serializable,
                                                                                TEnforceIsolationLevel.eilMinimum,
                                                                                out NewTransaction);

            try
            {
                // Load data
                TmpTable = SPatchLogAccess.LoadAll(ReadTransaction);
            }
            finally
            {
                if (NewTransaction)
                {
                    DBAccess.GDBAccessObj.CommitTransaction();
                    TLogging.LogAtLevel(7, "TSysManServerLookups.GetInstalledPatches: committed own transaction.");
                }
            }

            /* Sort the data...
             */
            TmpTable.DefaultView.Sort = SPatchLogTable.GetDateRunDBName() + " DESC, " +
                                        SPatchLogTable.GetPatchNameDBName() + " DESC";

            /* ...and put it in the output table.
             */
            for (int Counter = 0; Counter < TmpTable.DefaultView.Count; ++Counter)
            {
                TLogging.LogAtLevel(7, "Patch: " + TmpTable.DefaultView[Counter][0]);
                APatchLogDT.ImportRow(TmpTable.DefaultView[Counter].Row);
            }

            return(true);
        }