コード例 #1
0
        /// <summary>
        /// Standard routine to execute each PeriodEndOperation, and then confirm its success
        /// </summary>
        /// <param name="AOperation"></param>
        /// <param name="AOperationName"></param>
        protected void RunPeriodEndSequence(AbstractPeriodEndOperation AOperation, string AOperationName)
        {
            if (WasCancelled)
            {
                TLogging.Log(AOperationName + ": operation cancelled by user.");
                return;
            }

            AOperation.IsInInfoMode = FInfoMode;
            AOperation.VerificationResultCollection = FverificationResults;
            AOperation.FPeriodEndOperator           = this;

            if (FInfoMode)
            {
                // non-critical messages to be omitted - 3829

                /*if (AOperation.GetJobSize() == 0)
                 * {
                 *  // Non Critical Problem but the user shall be informed ...
                 *  String strTitle = Catalog.GetString("Period end status");
                 *  String strMessage = String.Format(Catalog.GetString("Nothing to be done for \"{0}\""), AOperationName);
                 *  TVerificationResult tvt =
                 *      new TVerificationResult(strTitle, strMessage, "",
                 *          TPeriodEndErrorAndStatusCodes.PEEC_01.ToString(),
                 *          TResultSeverity.Resv_Info);
                 *  FverificationResults.Add(tvt);
                 * }*/
            }
            else
            {
                // now we actually run the operation
                Int32 OperationsDone = AOperation.RunOperation();
//              TLogging.Log("Period End: RunPeriodEndSequence (" + AOperationName + ") returns " + OperationsDone);

                AbstractPeriodEndOperation VerifyOperation = AOperation.GetActualizedClone();
                VerifyOperation.IsInInfoMode = true;
                VerifyOperation.VerificationResultCollection = FverificationResults;
                Int32 RemainingItems = VerifyOperation.GetJobSize();

                if (RemainingItems > 0)
                {
                    // Critical Problem because there should be nothing left to do.
                    TVerificationResult tvt =
                        new TVerificationResult(
                            String.Format(Catalog.GetString("Problem in \"{0}\""), AOperationName),
                            String.Format(Catalog.GetString("{0} operations were completed, but {1} were found still to do!"),
                                          OperationsDone, RemainingItems),
                            "",
                            TPeriodEndErrorAndStatusCodes.PEEC_02.ToString(),
                            TResultSeverity.Resv_Critical);
                    FverificationResults.Add(tvt);
                    FHasCriticalErrors = true;
                }

                FHasCriticalErrors |= AOperation.HasCriticalErrors;
                FHasCriticalErrors |= VerifyOperation.HasCriticalErrors;
            }
        }
コード例 #2
0
        /// <summary>
        /// This is for all info only routines that means JobSize has no definition
        /// </summary>
        protected void RunPeriodEndCheck(AbstractPeriodEndOperation Apeo, TVerificationResultCollection AVerificationResults)
        {
            FverificationResults = AVerificationResults;
            Apeo.VerificationResultCollection = AVerificationResults;
            Apeo.IsInInfoMode = FInfoMode;
            Apeo.RunOperation();

            if (Apeo.HasCriticalErrors)
            {
                FHasCriticalErrors = true;
            }
        }
コード例 #3
0
        /// <summary>
        /// This is for all info only routines that means JobSize has no definition
        /// </summary>
        protected void RunPeriodEndCheck(AbstractPeriodEndOperation Apeo, TVerificationResultCollection AVerificationResults)
        {
            FverificationResults = AVerificationResults;
            Apeo.VerificationResultCollection = AVerificationResults;
            Apeo.IsInInfoMode = FInfoMode;
            Apeo.RunOperation();

            if (Apeo.HasCriticalErrors)
            {
                FHasCriticalErrors = true;
            }
        }
コード例 #4
0
        /// <summary>
        /// Standard routine to execute each PeriodEndOperation, and then confirm its success
        /// </summary>
        /// <param name="AOperation"></param>
        /// <param name="AOperationName"></param>
        protected void RunPeriodEndSequence(AbstractPeriodEndOperation AOperation, string AOperationName)
        {
            AOperation.IsInInfoMode = FInfoMode;
            AOperation.VerificationResultCollection = FverificationResults;
            AOperation.FPeriodEndOperator = this;

            if (FInfoMode)
            {
                if (AOperation.GetJobSize() == 0)
                {
                    // Non Critical Problem but the user shall be informed ...
                    String strTitle = Catalog.GetString("Period end status");
                    String strMessage = String.Format(Catalog.GetString("Nothing to be done for \"{0}\""), AOperationName);
                    TVerificationResult tvt =
                        new TVerificationResult(strTitle, strMessage, "",
                            TPeriodEndErrorAndStatusCodes.PEEC_01.ToString(),
                            TResultSeverity.Resv_Info);
                    FverificationResults.Add(tvt);
                }
            }
            else
            {
                // now we actually run the operation
                Int32 OperationsDone = AOperation.RunOperation();

                if (OperationsDone == 0)
                {
                    // Non Critical Problem but the user shall be informed ...
                    String strTitle = Catalog.GetString("Period end status");
                    String strMessage = String.Format(Catalog.GetString("Nothing done for \"{0}\""), AOperationName);
                    TVerificationResult tvt =
                        new TVerificationResult(strTitle, strMessage, "",
                            TPeriodEndErrorAndStatusCodes.PEEC_01.ToString(),
                            TResultSeverity.Resv_Info);
                    FverificationResults.Add(tvt);
                }

                //
                // Now I want to verify whether the job has been finished correctly...

                AbstractPeriodEndOperation VerifyOperation = AOperation.GetActualizedClone();
                VerifyOperation.IsInInfoMode = true;
                VerifyOperation.VerificationResultCollection = FverificationResults;
                Int32 RemainingItems = VerifyOperation.GetJobSize();

                if (RemainingItems > 0)
                {
                    // Critical Problem because there should be nothing left to do.
                    TVerificationResult tvt =
                        new TVerificationResult(
                            String.Format(Catalog.GetString("Problem in \"{0}\""), AOperationName),
                            String.Format(Catalog.GetString("The operation has {0} elements remaining!"),
                                RemainingItems),
                            "",
                            TPeriodEndErrorAndStatusCodes.PEEC_02.ToString(),
                            TResultSeverity.Resv_Critical);
                    FverificationResults.Add(tvt);
                    FHasCriticalErrors = true;
                }

                FHasCriticalErrors |= AOperation.HasCriticalErrors;
                FHasCriticalErrors |= VerifyOperation.HasCriticalErrors;
            }
        }
コード例 #5
0
        /// <summary>
        /// Standard routine to execute each PeriodEndOperation, and then confirm its success
        /// </summary>
        /// <param name="AOperation"></param>
        /// <param name="AOperationName"></param>
        protected void RunPeriodEndSequence(AbstractPeriodEndOperation AOperation, string AOperationName)
        {
            AOperation.IsInInfoMode = FInfoMode;
            AOperation.VerificationResultCollection = FverificationResults;
            AOperation.FPeriodEndOperator           = this;

            if (FInfoMode)
            {
                if (AOperation.GetJobSize() == 0)
                {
                    // Non Critical Problem but the user shall be informed ...
                    String strTitle         = Catalog.GetString("Period end status");
                    String strMessage       = String.Format(Catalog.GetString("Nothing to be done for \"{0}\""), AOperationName);
                    TVerificationResult tvt =
                        new TVerificationResult(strTitle, strMessage, "",
                                                TPeriodEndErrorAndStatusCodes.PEEC_01.ToString(),
                                                TResultSeverity.Resv_Info);
                    FverificationResults.Add(tvt);
                }
            }
            else
            {
                // now we actually run the operation
                Int32 OperationsDone = AOperation.RunOperation();

                if (OperationsDone == 0)
                {
                    // Non Critical Problem but the user shall be informed ...
                    String strTitle         = Catalog.GetString("Period end status");
                    String strMessage       = String.Format(Catalog.GetString("Nothing done for \"{0}\""), AOperationName);
                    TVerificationResult tvt =
                        new TVerificationResult(strTitle, strMessage, "",
                                                TPeriodEndErrorAndStatusCodes.PEEC_01.ToString(),
                                                TResultSeverity.Resv_Info);
                    FverificationResults.Add(tvt);
                }

                //
                // Now I want to verify whether the job has been finished correctly...

                AbstractPeriodEndOperation VerifyOperation = AOperation.GetActualizedClone();
                VerifyOperation.IsInInfoMode = true;
                VerifyOperation.VerificationResultCollection = FverificationResults;
                Int32 RemainingItems = VerifyOperation.GetJobSize();

                if (RemainingItems > 0)
                {
                    // Critical Problem because there should be nothing left to do.
                    TVerificationResult tvt =
                        new TVerificationResult(
                            String.Format(Catalog.GetString("Problem in \"{0}\""), AOperationName),
                            String.Format(Catalog.GetString("The operation has {0} elements remaining!"),
                                          RemainingItems),
                            "",
                            TPeriodEndErrorAndStatusCodes.PEEC_02.ToString(),
                            TResultSeverity.Resv_Critical);
                    FverificationResults.Add(tvt);
                    FHasCriticalErrors = true;
                }

                FHasCriticalErrors |= AOperation.HasCriticalErrors;
                FHasCriticalErrors |= VerifyOperation.HasCriticalErrors;
            }
        }
コード例 #6
0
        /// <summary>
        /// Standard routine to execute each PeriodEndOperation, and then confirm its success
        /// </summary>
        /// <param name="AOperation"></param>
        /// <param name="AOperationName"></param>
        protected void RunPeriodEndSequence(AbstractPeriodEndOperation AOperation, string AOperationName)
        {
            if (FwasCancelled)
            {
                TLogging.Log(AOperationName + ": operation cancelled by user.");
                return;
            }

            AOperation.IsInInfoMode = FInfoMode;
            AOperation.VerificationResultCollection = FverificationResults;
            AOperation.FPeriodEndOperator = this;

            if (FInfoMode)
            {
                // non-critical messages to be omitted - 3829

                /*if (AOperation.GetJobSize() == 0)
                 * {
                 *  // Non Critical Problem but the user shall be informed ...
                 *  String strTitle = Catalog.GetString("Period end status");
                 *  String strMessage = String.Format(Catalog.GetString("Nothing to be done for \"{0}\""), AOperationName);
                 *  TVerificationResult tvt =
                 *      new TVerificationResult(strTitle, strMessage, "",
                 *          TPeriodEndErrorAndStatusCodes.PEEC_01.ToString(),
                 *          TResultSeverity.Resv_Info);
                 *  FverificationResults.Add(tvt);
                 * }*/
            }
            else
            {
                // now we actually run the operation
                Int32 OperationsDone = AOperation.RunOperation();
//              TLogging.Log("Period End: RunPeriodEndSequence (" + AOperationName + ") returns " + OperationsDone);

                AbstractPeriodEndOperation VerifyOperation = AOperation.GetActualizedClone();
                VerifyOperation.IsInInfoMode = true;
                VerifyOperation.VerificationResultCollection = FverificationResults;
                Int32 RemainingItems = VerifyOperation.GetJobSize();

                if (RemainingItems > 0)
                {
                    // Critical Problem because there should be nothing left to do.
                    TVerificationResult tvt =
                        new TVerificationResult(
                            String.Format(Catalog.GetString("Problem in \"{0}\""), AOperationName),
                            String.Format(Catalog.GetString("{0} operations were completed, but {1} were found still to do!"),
                                OperationsDone, RemainingItems),
                            "",
                            TPeriodEndErrorAndStatusCodes.PEEC_02.ToString(),
                            TResultSeverity.Resv_Critical);
                    FverificationResults.Add(tvt);
                    FHasCriticalErrors = true;
                }

                FHasCriticalErrors |= AOperation.HasCriticalErrors;
                FHasCriticalErrors |= VerifyOperation.HasCriticalErrors;
            }
        }