本文整理汇总了C#中TValidationControlsDict类的典型用法代码示例。如果您正苦于以下问题:C# TValidationControlsDict类的具体用法?C# TValidationControlsDict怎么用?C# TValidationControlsDict使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TValidationControlsDict类属于命名空间,在下文中一共展示了TValidationControlsDict类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
}
示例2: 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);
}
}
示例3: 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);
}
}
}
示例4: 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);
}
}
示例5: 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;
}
示例6: 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;
}
示例7: 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);
}
}
示例8: ValidatePPartnerManual
//
// Put Methods for the validation of Partner Edit screen data in this code file.
//
static partial void ValidatePPartnerManual(ref TVerificationResultCollection AVerificationResult,
TTypedDataTable ASubmitTable)
{
TValidationControlsDict ValidationControlsDict = new TValidationControlsDict();
ValidationControlsDict.Add(ASubmitTable.Columns[PPartnerTable.ColumnStatusCodeId],
new TValidationControlsData(null, Catalog.GetString("Partner &Status")));
for (int Counter = 0; Counter < ASubmitTable.Rows.Count; Counter++)
{
TSharedPartnerValidation_Partner.ValidatePartnerManual("TPartnerEditUIConnector" +
" (Error in Row #" + Counter.ToString() + ")", // No translation of message text since the server's messages should be all in English
(PPartnerRow)ASubmitTable.Rows[Counter], ref AVerificationResult,
ValidationControlsDict);
}
}
示例9: ValidateApDocumentDetailManual
//
// Put Methods for the validation of AP EditTransaction in this code file.
//
static partial void ValidateApDocumentDetailManual(ref TVerificationResultCollection AVerificationResult,
TTypedDataTable ASubmitTable)
{
TValidationControlsDict ValidationControlsDict = new TValidationControlsDict();
ValidationControlsDict.Add(ASubmitTable.Columns[AApDocumentDetailTable.ColumnAmountId],
new TValidationControlsData(null, AApDocumentDetailTable.GetAmountDBName()));
for (int Counter = 0; Counter < ASubmitTable.Rows.Count; Counter++)
{
TSharedFinanceValidation_AP.ValidateApDocumentDetailManual("TTransactionWebConnector" +
" (Error in Row #" + Counter.ToString() + ")", // No translation of message text since the server's messages should be all in English
(AApDocumentDetailRow)ASubmitTable.Rows[Counter], ref AVerificationResult,
ValidationControlsDict);
}
}
示例10: ValidateGiftBatchManual
//
// Put Methods for the validation of Gift Transactions in this code file.
//
static partial void ValidateGiftBatchManual(ref TVerificationResultCollection AVerificationResult,
TTypedDataTable ASubmitTable)
{
TValidationControlsDict ValidationControlsDict = new TValidationControlsDict();
ValidationControlsDict.Add(ASubmitTable.Columns[AGiftBatchTable.ColumnBatchDescriptionId],
new TValidationControlsData(null, AGiftBatchTable.GetBatchDescriptionDBName()));
ValidationControlsDict.Add(ASubmitTable.Columns[AGiftBatchTable.ColumnExchangeRateToBaseId],
new TValidationControlsData(null, AGiftBatchTable.GetExchangeRateToBaseDBName()));
for (int Counter = 0; Counter < ASubmitTable.Rows.Count; Counter++)
{
TSharedFinanceValidation_Gift.ValidateGiftBatchManual("TTransactionWebConnector" +
" (Error in Row #" + Counter.ToString() + ")", // No translation of message text since the server's messages should be all in English
(AGiftBatchRow)ASubmitTable.Rows[Counter], ref AVerificationResult,
ValidationControlsDict);
}
}
示例11: ValidateMaritalStatusListManual
//
// Put Methods for the validation of Cacheable DataTables in this code file.
//
partial void ValidateMaritalStatusListManual(ref TVerificationResultCollection AVerificationResult, TTypedDataTable ASubmitTable)
{
TValidationControlsDict ValidationControlsDict = new TValidationControlsDict();
ValidationControlsDict.Add(ASubmitTable.Columns[PtMaritalStatusTable.ColumnAssignableDateId],
new TValidationControlsData(null, PtMaritalStatusTable.GetAssignableDateDBName()));
for (int Counter = 0; Counter < ASubmitTable.Rows.Count; Counter++)
{
if (ASubmitTable.Rows[Counter].RowState != DataRowState.Deleted)
{
TSharedValidation_CacheableDataTables.ValidateMaritalStatus(this.GetType().Name +
" (Error in Row #" + Counter.ToString() + ")", // No translation of message text since the server's messages should be all in English
(PtMaritalStatusRow)ASubmitTable.Rows[Counter], ref AVerificationResult,
ValidationControlsDict);
}
}
}
示例12: ValidateInternationalPostalTypeManual
//
// Put Methods for the validation of Common Module WebConnectors and DataReaders in this code file.
//
static partial void ValidateInternationalPostalTypeManual(ref TVerificationResultCollection AVerificationResult,
TTypedDataTable ASubmitTable)
{
TValidationControlsDict ValidationControlsDict = new TValidationControlsDict();
ValidationControlsDict.Add(ASubmitTable.Columns[(short)PInternationalPostalTypeTable.ColumnInternatPostalTypeCodeId],
new TValidationControlsData(null, PInternationalPostalTypeTable.GetInternatPostalTypeCodeDBName()));
ValidationControlsDict.Add(ASubmitTable.Columns[(short)PInternationalPostalTypeTable.ColumnDescriptionId],
new TValidationControlsData(null, PInternationalPostalTypeTable.GetDescriptionDBName()));
ValidationControlsDict.Add(ASubmitTable.Columns[(short)PInternationalPostalTypeTable.ColumnDeletableId],
new TValidationControlsData(null, PInternationalPostalTypeTable.GetDeletableDBName()));
for (int Counter = 0; Counter < ASubmitTable.Rows.Count; Counter++)
{
PInternationalPostalTypeValidation.Validate("TCommonDataReader.ValidateInternationalPostalTypeManual" +
" (Error in Row #" + Counter.ToString() + ")", // No translation of message text since the server's messages should be all in English
(PInternationalPostalTypeRow)ASubmitTable.Rows[Counter], ref AVerificationResult,
ValidationControlsDict);
}
}
示例13: ValidateCountryListManual
//
// Put Methods for the validation of Cacheable DataTables in this code file.
//
partial void ValidateCountryListManual(ref TVerificationResultCollection AVerificationResult, TTypedDataTable ASubmitTable)
{
TValidationControlsDict ValidationControlsDict = new TValidationControlsDict();
ValidationControlsDict.Add(ASubmitTable.Columns[PCountryTable.ColumnInternatTelephoneCodeId],
new TValidationControlsData(null, PCountryTable.GetInternatTelephoneCodeDBName()));
ValidationControlsDict.Add(ASubmitTable.Columns[PCountryTable.ColumnInternatPostalTypeCodeId],
new TValidationControlsData(null, PCountryTable.GetInternatAccessCodeDBName()));
ValidationControlsDict.Add(ASubmitTable.Columns[PCountryTable.ColumnTimeZoneMinimumId],
new TValidationControlsData(null, PCountryTable.GetTimeZoneMinimumDBName(),
null, PCountryTable.GetTimeZoneMaximumDBName()));
for (int Counter = 0; Counter < ASubmitTable.Rows.Count; Counter++)
{
TSharedValidation_CacheableDataTables.ValidateCountrySetupManual(this.GetType().Name +
" (Error in Row #" + Counter.ToString() + ")", // No translation of message text since the server's messages should be all in English
(PCountryRow)ASubmitTable.Rows[Counter], ref AVerificationResult,
ValidationControlsDict);
}
}
示例14: ValidateAccountDetailManual
/// <summary>
/// Check that Foreign Currency Accounts are using a valid currency
/// </summary>
/// <param name="AContext">Context that describes what I'm validating.</param>
/// <param name="ARow">DataRow with the the data I'm validating</param>
/// <param name="AVerificationResultCollection">Will be filled with 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 ValidateAccountDetailManual(object AContext, GLSetupTDSAAccountRow ARow,
ref TVerificationResultCollection AVerificationResultCollection, TValidationControlsDict AValidationControlsDict)
{
// Don't validate deleted DataRows
if (ARow.RowState == DataRowState.Deleted)
{
return;
}
TValidationControlsData ValidationControlsData;
// If this account is foreign, its currency must be assigned!
if (ARow.ForeignCurrencyFlag)
{
if (ARow.ForeignCurrencyCode == "")
{
DataColumn ValidationColumn = ARow.Table.Columns[AAccountTable.ColumnForeignCurrencyCodeId];
Control targetControl = null;
if (AValidationControlsDict.TryGetValue(ValidationColumn, out ValidationControlsData))
{
targetControl = ValidationControlsData.ValidationControl;
}
TScreenVerificationResult VerificationResult = new TScreenVerificationResult(
AContext,
ValidationColumn,
Catalog.GetString("Currency Code must be specified for foreign accounts."),
targetControl,
TResultSeverity.Resv_Critical);
// Handle addition/removal to/from TVerificationResultCollection
AVerificationResultCollection.Auto_Add_Or_AddOrRemove(AContext, VerificationResult, ValidationColumn);
}
}
else // If the Account is not foreign, I have nothing at all to say about the contents of the currency field.
{
AVerificationResultCollection.AddOrRemove(null, ARow.Table.Columns[AAccountTable.ColumnForeignCurrencyCodeId]);
}
}
示例15: ValidateSUserDetails
/// <summary>
/// Validates SUser Details
/// </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 ValidateSUserDetails(object AContext, SUserRow ARow,
ref TVerificationResultCollection AVerificationResultCollection, TValidationControlsDict AValidationControlsDict)
{
DataColumn ValidationColumn;
TValidationControlsData ValidationControlsData;
TVerificationResult VerificationResult = null;
// Don't validate deleted DataRows
if (ARow.RowState == DataRowState.Deleted)
{
return;
}
ValidationColumn = ARow.Table.Columns[SUserTable.ColumnPasswordHashId];
AValidationControlsDict.TryGetValue(ValidationColumn, out ValidationControlsData);
// PasswordHash must not be empty.
if ((ARow.RowState != DataRowState.Unchanged) && string.IsNullOrEmpty(ARow.PasswordHash))
{
VerificationResult = new TScreenVerificationResult(new TVerificationResult(AContext,
ErrorCodes.GetErrorInfo(PetraErrorCodes.ERR_MISSING_PASSWORD, new string[] { ARow.UserId })),
ValidationColumn, ValidationControlsData.ValidationControl);
// Handle addition to/removal from TVerificationResultCollection
AVerificationResultCollection.Auto_Add_Or_AddOrRemove(AContext, VerificationResult, ValidationColumn);
}
// If this is a first password (no salt) check that the password is valid.
if ((ARow.RowState != DataRowState.Unchanged) && string.IsNullOrEmpty(ARow.PasswordSalt) && !string.IsNullOrEmpty(ARow.PasswordHash))
{
VerificationResult = null;
if (!CheckPasswordQuality(ARow.PasswordHash, out VerificationResult))
{
VerificationResult = new TScreenVerificationResult(VerificationResult, ValidationColumn, ValidationControlsData.ValidationControl);
AVerificationResultCollection.Auto_Add_Or_AddOrRemove(AContext, VerificationResult, ValidationColumn);
}
}
}