本文整理汇总了C#中Ict.Common.Verification.TVerificationResultCollection类的典型用法代码示例。如果您正苦于以下问题:C# TVerificationResultCollection类的具体用法?C# TVerificationResultCollection怎么用?C# TVerificationResultCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TVerificationResultCollection类属于Ict.Common.Verification命名空间,在下文中一共展示了TVerificationResultCollection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ImportString
/// <summary>
/// Imports a string value from the specified text line using the specified delimiter
/// </summary>
/// <param name="AImportLine">The line containing the text to be imported. When the method returns the imported value
/// will have been removed from the start ready for the next call to an Import method.</param>
/// <param name="ADelimiter">The delimiter</param>
/// <param name="AColumnTitle"></param>
/// <param name="ADataColumn"></param>
/// <param name="ARowNumber"></param>
/// <param name="AMessages"></param>
/// <param name="AValidationColumnsDict"></param>
/// <param name="ATreatEmptyStringAsText">When true the return value will be the empty string. When false the return value will be null.</param>
/// <returns>The string value. The AImportLine parameter will have been clipped.</returns>
public static String ImportString(ref String AImportLine,
String ADelimiter,
String AColumnTitle,
DataColumn ADataColumn,
int ARowNumber,
TVerificationResultCollection AMessages,
TValidationControlsDict AValidationColumnsDict,
bool ATreatEmptyStringAsText = true)
{
if ((ADataColumn != null) && (AValidationColumnsDict != null) && !AValidationColumnsDict.ContainsKey(ADataColumn))
{
AValidationColumnsDict.Add(ADataColumn, new TValidationControlsData(null, AColumnTitle));
}
String sReturn = StringHelper.GetNextCSV(ref AImportLine, ADelimiter);
if ((sReturn == StringHelper.CSV_STRING_FORMAT_ERROR) && (AMessages != null))
{
AMessages.Add(new TVerificationResult(String.Format(MCommonConstants.StrParsingErrorInLineColumn, ARowNumber, AColumnTitle),
Catalog.GetString("Could not parse the quoted string. Did you forget a quotation mark?"),
TResultSeverity.Resv_Critical));
}
if ((sReturn.Length == 0) && !ATreatEmptyStringAsText)
{
return null;
}
return sReturn;
}
开发者ID:Davincier,项目名称:openpetra,代码行数:43,代码来源:Common.Import.cs
示例2: ProcessSubmitChangesResultOK
/// <summary>
/// Processes the result of a data submission to the Server where the result of that operation is
/// <see cref="TSubmitChangesResult.scrOK" />. (Overload for DataTables.)
/// </summary>
/// <param name="ACallingFormOrUserControl"></param>
/// <param name="ALocalDT"></param>
/// <param name="ASubmitDT"></param>
/// <param name="APetraUtilsObject"></param>
/// <param name="AVerificationResults"></param>
/// <param name="ASetPrimaryKeyOnlyMethod"></param>
/// <param name="AMasterDataTableSaveCall"></param>
/// <param name="ACalledFromUserControl"></param>
/// <param name="ACallAcceptChangesOnReturnedDataBeforeMerge"></param>
public static void ProcessSubmitChangesResultOK(IFrmPetra ACallingFormOrUserControl, DataTable ALocalDT,
DataTable ASubmitDT, TFrmPetraEditUtils APetraUtilsObject, TVerificationResultCollection AVerificationResults,
Action <bool>ASetPrimaryKeyOnlyMethod, bool AMasterDataTableSaveCall, bool ACalledFromUserControl,
bool ACallAcceptChangesOnReturnedDataBeforeMerge = false)
{
if (AMasterDataTableSaveCall)
{
// Call AcceptChanges to get rid now of any deleted columns before we Merge with the result from the Server
ALocalDT.AcceptChanges();
// Merge back with data from the Server (eg. for getting Sequence values)
if (ACallAcceptChangesOnReturnedDataBeforeMerge)
{
ASubmitDT.AcceptChanges();
}
ALocalDT.Merge(ASubmitDT, false);
// Need to accept any new modification ID's
ALocalDT.AcceptChanges();
if (ASetPrimaryKeyOnlyMethod != null)
{
// Ensure the Primary-Key(s)-containing Controls are disabled to prevent further modification of Primary Key values
ASetPrimaryKeyOnlyMethod(true);
}
}
CommonPostMergeOperations(ACallingFormOrUserControl, APetraUtilsObject,
AVerificationResults, ACalledFromUserControl);
}
开发者ID:Davincier,项目名称:openpetra,代码行数:44,代码来源:CommonSaveChangesFunctions.cs
示例3: ValidateConferenceCostType
/// <summary>
/// Validates the MPartner Marital Status screen data.
/// </summary>
/// <param name="AContext">Context that describes where the data validation failed.</param>
/// <param name="ARow">The <see cref="DataRow" /> which holds the the data against which the validation is run.</param>
/// <param name="AVerificationResultCollection">Will be filled with any <see cref="TVerificationResult" /> items if
/// data validation errors occur.</param>
/// <param name="AValidationControlsDict">A <see cref="TValidationControlsDict" /> containing the Controls that
/// display data that is about to be validated.</param>
public static void ValidateConferenceCostType(object AContext, PcCostTypeRow ARow,
ref TVerificationResultCollection AVerificationResultCollection, TValidationControlsDict AValidationControlsDict)
{
DataColumn ValidationColumn;
TValidationControlsData ValidationControlsData;
TVerificationResult VerificationResult = null;
// Don't validate deleted DataRows
if (ARow.RowState == DataRowState.Deleted)
{
return;
}
// 'UnassignableDate' must not be empty if the flag is set
ValidationColumn = ARow.Table.Columns[PcCostTypeTable.ColumnUnassignableDateId];
if (AValidationControlsDict.TryGetValue(ValidationColumn, out ValidationControlsData))
{
if (ARow.UnassignableFlag)
{
VerificationResult = TSharedValidationControlHelper.IsNotInvalidDate(ARow.UnassignableDate,
ValidationControlsData.ValidationControlLabel, AVerificationResultCollection, true,
AContext, ValidationColumn, ValidationControlsData.ValidationControl);
}
// Handle addition to/removal from TVerificationResultCollection
AVerificationResultCollection.Auto_Add_Or_AddOrRemove(AContext, VerificationResult, ValidationColumn);
}
}
开发者ID:Davincier,项目名称:openpetra,代码行数:38,代码来源:Cacheable.Validation.cs
示例4: EvaluateVerificationResults
private string EvaluateVerificationResults(TVerificationResult AExpectedResult, TVerificationResult ATestResult)
{
TVerificationResultCollection Tmp;
if (!TVerificationHelper.AreVerificationResultsIdentical(ATestResult, AExpectedResult))
{
Tmp = new TVerificationResultCollection();
if (AExpectedResult != null)
{
Tmp.Add(AExpectedResult);
}
if (ATestResult != null)
{
Tmp.Add(ATestResult);
}
return TVerificationHelper.FormatVerificationCollectionItems(Tmp);
}
else
{
return String.Empty;
}
}
开发者ID:js1987,项目名称:openpetragit,代码行数:25,代码来源:test.cs
示例5: ValidateApDocumentDetailManual
/// <summary>
/// Detail 'Amount' must be positive or 0
/// </summary>
/// <param name="AContext">Context that describes where the data validation failed.</param>
/// <param name="ARow">The <see cref="DataRow" /> which holds the the data against which the validation is run.</param>
/// <param name="AVerificationResultCollection">Will be filled with any <see cref="TVerificationResult" /> items if
/// data validation errors occur.</param>
/// <param name="AValidationControlsDict">A <see cref="TValidationControlsDict" /> containing the Controls that
/// display data that is about to be validated.</param>
public static void ValidateApDocumentDetailManual(object AContext, AApDocumentDetailRow ARow,
ref TVerificationResultCollection AVerificationResultCollection, TValidationControlsDict AValidationControlsDict)
{
DataColumn ValidationColumn;
TValidationControlsData ValidationControlsData;
TVerificationResult VerificationResult;
// Don't validate deleted DataRows
if (ARow.RowState == DataRowState.Deleted)
{
return;
}
// 'Detail Amount' must be positive or 0
ValidationColumn = ARow.Table.Columns[AApDocumentDetailTable.ColumnAmountId];
if (AValidationControlsDict.TryGetValue(ValidationColumn, out ValidationControlsData))
{
VerificationResult = TNumericalChecks.IsPositiveOrZeroDecimal(ARow.Amount,
ValidationControlsData.ValidationControlLabel,
AContext, ValidationColumn, ValidationControlsData.ValidationControl);
// Handle addition/removal to/from TVerificationResultCollection
AVerificationResultCollection.Auto_Add_Or_AddOrRemove(AContext, VerificationResult, ValidationColumn);
}
}
开发者ID:Davincier,项目名称:openpetra,代码行数:35,代码来源:AP.Validation.cs
示例6: ValidateGiftDetailManual
static partial void ValidateGiftDetailManual(ref TVerificationResultCollection AVerificationResult,
TTypedDataTable ASubmitTable)
{
TValidationControlsDict ValidationControlsDict = new TValidationControlsDict();
ValidationControlsDict.Add(ASubmitTable.Columns[AGiftDetailTable.ColumnGiftCommentOneId],
new TValidationControlsData(null, AGiftDetailTable.GetGiftCommentOneDBName()));
TPartnerClass RecipientPartnerClass;
string RecipientDescription;
for (int Counter = 0; Counter < ASubmitTable.Rows.Count; Counter++)
{
if (ASubmitTable.Rows[Counter].RowState != DataRowState.Deleted)
{
TPartnerServerLookups.GetPartnerShortName(((GiftBatchTDSAGiftDetailRow)ASubmitTable.Rows[Counter]).RecipientKey,
out RecipientDescription,
out RecipientPartnerClass);
TSharedFinanceValidation_Gift.ValidateGiftDetailManual("TTransactionWebConnector" +
" (Error in Row #" + Counter.ToString() + ")", // No translation of message text since the server's messages should be all in English
(GiftBatchTDSAGiftDetailRow)ASubmitTable.Rows[Counter], ref AVerificationResult,
ValidationControlsDict, RecipientPartnerClass);
}
}
}
开发者ID:Davincier,项目名称:openpetra,代码行数:26,代码来源:Gift.Transactions.Validation.cs
示例7: ValidatePersonnelStaffManual
//
// Put Methods for the validation of Personnel Module WebConnectors in this code file.
//
static partial void ValidatePersonnelStaffManual(ref TVerificationResultCollection AVerificationResult,
TTypedDataTable ASubmitTable)
{
TValidationControlsDict ValidationControlsDict = new TValidationControlsDict();
ValidationControlsDict.Add(ASubmitTable.Columns[PmStaffDataTable.ColumnReceivingFieldId],
new TValidationControlsData(null, PmStaffDataTable.GetReceivingFieldDBName()));
ValidationControlsDict.Add(ASubmitTable.Columns[PmStaffDataTable.ColumnStartOfCommitmentId],
new TValidationControlsData(null, PmStaffDataTable.GetStartOfCommitmentDBName()));
ValidationControlsDict.Add(ASubmitTable.Columns[PmStaffDataTable.ColumnEndOfCommitmentId],
new TValidationControlsData(null, PmStaffDataTable.GetEndOfCommitmentDBName(),
null, PmStaffDataTable.GetStartOfCommitmentDBName()));
ValidationControlsDict.Add(ASubmitTable.Columns[PmStaffDataTable.ColumnStatusCodeId],
new TValidationControlsData(null, PmStaffDataTable.GetStatusCodeDBName()));
ValidationControlsDict.Add(ASubmitTable.Columns[PmStaffDataTable.ColumnHomeOfficeId],
new TValidationControlsData(null, PmStaffDataTable.GetHomeOfficeDBName()));
ValidationControlsDict.Add(ASubmitTable.Columns[PmStaffDataTable.ColumnOfficeRecruitedById],
new TValidationControlsData(null, PmStaffDataTable.GetOfficeRecruitedByDBName()));
for (int Counter = 0; Counter < ASubmitTable.Rows.Count; Counter++)
{
TSharedPersonnelValidation_Personnel.ValidateCommitmentManual("TPersonnelWebConnector" +
" (Error in Row #" + Counter.ToString() + ")", // No translation of message text since the server's messages should be all in English
(PmStaffDataRow)ASubmitTable.Rows[Counter], ref AVerificationResult,
ValidationControlsDict);
}
}
开发者ID:Davincier,项目名称:openpetra,代码行数:31,代码来源:Validation.cs
示例8: ValidateGLBatchManual
/// <summary>
/// Validates the GL Batch data.
/// </summary>
/// <param name="AContext">Context that describes where the data validation failed.</param>
/// <param name="ARow">The <see cref="DataRow" /> which holds the the data against which the validation is run.</param>
/// <param name="AVerificationResultCollection">Will be filled with any <see cref="TVerificationResult" /> items if
/// data validation errors occur.</param>
/// <param name="AValidationControlsDict">A <see cref="TValidationControlsDict" /> containing the Controls that
/// display data that is about to be validated.</param>
/// <param name="AStartDateCurrentPeriod">If the caller knows this value it can be supplied. Otherwise the server will supply the value for the ledger.</param>
/// <param name="AEndDateLastForwardingPeriod">If the caller knows this value it can be supplied. Otherwise the server will supply the value for the ledger.</param>
/// <returns>True if the validation found no data validation errors, otherwise false.</returns>
public static bool ValidateGLBatchManual(object AContext, ABatchRow ARow,
ref TVerificationResultCollection AVerificationResultCollection, TValidationControlsDict AValidationControlsDict,
DateTime? AStartDateCurrentPeriod = null, DateTime? AEndDateLastForwardingPeriod = null)
{
DataColumn ValidationColumn;
TValidationControlsData ValidationControlsData;
TScreenVerificationResult VerificationResult;
object ValidationContext;
int VerifResultCollAddedCount = 0;
// Don't validate deleted or posted DataRows
if ((ARow.RowState == DataRowState.Deleted) || (ARow.BatchStatus == MFinanceConstants.BATCH_POSTED)
|| (ARow.BatchStatus == MFinanceConstants.BATCH_CANCELLED))
{
return true;
}
bool isImporting = AContext.ToString().Contains("Importing");
// 'Effective From Date' must be valid
ValidationColumn = ARow.Table.Columns[ABatchTable.ColumnDateEffectiveId];
ValidationContext = ARow.BatchNumber;
DateTime StartDateCurrentPeriod;
DateTime EndDateLastForwardingPeriod;
if ((AStartDateCurrentPeriod == null) || (AEndDateLastForwardingPeriod == null))
{
TSharedFinanceValidationHelper.GetValidPostingDateRange(ARow.LedgerNumber,
out StartDateCurrentPeriod,
out EndDateLastForwardingPeriod);
}
else
{
StartDateCurrentPeriod = AStartDateCurrentPeriod.Value;
EndDateLastForwardingPeriod = AEndDateLastForwardingPeriod.Value;
}
if (AValidationControlsDict.TryGetValue(ValidationColumn, out ValidationControlsData))
{
VerificationResult = (TScreenVerificationResult)TDateChecks.IsDateBetweenDates(ARow.DateEffective,
StartDateCurrentPeriod,
EndDateLastForwardingPeriod,
ValidationControlsData.ValidationControlLabel + (isImporting ? String.Empty : " of Batch Number " + ValidationContext.ToString()),
TDateBetweenDatesCheckType.dbdctUnspecific,
TDateBetweenDatesCheckType.dbdctUnspecific,
AContext,
ValidationColumn,
ValidationControlsData.ValidationControl);
// Handle addition/removal to/from TVerificationResultCollection
if (AVerificationResultCollection.Auto_Add_Or_AddOrRemove(AContext, VerificationResult, ValidationColumn, true))
{
VerifResultCollAddedCount++;
}
}
return VerifResultCollAddedCount == 0;
}
开发者ID:Davincier,项目名称:openpetra,代码行数:71,代码来源:GL.Validation.cs
示例9: SubmitChanges
/// <summary>
/// submit changes of table
/// </summary>
/// <param name="AInspectTable"></param>
/// <param name="AResponseTable"></param>
/// <param name="AVerificationResult"></param>
/// <returns></returns>
public TSubmitChangesResult SubmitChanges(ref DataTable AInspectTable,
ref DataTable AResponseTable,
out TVerificationResultCollection AVerificationResult)
{
// TODO
AVerificationResult = new TVerificationResultCollection();
return TSubmitChangesResult.scrError;
}
开发者ID:js1987,项目名称:openpetragit,代码行数:15,代码来源:TableMaintenance.cs
示例10: Test1
/// <summary></summary>
public void Test1(TVerificationResultCollection tvr)
{
FverificationResults = tvr;
TestOperation testOperation = new TestOperation(1);
testOperation.SetJobSize(12);
testOperation.IsInInfoMode = true;
RunPeriodEndSequence(testOperation, "Message");
Assert.AreEqual(1, testOperation.GetOperationCount());
}
开发者ID:Davincier,项目名称:openpetra,代码行数:10,代码来源:Test.GL.PeriodEnd.cs
示例11: AddErrorLogEntry
/// <summary>
/// facade call
/// </summary>
/// <param name="AErrorCode"></param>
/// <param name="AContext"></param>
/// <param name="AMessageLine1"></param>
/// <param name="AMessageLine2"></param>
/// <param name="AMessageLine3"></param>
/// <param name="AVerificationResult"></param>
/// <returns></returns>
public static Boolean AddErrorLogEntry(String AErrorCode,
String AContext,
String AMessageLine1,
String AMessageLine2,
String AMessageLine3,
ref TVerificationResultCollection AVerificationResult)
{
return TErrorLog.AddErrorLogEntry(AErrorCode, AContext, AMessageLine1, AMessageLine2, AMessageLine3, ref AVerificationResult);
}
开发者ID:Davincier,项目名称:openpetra,代码行数:19,代码来源:ErrorLog.cs
示例12: ValidateManual
private bool ValidateManual()
{
TVerificationResultCollection VerificationResultCollection = new TVerificationResultCollection();
TSharedFinanceValidation_GL.ValidateGLBatchDateManual(dtpReversalDate.Date, dtpReversalDate.Description,
ref VerificationResultCollection, FStartDateCurrentPeriod, FEndDateLastForwardingPeriod, dtpReversalDate);
return TDataValidation.ProcessAnyDataValidationErrors(false, VerificationResultCollection, this.GetType(), dtpReversalDate.GetType());
}
开发者ID:js1987,项目名称:openpetragit,代码行数:9,代码来源:BatchDateDialog.ManualCode.cs
示例13: ValidateConferenceStandardCost
/// <summary>
/// Validates the MConference Standard Cost Setup screen data.
/// </summary>
/// <param name="AContext">Context that describes where the data validation failed.</param>
/// <param name="ARow">The <see cref="DataRow" /> which holds the the data against which the validation is run.</param>
/// <param name="AVerificationResultCollection">Will be filled with any <see cref="TVerificationResult" /> items if
/// data validation errors occur.</param>
/// <param name="AValidationControlsDict">A <see cref="TValidationControlsDict" /> containing the Controls that
/// display data that is about to be validated.</param>
/// <param name="AGridData">A <see cref="TValidationControlsDict" />Contains all rows that are included in the grid</param>
public static void ValidateConferenceStandardCost(object AContext, PcConferenceCostRow ARow,
ref TVerificationResultCollection AVerificationResultCollection, TValidationControlsDict AValidationControlsDict,
DataRowCollection AGridData)
{
// Don't validate deleted DataRows
if (ARow.RowState == DataRowState.Deleted)
{
return;
}
// Check the row being validated is consistent with the rest of the data in the table
PcConferenceCostRow ARowCompare = null;
Boolean StandardCostInconsistency = false;
string[] InconsistentRows = new string[2]; // used for the error message
int i = 0;
while (i < AGridData.Count)
{
ARowCompare = (PcConferenceCostRow)AGridData[i];
if ((ARowCompare.RowState != DataRowState.Deleted) && (ARowCompare.OptionDays > ARow.OptionDays) && (ARowCompare.Charge < ARow.Charge))
{
StandardCostInconsistency = true;
InconsistentRows[0] = ARow.OptionDays.ToString();
InconsistentRows[1] = ARowCompare.OptionDays.ToString();
break;
}
else if ((ARowCompare.RowState != DataRowState.Deleted) && (ARowCompare.OptionDays < ARow.OptionDays)
&& (ARowCompare.Charge > ARow.Charge))
{
StandardCostInconsistency = true;
InconsistentRows[0] = ARowCompare.OptionDays.ToString();
InconsistentRows[1] = ARow.OptionDays.ToString();
break;
}
i++;
}
// if an inconsistency is found
if (StandardCostInconsistency == true)
{
TValidationControlsData ValidationControlsData;
TScreenVerificationResult VerificationResult = null;
DataColumn ValidationColumn = ARow.Table.Columns[PcConferenceCostTable.ColumnChargeId];
// displays a warning message (non-critical error)
VerificationResult = new TScreenVerificationResult(new TVerificationResult(AContext, ErrorCodes.GetErrorInfo(
PetraErrorCodes.ERR_STANDARD_COST_INCONSISTENCY, InconsistentRows)),
ValidationColumn, ValidationControlsData.ValidationControl);
// Handle addition to/removal from TVerificationResultCollection
AVerificationResultCollection.Auto_Add_Or_AddOrRemove(AContext, VerificationResult, ValidationColumn);
}
}
开发者ID:js1987,项目名称:openpetragit,代码行数:65,代码来源:Conference.Validation.cs
示例14: ImportCurrencyExRates
/// <summary>
///
/// </summary>
/// <param name="AExchangeRateDT">The corporate or daily exchange rate table</param>
/// <param name="AImportMode">Determines whether corporate or daily exchange rates specified - either 'Daily' or 'Corporate'</param>
/// <param name="AResultCollection">A validation collection to which errors will be added</param>
/// <returns>The number of rows that were actually imported. Rows that duplicate existing rows do not count.
/// This is usually because this is an attempt to import again after a failed previous attempt.</returns>
public static int ImportCurrencyExRates(TTypedDataTable AExchangeRateDT, string AImportMode, TVerificationResultCollection AResultCollection)
{
OpenFileDialog DialogBox = new OpenFileDialog();
DialogBox.Title = Catalog.GetString("Import exchange rates from spreadsheet file");
DialogBox.Filter = Catalog.GetString("Spreadsheet files (*.csv)|*.csv");
if (DialogBox.ShowDialog() == DialogResult.OK)
{
String dateFormatString = TUserDefaults.GetStringDefault("Imp Date", "MDY");
String impOptions = TUserDefaults.GetStringDefault("Imp Options", ";" + TDlgSelectCSVSeparator.NUMBERFORMAT_AMERICAN);
TDlgSelectCSVSeparator DlgSeparator = new TDlgSelectCSVSeparator(false);
Boolean fileCanOpen = DlgSeparator.OpenCsvFile(DialogBox.FileName);
if (!fileCanOpen)
{
MessageBox.Show(Catalog.GetString("Unable to open file."),
Catalog.GetString("Import Exchange Rates"),
MessageBoxButtons.OK,
MessageBoxIcon.Stop);
return 0;
}
DlgSeparator.DateFormat = dateFormatString;
if (impOptions.Length > 1)
{
DlgSeparator.NumberFormat = impOptions.Substring(1);
}
DlgSeparator.SelectedSeparator = impOptions.Substring(0, 1);
if (DlgSeparator.ShowDialog() == DialogResult.OK)
{
// Save the settings that we specified
impOptions = DlgSeparator.SelectedSeparator;
impOptions += DlgSeparator.NumberFormat;
TUserDefaults.SetDefault("Imp Options", impOptions);
TUserDefaults.SetDefault("Imp Date", DlgSeparator.DateFormat);
TUserDefaults.SaveChangedUserDefaults();
// Do the import and retuen the number of rows imported and any messages
return ImportCurrencyExRatesFromCSV(AExchangeRateDT,
DialogBox.FileName,
DlgSeparator.SelectedSeparator,
DlgSeparator.NumberFormat,
DlgSeparator.DateFormat,
AImportMode,
AResultCollection);
}
}
return 0;
}
开发者ID:Davincier,项目名称:openpetra,代码行数:63,代码来源:ImportExchangeRates.cs
示例15: HandleReferences
/// <summary>
/// The main method to run a reference check on a single item of data
/// </summary>
/// <param name="APetraUtilsObject">The calling forms PetraUtils Object</param>
/// <param name="AVerificationResults">The results collection to check</param>
/// <param name="ALimitedCount">Will be true if the reference count call was a limited check</param>
/// <returns>A message box result. Yes implies doing a new unlimited count, Undefined implies there are no references so deletion can proceed.
/// Any other value implies that references exist</returns>
public TFrmExtendedMessageBox.TResult HandleReferences(TFrmPetraEditUtils APetraUtilsObject,
TVerificationResultCollection AVerificationResults,
bool ALimitedCount)
{
Form MyForm = APetraUtilsObject.GetForm();
// There were reference(s)
TRowReferenceInfo info = (TRowReferenceInfo)AVerificationResults[0].ResultContext;
bool bIncomplete = info.CascadingCountEndedEarly;
// Build up a message string
string msgContent = Messages.BuildMessageFromVerificationResult(
MCommonResourcestrings.StrRecordCannotBeDeleted +
Environment.NewLine +
Catalog.GetPluralString(MCommonResourcestrings.StrReasonColon, MCommonResourcestrings.StrReasonsColon, AVerificationResults.Count),
AVerificationResults);
TFrmExtendedMessageBox.TButtons buttons = TFrmExtendedMessageBox.TButtons.embbOK;
TFrmExtendedMessageBox.TDefaultButton defButton = TFrmExtendedMessageBox.TDefaultButton.embdDefButton1;
if (bIncomplete && ALimitedCount)
{
msgContent += String.Format(MCommonResourcestrings.StrCountTerminatedEarly1,
Environment.NewLine,
APetraUtilsObject.MaxReferenceCountOnDelete);
msgContent += MCommonResourcestrings.StrCountTerminatedEarly2;
msgContent += MCommonResourcestrings.StrCountTerminatedEarly3;
msgContent += String.Format(MCommonResourcestrings.StrCountTerminatedEarly4,
Environment.NewLine,
MyForm.Text);
buttons = TFrmExtendedMessageBox.TButtons.embbYesNo;
defButton = TFrmExtendedMessageBox.TDefaultButton.embdDefButton2;
}
else
{
if (bIncomplete)
{
// We should never get an incomplete count on an unlimited check
}
msgContent += String.Format(MCommonResourcestrings.StrCountTerminatedEarlyOK, Environment.NewLine);
}
// Show an Extended Message Box and return the value
TFrmExtendedMessageBox extendedMsgBox = new TFrmExtendedMessageBox(MyForm);
return extendedMsgBox.ShowDialog(
msgContent,
MCommonResourcestrings.StrRecordDeletionTitle,
String.Empty,
buttons,
defButton,
TFrmExtendedMessageBox.TIcon.embiInformation);
}
开发者ID:Davincier,项目名称:openpetra,代码行数:62,代码来源:CascadingReferenceCountHandler.cs
示例16: RunPeriodEndCheck
/// <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;
}
}
开发者ID:js1987,项目名称:openpetragit,代码行数:15,代码来源:Common.PeriodEnd.cs
示例17: BuildMessageFromVerificationResult
/// <summary>
/// format an error message using the errors from Verification Result
/// </summary>
/// <param name="AMessageHeadline"></param>
/// <param name="AVerificationResult"></param>
/// <returns></returns>
public static String BuildMessageFromVerificationResult(String AMessageHeadline, TVerificationResultCollection AVerificationResult)
{
String ReturnValue;
IEnumerator VerificationResultEnum;
TVerificationResult VerificationResultEntry;
if (AMessageHeadline == null)
{
if (AVerificationResult == null)
{
throw new ArgumentNullException("AVerificationResult must not be null if AMessageHeadline is null!");
}
if (AVerificationResult.HasCriticalErrors)
{
AMessageHeadline = Catalog.GetString("Saving of data failed!\r\n\r\nReasons:");
}
else
{
AMessageHeadline = StrWarningsAttention;
}
}
// MessageBox.Show('AVerificationResult.Count: ' + AVerificationResult.Count.ToString);
ReturnValue = AMessageHeadline + Environment.NewLine;
VerificationResultEnum = AVerificationResult.GetEnumerator();
while (VerificationResultEnum.MoveNext())
{
VerificationResultEntry = ((TVerificationResult)VerificationResultEnum.Current);
ReturnValue += " * ";
if (VerificationResultEntry.ResultContext != null)
{
if (!(VerificationResultEntry.ResultContext is TRowReferenceInfo))
{
ReturnValue += "[" + VerificationResultEntry.ResultContext.ToString() + "] ";
}
}
ReturnValue += VerificationResultEntry.ResultText;
if (VerificationResultEntry.ResultCode != String.Empty)
{
ReturnValue += " [" + VerificationResultEntry.ResultCode + "]";
}
ReturnValue += Environment.NewLine + Environment.NewLine;
}
return ReturnValue;
}
开发者ID:Davincier,项目名称:openpetra,代码行数:59,代码来源:Messages.cs
示例18: PeriodMonthEnd
public static bool PeriodMonthEnd(
Int32 ALedgerNumber,
bool AInfoMode,
out TVerificationResultCollection AVerificationResults)
{
try
{
TLedgerInfo ledgerInfo = new TLedgerInfo(ALedgerNumber);
Int32 PeriodClosing = ledgerInfo.CurrentPeriod;
bool res = new TMonthEnd(ledgerInfo).RunMonthEnd(AInfoMode,
out AVerificationResults);
if (!res && !AInfoMode)
{
TDBTransaction Transaction = null;
AAccountingPeriodTable PeriodTbl = null;
DBAccess.GDBAccessObj.GetNewOrExistingAutoReadTransaction(IsolationLevel.ReadUncommitted,
TEnforceIsolationLevel.eilMinimum,
ref Transaction,
delegate
{
PeriodTbl = AAccountingPeriodAccess.LoadByPrimaryKey(ledgerInfo.LedgerNumber, PeriodClosing, Transaction);
});
if (PeriodTbl.Rows.Count > 0)
{
AVerificationResults.Add(
new TVerificationResult(
Catalog.GetString("Month End"),
String.Format(Catalog.GetString("The period {0} - {1} has been closed."),
PeriodTbl[0].PeriodStartDate.ToShortDateString(), PeriodTbl[0].PeriodEndDate.ToShortDateString()),
TResultSeverity.Resv_Status));
}
}
return res;
}
catch (Exception e)
{
TLogging.Log("TPeriodIntervallConnector.TPeriodMonthEnd() throws " + e.ToString());
AVerificationResults = new TVerificationResultCollection();
AVerificationResults.Add(
new TVerificationResult(
Catalog.GetString("Month End"),
Catalog.GetString("Uncaught Exception: ") + e.Message,
TResultSeverity.Resv_Critical));
return true;
}
}
开发者ID:Davincier,项目名称:openpetra,代码行数:52,代码来源:GL.PeriodEnd.Month.cs
示例19: ImportData
/// <summary>
/// Import data from a CSV file
/// </summary>
/// <param name="ANode"></param>
/// <param name="AReferenceResults"></param>
/// <returns></returns>
public static PartnerImportExportTDS ImportData(XmlNode ANode, ref TVerificationResultCollection AReferenceResults)
{
PartnerImportExportTDS ResultDS = new PartnerImportExportTDS();
TPartnerImportCSV.FLocationKey = -1;
ResultsCol = AReferenceResults;
TDBTransaction ReadTransaction = null;
DBAccess.GDBAccessObj.BeginAutoReadTransaction(IsolationLevel.Serializable, ref ReadTransaction,
delegate
{
while (ANode != null)
{
ResultsContext = "CSV Import";
String PartnerClass = TXMLParser.GetAttribute(ANode, MPartnerConstants.PARTNERIMPORT_PARTNERCLASS).ToUpper();
Int64 PartnerKey = 0;
int LocationKey = 0;
if (PartnerClass.Length == 0)
{
PartnerClass = MPartnerConstants.PARTNERCLASS_FAMILY;
}
if ((PartnerClass == MPartnerConstants.PARTNERCLASS_FAMILY) || (PartnerClass == MPartnerConstants.PARTNERCLASS_PERSON))
{
ResultsContext = "CSV Import Family";
PartnerKey =
|
请发表评论