OpenPetra
Free Administration Software for Non-Profits
Ict.Petra.Server.MFinance.Common.TCommonImport Class Reference

Helper class for parsing import lines in an import file More...

Static Public Member Functions

static String ImportString (ref String AImportLine, String ADelimiter, String AColumnTitle, DataColumn ADataColumn, int ARowNumber, TVerificationResultCollection AMessages, bool ATreatEmptyStringAsText=true)
 Imports a string value from the specified text line using the specified delimiter More...
 
static Boolean ImportBoolean (ref String AImportLine, String ADelimiter, String AColumnTitle, DataColumn ADataColumn, int ARowNumber, TVerificationResultCollection AMessages, String ADefaultString="")
 Imports a boolean value from the specified text line using the specified delimiter. More...
 
static Int64 ImportInt64 (ref String AImportLine, String ADelimiter, String AColumnTitle, DataColumn ADataColumn, int ARowNumber, TVerificationResultCollection AMessages, String ADefaultString="")
 Imports an Int64 value from the specified text line using the specified delimiter More...
 
static Int32 ImportInt32 (ref String AImportLine, String ADelimiter, String AColumnTitle, DataColumn ADataColumn, int ARowNumber, TVerificationResultCollection AMessages, String ADefaultString="")
 Imports an Int32 value from the specified text line using the specified delimiter More...
 
static decimal ImportDecimal (ref String AImportLine, String ADelimiter, CultureInfo ACultureInfoNumberFormat, String AColumnTitle, DataColumn ADataColumn, int ARowNumber, TVerificationResultCollection AMessages, String ADefaultString="")
 Imports a decimal value from the specified text line using the specified delimiter and culture info More...
 
static DateTime ImportDate (ref String AImportLine, String ADelimiter, CultureInfo ACultureInfoDateFormat, bool ADateMayBeAnInteger, String AColumnTitle, DataColumn ADataColumn, int ARowNumber, TVerificationResultCollection AMessages, String ADefaultString="")
 Imports a Date value from the specified text line using the specified delimiter More...
 
static void FixAccountCodes (int ALedgerNumber, int ARowNumber, ref string AAccountCode, AAccountTable AAccountTableRef, ref string ACostCentreCode, ACostCentreTable ACostCentreTableRef, TVerificationResultCollection AMessages)
 Method to check and, if possible fix, codes that have had leading zeros removed by Excel for example. More...
 

Detailed Description

Helper class for parsing import lines in an import file

Member Function Documentation

◆ FixAccountCodes()

static void Ict.Petra.Server.MFinance.Common.TCommonImport.FixAccountCodes ( int  ALedgerNumber,
int  ARowNumber,
ref string  AAccountCode,
AAccountTable  AAccountTableRef,
ref string  ACostCentreCode,
ACostCentreTable  ACostCentreTableRef,
TVerificationResultCollection  AMessages 
)
inlinestatic

Method to check and, if possible fix, codes that have had leading zeros removed by Excel for example.

Parameters
ALedgerNumberThe ledger number
ARowNumberThe current row number
AAccountCodeThe account code that may get changed
AAccountTableRefThe account table that will be checked for valid codes
ACostCentreCodeThe cost centre code that may get changed
ACostCentreTableRefThe cost centre table that will be checked for valid codes
AMessagesA message collection. If a change is made a 'Information' (non-critical) message will be added to the collection

◆ ImportBoolean()

static Boolean Ict.Petra.Server.MFinance.Common.TCommonImport.ImportBoolean ( ref String  AImportLine,
String  ADelimiter,
String  AColumnTitle,
DataColumn  ADataColumn,
int  ARowNumber,
TVerificationResultCollection  AMessages,
String  ADefaultString = "" 
)
inlinestatic

Imports a boolean value from the specified text line using the specified delimiter.

Parameters
AImportLineThe 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.
ADelimiterThe delimiter
AColumnTitle
ADataColumn
ARowNumber
AMessages
ADefaultStringA string to apply if the import returns empty text. Must be either 'yes' or 'no'
Returns
Returns true if the text is 'yes', false if the text is 'no'. Otherwise the method returns a critical Verification Result.

◆ ImportDate()

static DateTime Ict.Petra.Server.MFinance.Common.TCommonImport.ImportDate ( ref String  AImportLine,
String  ADelimiter,
CultureInfo  ACultureInfoDateFormat,
bool  ADateMayBeAnInteger,
String  AColumnTitle,
DataColumn  ADataColumn,
int  ARowNumber,
TVerificationResultCollection  AMessages,
String  ADefaultString = "" 
)
inlinestatic

Imports a Date value from the specified text line using the specified delimiter

Parameters
AImportLineThe 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.
ADelimiterThe delimiter
ACultureInfoDateFormat
ADateMayBeAnInteger
AColumnTitle
ADataColumn
ARowNumber
AMessages
ADefaultString
Returns
The date value. The AImportLine parameter will have been clipped.

◆ ImportDecimal()

static decimal Ict.Petra.Server.MFinance.Common.TCommonImport.ImportDecimal ( ref String  AImportLine,
String  ADelimiter,
CultureInfo  ACultureInfoNumberFormat,
String  AColumnTitle,
DataColumn  ADataColumn,
int  ARowNumber,
TVerificationResultCollection  AMessages,
String  ADefaultString = "" 
)
inlinestatic

Imports a decimal value from the specified text line using the specified delimiter and culture info

Parameters
AImportLineThe 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.
ADelimiterThe delimiter
ACultureInfoNumberFormat
AColumnTitle
ADataColumn
ARowNumber
AMessages
ADefaultString
Returns
The value. The AImportLine parameter will have been clipped.

◆ ImportInt32()

static Int32 Ict.Petra.Server.MFinance.Common.TCommonImport.ImportInt32 ( ref String  AImportLine,
String  ADelimiter,
String  AColumnTitle,
DataColumn  ADataColumn,
int  ARowNumber,
TVerificationResultCollection  AMessages,
String  ADefaultString = "" 
)
inlinestatic

Imports an Int32 value from the specified text line using the specified delimiter

Parameters
AImportLineThe 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.
ADelimiterThe delimiter
AColumnTitle
ADataColumn
ARowNumber
AMessages
ADefaultString
Returns
The value. The AImportLine parameter will have been clipped.

◆ ImportInt64()

static Int64 Ict.Petra.Server.MFinance.Common.TCommonImport.ImportInt64 ( ref String  AImportLine,
String  ADelimiter,
String  AColumnTitle,
DataColumn  ADataColumn,
int  ARowNumber,
TVerificationResultCollection  AMessages,
String  ADefaultString = "" 
)
inlinestatic

Imports an Int64 value from the specified text line using the specified delimiter

Parameters
AImportLineThe 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.
ADelimiterThe delimiter
AColumnTitle
ADataColumn
ARowNumber
AMessages
ADefaultString
Returns
The value. The AImportLine parameter will have been clipped.

◆ ImportString()

static String Ict.Petra.Server.MFinance.Common.TCommonImport.ImportString ( ref String  AImportLine,
String  ADelimiter,
String  AColumnTitle,
DataColumn  ADataColumn,
int  ARowNumber,
TVerificationResultCollection  AMessages,
bool  ATreatEmptyStringAsText = true 
)
inlinestatic

Imports a string value from the specified text line using the specified delimiter

Parameters
AImportLineThe 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.
ADelimiterThe delimiter
AColumnTitle
ADataColumn
ARowNumber
AMessages
ATreatEmptyStringAsTextWhen true the return value will be the empty string. When false the return value will be null.
Returns
The string value. The AImportLine parameter will have been clipped.

The documentation for this class was generated from the following file: