本文整理汇总了C#中TValidationControlsDict.Add方法的典型用法代码示例。如果您正苦于以下问题:C# TValidationControlsDict.Add方法的具体用法?C# TValidationControlsDict.Add怎么用?C# TValidationControlsDict.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TValidationControlsDict
的用法示例。
在下文中一共展示了TValidationControlsDict.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: 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);
}
}
}
示例3: 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);
}
}
示例4: 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);
}
}
示例5: 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);
}
}
示例6: 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);
}
}
示例7: ValidatePBankManual
static partial void ValidatePBankManual(ref TVerificationResultCollection AVerificationResult,
TTypedDataTable ASubmitTable)
{
TValidationControlsDict ValidationControlsDict = new TValidationControlsDict();
ValidationControlsDict.Add(ASubmitTable.Columns[PPartnerTable.ColumnStatusCodeId],
new TValidationControlsData(null, Catalog.GetString("Partner &Status")));
ValidationControlsDict.Add(ASubmitTable.Columns[PBankTable.ColumnBranchCodeId],
new TValidationControlsData(null, Catalog.GetString("Bank/Branch Code"),
null, Catalog.GetString("BIC/SWIFT Code")));
ValidationControlsDict.Add(ASubmitTable.Columns[PBankTable.ColumnBicId],
new TValidationControlsData(null, Catalog.GetString("BIC/SWIFT Code")));
for (int Counter = 0; Counter < ASubmitTable.Rows.Count; Counter++)
{
TSharedPartnerValidation_Partner.ValidatePartnerBankManual("TPartnerEditUIConnector" +
" (Error in Row #" + Counter.ToString() + ")", // No translation of message text since the server's messages should be all in English
(PBankRow)ASubmitTable.Rows[Counter], ref AVerificationResult,
ValidationControlsDict);
}
}
示例8: 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);
}
}
示例9: 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);
}
}
}
示例10: ImportDate
private DateTime ImportDate(String AColumnTitle,
DataColumn ADataColumn,
int ARowNumber,
TVerificationResultCollection AMessages,
TValidationControlsDict AValidationColumnsDict,
String ADefaultString = "")
{
if ((ADataColumn != null) && (AValidationColumnsDict != null) && !AValidationColumnsDict.ContainsKey(ADataColumn))
{
AValidationColumnsDict.Add(ADataColumn, new TValidationControlsData(null, AColumnTitle));
}
String sDate = StringHelper.GetNextCSV(ref FImportLine, FDelimiter);
if (sDate == String.Empty)
{
sDate = ADefaultString;
}
DateTime dtReturn;
try
{
dtReturn = Convert.ToDateTime(sDate, FCultureInfoDate);
}
catch (Exception)
{
AMessages.Add(new TVerificationResult(String.Format(MCommonConstants.StrParsingErrorInLineColumn, ARowNumber, AColumnTitle),
String.Format(Catalog.GetString("Cannot convert '{0}' to a date. Will assume a value of 'Today'."), sDate),
TResultSeverity.Resv_Critical));
TLogging.Log("Problem parsing " + sDate + " with format " + FCultureInfoDate.DateTimeFormat.ShortDatePattern);
return DateTime.Today;
}
return dtReturn;
}
示例11: ImportDecimal
private decimal ImportDecimal(String AColumnTitle,
DataColumn ADataColumn,
int ARowNumber,
TVerificationResultCollection AMessages,
TValidationControlsDict AValidationColumnsDict,
String ADefaultString = "")
{
if ((ADataColumn != null) && (AValidationColumnsDict != null) && !AValidationColumnsDict.ContainsKey(ADataColumn))
{
AValidationColumnsDict.Add(ADataColumn, new TValidationControlsData(null, AColumnTitle));
}
String sReturn = StringHelper.GetNextCSV(ref FImportLine, FDelimiter);
if (sReturn == String.Empty)
{
sReturn = ADefaultString;
}
try
{
decimal dec = Convert.ToDecimal(sReturn, FCultureInfoNumberFormat);
return dec;
}
catch
{
AMessages.Add(new TVerificationResult(String.Format(MCommonConstants.StrParsingErrorInLineColumn, ARowNumber, AColumnTitle),
String.Format(Catalog.GetString("Cannot convert '{0}' to a decimal number. Will assume a value of 1.00."), sReturn),
TResultSeverity.Resv_Critical));
return 1.0m;
}
}
示例12: ImportInt32
private Int32 ImportInt32(String AColumnTitle,
DataColumn ADataColumn,
int ARowNumber,
TVerificationResultCollection AMessages,
TValidationControlsDict AValidationColumnsDict,
String ADefaultString = "")
{
if ((ADataColumn != null) && (AValidationColumnsDict != null) && !AValidationColumnsDict.ContainsKey(ADataColumn))
{
AValidationColumnsDict.Add(ADataColumn, new TValidationControlsData(null, AColumnTitle));
}
String sReturn = StringHelper.GetNextCSV(ref FImportLine, FDelimiter);
if (sReturn == String.Empty)
{
sReturn = ADefaultString;
}
Int32 retVal;
if (Int32.TryParse(sReturn, out retVal))
{
return retVal;
}
AMessages.Add(new TVerificationResult(String.Format(MCommonConstants.StrParsingErrorInLineColumn, ARowNumber, AColumnTitle),
String.Format(Catalog.GetString("Cannot convert '{0}' to a number. Will assume a value of -1."), sReturn),
TResultSeverity.Resv_Critical));
return -1;
}
示例13: ImportBoolean
private Boolean ImportBoolean(String AColumnTitle,
DataColumn ADataColumn,
TValidationControlsDict AValidationColumnsDict,
String ADefaultString = "")
{
if ((ADataColumn != null) && (AValidationColumnsDict != null) && !AValidationColumnsDict.ContainsKey(ADataColumn))
{
AValidationColumnsDict.Add(ADataColumn, new TValidationControlsData(null, AColumnTitle));
}
String sReturn = StringHelper.GetNextCSV(ref FImportLine, FDelimiter);
if (sReturn == String.Empty)
{
sReturn = ADefaultString;
}
return sReturn.ToLower().Equals("yes");
}
示例14: ImportString
private String ImportString(String AColumnTitle,
DataColumn ADataColumn,
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 FImportLine, FDelimiter);
if ((sReturn.Length == 0) && !ATreatEmptyStringAsText)
{
return null;
}
return sReturn;
}
示例15: ImportBoolean
/// <summary>
/// Imports a boolean 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="ADefaultString">A string to apply if the import returns empty text. Must be either 'yes' or 'no'</param>
/// <returns>Returns true if the text is 'yes', false if the text is 'no'. Otherwise the method returns a critical Verification Result.</returns>
public static Boolean ImportBoolean(ref String AImportLine,
String ADelimiter,
String AColumnTitle,
DataColumn ADataColumn,
int ARowNumber,
TVerificationResultCollection AMessages,
TValidationControlsDict AValidationColumnsDict,
String ADefaultString = "")
{
if ((ADataColumn != null) && (AValidationColumnsDict != null) && !AValidationColumnsDict.ContainsKey(ADataColumn))
{
AValidationColumnsDict.Add(ADataColumn, new TValidationControlsData(null, AColumnTitle));
}
String sReturn = StringHelper.GetNextCSV(ref AImportLine, ADelimiter).ToLower();
String sDefault = ADefaultString.ToLower();
bool canBeEmptyString = ((sDefault == "yes") || (sDefault == "no"));
if ((sReturn == String.Empty) && canBeEmptyString)
{
sReturn = sDefault;
}
if ((sReturn == "yes") || (sReturn == "no"))
{
return sReturn.Equals("yes");
}
AMessages.Add(new TVerificationResult(String.Format(MCommonConstants.StrParsingErrorInLineColumn, ARowNumber, AColumnTitle),
String.Format(Catalog.GetString("Cannot convert '{0}' to a Boolean. The text must be {1}. The text is not case-sensitive."),
sReturn,
canBeEmptyString ? Catalog.GetString("one of 'yes', 'no' or an empty string") : Catalog.GetString("either 'yes' or 'no'")),
TResultSeverity.Resv_Critical));
return false;
}