OpenPetra
Free Administration Software for Non-Profits
Ict.Petra.Server.MPartner.Common.Calculations Class Reference

Contains functions to be used by the Server and the Client that perform certain calculations - specific for the Partner Module. More...

Classes

class  TOverallContactSettings
 Holds the 'Overall Contact Settings' of an arbitrary number of Partners. More...
 
class  TPartnersOverallContactSettings
 Holds details of a Partners' 'Overall Contact Settings' More...
 

Public Types

enum  TPartnerLocationFormatEnum { plfCommaSeparated , plfLineBreakSeparated , plfHtmlLineBreak }
 Specifies how to format the String that is returned by Method M:Ict.Petra.Server.MPartner.Common.Calculations.DetermineLocationString(Ict.Petra.Shared.MPartner.Partner.Data.PLocationRow, Ict.Petra.Shared.MPartner.Calculations.TPartnerLocationFormatEnum). More...
 
enum  TOverallContSettingKind {
  ocskPrimaryEmailAddress = 1 , ocskPrimaryPhoneNumber = 2 , ocskEmailAddressWithinOrg = 4 , ocskPhoneNumberWithinOrg = 8 ,
  ocskPrimaryContactMethod = 16 , ocskSecondaryEmailAddress = 32
}
 Kinds of 'Overall Contact Settings' More...
 

Static Public Member Functions

static void DeterminePartnerLocationsDateStatus (DataSet APartnerLocationsDS)
 check the validity of each location and update the icon for each location (current address, old address, future address) for the current date More...
 
static void DeterminePartnerLocationsDateStatus (DataTable APartnerLocationsDT, DateTime ADateToCheck)
 check the validity of each location and update the icon of each location (current address, old address, future address) More...
 
static TLocationPK DetermineBestAddress (DataSet APartnerLocationsDS)
 Determines which address is the 'Best Address' of a Partner, and marks it in the DataColumn 'BestAddress'. More...
 
static TLocationPK DetermineBestAddress (DataTable APartnerLocationsDT)
 Determines which address is the 'Best Address' of a Partner, and marks it in the DataColumn 'BestAddress'. More...
 
static bool DetermineBestAddress (DataTable APartnerLocationsDT, out Int64 ASiteKey, out int ALocationKey)
 Determines which address is the 'Best Address' of a Partner, and marks it in the DataColumn 'BestAddress'. More...
 
static PLocationRow FindBestAddressLocation (PartnerEditTDSPPartnerLocationTable APartnerLocationDT, PLocationTable ALocationDT)
 Returns the PLocationRow of the 'Best Address'. More...
 
static PLocationRow FindBestAddressLocation (TLocationPK ABestLocationPK, PLocationTable ALocationDT)
 Returns the PLocationRow of the 'Best Address'. More...
 
static String DetermineLocationString (PLocationRow ALocationDR, TPartnerLocationFormatEnum APartnerLocationStringFormat=TPartnerLocationFormatEnum.plfLineBreakSeparated, Int32 AaddressOrder=0, String ACountryName="")
 Builds a formatted String out of the data that is contained in a Location. More...
 
static String DetermineLocationString (String ABuilding1, String ABuilding2, String ALocality, String AStreetName, String AAddress3, String ASuburb, String ACity, String ACounty, String APostalCode, String ACountryName, TPartnerLocationFormatEnum PartnerLocationStringFormat=TPartnerLocationFormatEnum.plfLineBreakSeparated, Int32 AaddressOrder=0)
 Builds a formatted String out of the data that is contained in a Location. More...
 
static DataView DetermineCurrentAddresses (PPartnerLocationTable ATable)
 get the current address from a location table More...
 
static bool GetPrimaryEmailAddress (TDBTransaction AReadTransaction, PPartnerAttributeTable APPartnerAttributeDT, out string APrimaryEmailAddress)
 Gets the 'Primary E-Mail Address' of a Partner. More...
 
static bool GetPrimaryEmailAddress (TPartnersOverallContactSettings APrimaryContactAttributes, out string APrimaryEmailAddress)
 Gets the 'Primary E-Mail Address' of a Partner. More...
 
static bool GetPrimaryPhoneNumber (TDBTransaction AReadTransaction, PPartnerAttributeTable APPartnerAttributeDT, out string APrimaryPhoneNumber)
 Gets the 'Primary Phone Number' of a Partner. More...
 
static bool GetPrimaryPhoneNumber (TPartnersOverallContactSettings APrimaryContactAttributes, out string APrimaryPhoneNumber)
 Gets the 'Primary Phone Number' of a Partner. More...
 
static bool GetWithinOrganisationEmailAddress (TDBTransaction AReadTransaction, PPartnerAttributeTable APPartnerAttributeDT, out string AWithinOrganisationEmailAddress)
 Gets the 'Within Organisation E-Mail Address' of a Partner. More...
 
static bool GetWithinOrganisationEmailAddress (TPartnersOverallContactSettings APrimaryContactAttributes, out string AWithinOrganisationEmailAddress)
 Gets the 'Within Organisation E-Mail Address' of a Partner. More...
 
static bool GetPrimaryEmailAndPrimaryPhone (TDBTransaction AReadTransaction, PPartnerAttributeTable APPartnerAttributeDT, out string APrimaryPhoneNumber, out string APrimaryEmailAddress)
 Gets the 'Primary Phone Number' and the 'Primary E-mail Address' of a Partner. More...
 
static bool GetPrimaryEmailAndPrimaryPhone (TPartnersOverallContactSettings APrimaryContactAttributes, out string APrimaryPhoneNumber, out string APrimaryEmailAddress)
 Gets the 'Primary Phone Number' and the 'Primary E-mail Address' of a Partner. More...
 
static TPartnersOverallContactSettings DeterminePrimaryOrWithinOrgSettingsForPartner (TDBTransaction AReadTransaction, PPartnerAttributeTable APPartnerAttributeDT, TOverallContSettingKind AOverallContSettingKind)
 Determines the 'Primary' and/or 'Within Organisation' setting(s) for the Partner whose PPartnerAttributes records are contained in APPartnerAttributeDT . More...
 
static TOverallContactSettings DeterminePrimaryOrWithinOrgSettings (TDBTransaction AReadTransaction, PPartnerAttributeTable APPartnerAttributeDT, TOverallContSettingKind AOverallContSettingKind, Int64 APartnerKey=-1)
 Determines the 'Primary' and/or 'Within Organisation' setting(s) for (each of) the Partner(s) contained in APPartnerAttributeDT . More...
 
static void DeterminePartnerSystemCategorySettings (TDBTransaction AReadTransaction, PPartnerAttributeTable APartnerAttributeDT, ref TPartnersOverallContactSettings AOverallContactSettings, TOverallContSettingKind AOverallContSettingKind)
 Determines the 'System Category' setting(s) for the Partner whose PPartnerAttributes records are contained in APartnerAttributeDT . More...
 
static bool RowHasPhoneAttributeType (DataView APhoneAttributesDV, PPartnerAttributeRow APartnerAttributeRow)
 Checks whether the DataRow passed in with APartnerAttributeRow has got an AttributeType that constitutes a Phone Number (but not a Fax Number). More...
 
static bool RowHasPhoneOrFaxAttributeType (DataView APhoneAttributesDV, PPartnerAttributeRow APartnerAttributeRow, bool AExcludeFax)
 Checks whether the DataRow passed in with APartnerAttributeRow has got an AttributeType that constitutes a Phone Number or a Fax Number (but the latter only if AExcludeFax isn't true). More...
 
static string ConcatenatePhoneOrFaxNumberWithIntlCountryPrefix (PPartnerAttributeRow ARow)
 Prefixes a Phone Number or Fax Number with the International Country Code. More...
 
static DataRow FindCountryRowInCachedCountryList (string ACountryCode)
 Looks up a Country by its Country Code in the 'CountryList' Cacheable DataTable. More...
 
static string ConcatenatePhoneOrFaxNumberWithIntlCountryPrefix (string AValue, string AInternatTelephoneCode)
 Prefixes a Phone Number or Fax Number with the International Country Code. More...
 
static DataView DeterminePhoneAttributes (PPartnerAttributeTypeTable APPartnerAttributeTypeDT)
 Determines which p_partner_attribute_type records have p_category_code_c 'Phone' More...
 
static DataView DeterminePartnerPhoneNumbers (TDBTransaction AReadTransaction, PPartnerAttributeTable APPartnerAttributeDT, bool AOnlyCurrentPhoneNumbers, bool AIncludeFaxNumbers)
 Determines all p_partner_attribute records whose p_attribute_type points to a p_partner_attribute_type record that has p_category_code_c 'Phone' and returns the result. More...
 
static string DeterminePartnerFaxNumber (TDBTransaction AReadTransaction, PPartnerAttributeTable APPartnerAttributeDT)
 Determines the (first) current 'Fax Number' that is contained in the p_partner_attribute records of a given Partner. More...
 
static string DeterminePhonePartnerAttributeTypes (PPartnerAttributeTypeTable APPartnerAttributeTypeDT)
 Determines all p_partner_attribute_type records that have p_category_code_c 'Phone' and returns the result. More...
 
static DataView DetermineEmailAttributes (PPartnerAttributeTypeTable APPartnerAttributeTypeDT)
 Determines which p_partner_attribute_type records are of p_attribute_type_value_kind_c 'CONTACTDETAIL_EMAILADDRESS' More...
 
static string DetermineEmailPartnerAttributeTypes (PPartnerAttributeTypeTable APPartnerAttributeTypeDT)
 Determines all p_partner_attribute_type records that are of p_attribute_type_value_kind_c 'CONTACTDETAIL_EMAILADDRESS' and returns the result. More...
 
static DataView DeterminePartnerEmailAddresses (TDBTransaction AReadTransaction, PPartnerAttributeTable APPartnerAttributeDT, bool AOnlyCurrentEmailAddresses)
 Determines all p_partner_attribute records whose p_attribute_type points to a p_partner_attribute_type record that is of p_attribute_type_value_kind_c 'CONTACTDETAIL_EMAILADDRESS' and returns the result. More...
 
static string GetSystemCategorySettingsConcatStr (TDBTransaction AReadTransaction)
 Determines all p_partner_attribute_type records which constitute Partner Contact Details and returns the result. More...
 
static string GetEmailPartnerAttributesConcatStr (TDBTransaction AReadTransaction)
 Determines all p_partner_attribute_type records that are of p_attribute_type_value_kind_c 'CONTACTDETAIL_EMAILADDRESS' and returns the result. More...
 
static string GetPhonePartnerAttributesConcatStr (TDBTransaction AReadTransaction)
 Determines all p_partner_attribute_type records that have p_category_code_c 'Phone'. More...
 
static int DeterminePartnerContactDetailAttributes (TDBTransaction AReadTransaction, PPartnerAttributeTable APPartnerAttributeDT)
 Determines which Partner Attributes are and which aren't Partner Contact Attributes, and marks them in the DataColumn 'PartnerContactDetail': Partner Attributes whose AttributeType is not a PartnerAttributeType whose PartnerAttributeCategory is a Partner Contact one PPartnerAttributeCategory.PartnerContactCategory Column holds 'false') aren't! More...
 
static void DetermineValueKindOfPartnerAttributeRecord (object AAttributeDR, PPartnerAttributeTypeTable APPartnerAttributeType, out PPartnerAttributeTypeRow AContactTypeDR, out TPartnerAttributeTypeValueKind AValueKind)
 Determines the Value Kind (TPartnerAttributeTypeValueKind) of a p_partner_attribute record. More...
 
static TPartnerAttributeTypeValueKind GetValueKind (PPartnerAttributeTypeRow AContactTypeDR)
 Gets the Value Kind (TPartnerAttributeTypeValueKind) of a p_partner_attribute_type record. More...
 
static void CreateCustomDataColumnsForAttributeTable (PPartnerAttributeTable APPartnerAttributeDT, PPartnerAttributeTypeTable APPartnerAttributeTypeDT)
 Creates custom DataColumns that will be added to an instance of a PPartnerAttribute Table. More...
 
static void SetColumnExpressions (PPartnerAttributeTable APPartnerAttributeDT)
 Sets the Column Expressions for the calculated DataColumns More...
 
static string BuildLinkWithValue (string AValue, TPartnerAttributeTypeValueKind AValueKind, string AHyperlinkFormat)
 Constructs a valid URL string from a Value that is of a Contact Type that has got a Hyperlink Format set up. More...
 
static String DeterminePartnerShortName (String AName, String ATitle, String AFirstName, String AMiddleName)
 format the shortname for a partner in a standardized way More...
 
static String DeterminePartnerShortName (String AName, String ATitle, String AFirstName)
 overload for DeterminePartnerShortName, no middle name More...
 
static String DeterminePartnerShortName (String AName, String ATitle)
 overload for DeterminePartnerShortName, no middle name and no first name More...
 
static String DeterminePartnerShortName (String AName)
 overload for DeterminePartnerShortName, no title, firstname and middle name More...
 
static void CalculateTabCountsContacts (PContactLogTable ATable, out Int32 ATotalContacts)
 Count the subscriptions More...
 
static string FormatShortName (string AShortname, eShortNameFormat AFormat)
 convert shortname from Lastname, firstname, title to another shortname format TODO: use partner key to get to the full name, resolve issues with couples that have different family names etc More...
 
static string FormalGreeting (string APartnerShortName)
 format a formal greeting for the given partner short name. this formal greeting can be used in a letter More...
 
static int CalculateAge (DateTime ABirthday)
 Calculates the age in years at the current date. More...
 
static int CalculateAge (DateTime ABirthday, DateTime ACalculationDate)
 Calculates the age in years at a given date. More...
 
static void CalculateTabCountsAddresses (PPartnerLocationTable ATable, out Int32 ATotalAddresses, out Int32 ACurrentAddresses)
 count the available current addresses and the total number of addresses More...
 
static void CalculateTabCountsPartnerContactDetails (PartnerEditTDSPPartnerAttributeTable ATable, out Int32 ATotalPartnerContactDetails, out Int32 AActivePartnerContactDetails)
 Count the Partner Contact Details. More...
 
static void CalculateTabCountsSubscriptions (PSubscriptionTable ATable, out Int32 ATotalSubscriptions, out Int32 AActiveSubscriptions)
 Count the subscriptions More...
 
static void CalculateTabCountsPartnerRelationships (PPartnerRelationshipTable ATable, out Int32 ATotalRelationships)
 Count the relationships More...
 

Static Public Attributes

const String PARTNERLOCATION_BESTADDR_COLUMN = "BestAddress"
 column name for best address More...
 
const String PARTNERLOCATION_ICON_COLUMN = "Icon"
 column name for the location icon More...
 
const string ATTR_TYPE_PARTNERS_PRIMARY_CONTACT_METHOD = "PARTNERS_PRIMARY_CONTACT_METHOD"
 Partner Attribute Type that denotes the 'Primary Contact Method'. More...
 
const string ATTR_TYPE_PARTNERS_SECONDARY_EMAIL_ADDRESS = "PARTNERS_SECONDARY_EMAIL_ADDRESS"
 Partner Attribute Type that denotes the 'Secondary E-mail Address'. More...
 
static readonly String PARTNERATTRIBUTE_PARTNERCONTACTDETAIL_COLUMN = "PartnerContactDetail"
 Column name for the column 'Partner Contact Detail' that can get added to a PPartnerAttribute Table (gets added by Method DeterminePartnerContactDetailAttributes). More...
 
static readonly string CALCCOLUMNNAME_PARTNERATTRIBUTETYPE = "Parent_" + PPartnerAttributeTypeTable.GetAttributeTypeDBName()
 Column name for a column that can get added to a PPartnerAttribute Table (gets added by Method CreateCustomDataColumnsForAttributeTable). More...
 
static readonly string CALCCOLUMNNAME_PARENTATTRIBUTEINDEX = "Parent_AttributeIndex"
 Column name for a column that can get added to a PPartnerAttribute Table (gets added by Method CreateCustomDataColumnsForAttributeTable). More...
 
static readonly string CALCCOLUMNNAME_PARENTPARENTCATEGORYINDEX = "Parent_Parent_CategoryIndex"
 Column name for a column that can get added to a PPartnerAttribute Table (gets added by Method CreateCustomDataColumnsForAttributeTable). More...
 
static readonly string CALCCOLUMNNAME_CONTACTTYPE = "ContactType"
 Column name for a column that can get added to a PPartnerAttribute Table (gets added by Method CreateCustomDataColumnsForAttributeTable). More...
 
static readonly string CALCCOLUMNNAME_INTLPHONEPREFIX = "InternationalPhonePrefix"
 Column name for a column that can get added to a PPartnerAttribute Table (gets added by Method CreateCustomDataColumnsForAttributeTable). More...
 
static readonly string CALCCOLUMNNAME_VALUE = "CalculatedValue"
 Column name for a column that can get added to a PPartnerAttribute Table (gets added by Method CreateCustomDataColumnsForAttributeTable). More...
 
static readonly string CALCCOLUMNNAME_CATEGORYINDEX = "CategoryIndex"
 Column name for a column that can get added to a PPartnerAttribute Table (gets added by Method CreateCustomDataColumnsForAttributeTable). More...
 

Detailed Description

Contains functions to be used by the Server and the Client that perform certain calculations - specific for the Partner Module.

There is anoher part of this Partial Class that holds only Methods that are to do with the 'Contact Detail' implementation.

This part of this Partial Class holds only Methods that are to do with the 'Contact Detail' implementation.

There are two further parts of this Partial Class, Calculations.Address.cs and Calculations.ContactDetails.cs that hold only Methods that are to do with the 'Addresses' and 'Contact Detail'-related implementations!

Member Enumeration Documentation

◆ TOverallContSettingKind

Kinds of 'Overall Contact Settings'

Enumerator
ocskPrimaryEmailAddress 

Primary Email Address.

ocskPrimaryPhoneNumber 

Primary Phone Number.

ocskEmailAddressWithinOrg 

Email Address Within Organisation.

ocskPhoneNumberWithinOrg 

Phone Number Within Organisation.

ocskPrimaryContactMethod 

Primary Contact Method.

ocskSecondaryEmailAddress 

SecondaryEmailAddress.

◆ TPartnerLocationFormatEnum

Specifies how to format the String that is returned by Method M:Ict.Petra.Server.MPartner.Common.Calculations.DetermineLocationString(Ict.Petra.Shared.MPartner.Partner.Data.PLocationRow, Ict.Petra.Shared.MPartner.Calculations.TPartnerLocationFormatEnum).

Enumerator
plfCommaSeparated 

Return Location Part Strings separated by comma

plfLineBreakSeparated 

Return Location Part Strings separated by CR+LF

plfHtmlLineBreak 

Return Location Part Strings separated by HTML br element

Member Function Documentation

◆ BuildLinkWithValue()

static string Ict.Petra.Server.MPartner.Common.Calculations.BuildLinkWithValue ( string  AValue,
TPartnerAttributeTypeValueKind  AValueKind,
string  AHyperlinkFormat 
)
inlinestatic

Constructs a valid URL string from a Value that is of a Contact Type that has got a Hyperlink Format set up.

Parameters
AValueValue that should replace THyperLinkHandling.HYPERLINK_WITH_VALUE_VALUE_PLACEHOLDER_IDENTIFIER in the Hyperlink Format string.
AValueKindValue Kind of Partner Attribute Type. MUST be TPartnerAttributeTypeValueKind.CONTACTDETAIL_HYPERLINK_WITHVALUE!
AHyperlinkFormatFormat string for building the URL in which the placeholder gets replaced with AValue .
Returns
URL with the Value replacing THyperLinkHandling.HYPERLINK_WITH_VALUE_VALUE_PLACEHOLDER_IDENTIFIER.

◆ CalculateAge() [1/2]

static int Ict.Petra.Server.MPartner.Common.Calculations.CalculateAge ( DateTime  ABirthday)
inlinestatic

Calculates the age in years at the current date.

Parameters
ABirthdayThe birthday from which to calculate the current age
Returns
The age in years

◆ CalculateAge() [2/2]

static int Ict.Petra.Server.MPartner.Common.Calculations.CalculateAge ( DateTime  ABirthday,
DateTime  ACalculationDate 
)
inlinestatic

Calculates the age in years at a given date.

Parameters
ABirthdayThe birthday from which to calculate the age
ACalculationDateThe date against which the birthday should be calculated
Returns
The age in years

◆ CalculateTabCountsAddresses()

static void Ict.Petra.Server.MPartner.Common.Calculations.CalculateTabCountsAddresses ( PPartnerLocationTable  ATable,
out Int32  ATotalAddresses,
out Int32  ACurrentAddresses 
)
inlinestatic

count the available current addresses and the total number of addresses

Parameters
ATabletable with locations
ATotalAddressesreturns the total number of address
ACurrentAddressesreturns the number of current addresses

◆ CalculateTabCountsContacts()

static void Ict.Petra.Server.MPartner.Common.Calculations.CalculateTabCountsContacts ( PContactLogTable  ATable,
out Int32  ATotalContacts 
)
inlinestatic

Count the subscriptions

Parameters
ATabletable with contacts
ATotalContactsreturns the total number of contacts

◆ CalculateTabCountsPartnerContactDetails()

static void Ict.Petra.Server.MPartner.Common.Calculations.CalculateTabCountsPartnerContactDetails ( PartnerEditTDSPPartnerAttributeTable  ATable,
out Int32  ATotalPartnerContactDetails,
out Int32  AActivePartnerContactDetails 
)
inlinestatic

Count the Partner Contact Details.

Parameters
ATableTable with Partner Contact Details. This will be the PPartnerAttribute Table.
ATotalPartnerContactDetailsreturns the total number of Partner Contact Details.
AActivePartnerContactDetailsreturns the number of current Partner Contact Details.

◆ CalculateTabCountsPartnerRelationships()

static void Ict.Petra.Server.MPartner.Common.Calculations.CalculateTabCountsPartnerRelationships ( PPartnerRelationshipTable  ATable,
out Int32  ATotalRelationships 
)
inlinestatic

Count the relationships

Parameters
ATabletable with subscriptions
ATotalRelationshipsreturns the total number of relationships

◆ CalculateTabCountsSubscriptions()

static void Ict.Petra.Server.MPartner.Common.Calculations.CalculateTabCountsSubscriptions ( PSubscriptionTable  ATable,
out Int32  ATotalSubscriptions,
out Int32  AActiveSubscriptions 
)
inlinestatic

Count the subscriptions

Parameters
ATabletable with subscriptions
ATotalSubscriptionsreturns the total number of subscriptions
AActiveSubscriptionsreturns the number of active subscriptions

◆ ConcatenatePhoneOrFaxNumberWithIntlCountryPrefix() [1/2]

static string Ict.Petra.Server.MPartner.Common.Calculations.ConcatenatePhoneOrFaxNumberWithIntlCountryPrefix ( PPartnerAttributeRow  ARow)
inlinestatic

Prefixes a Phone Number or Fax Number with the International Country Code.

Parameters
ARowType p_partner_attribute row.
Returns
Phone Number / Fax Number prefixed with the International Country Code.

◆ ConcatenatePhoneOrFaxNumberWithIntlCountryPrefix() [2/2]

static string Ict.Petra.Server.MPartner.Common.Calculations.ConcatenatePhoneOrFaxNumberWithIntlCountryPrefix ( string  AValue,
string  AInternatTelephoneCode 
)
inlinestatic

Prefixes a Phone Number or Fax Number with the International Country Code.

Parameters
AValuePhone Number or Fax Number.
AInternatTelephoneCodeInternational Country Code for a Phone Number.
Returns
Phone Number / Fax Number prefixed with the International Country Code.

◆ CreateCustomDataColumnsForAttributeTable()

static void Ict.Petra.Server.MPartner.Common.Calculations.CreateCustomDataColumnsForAttributeTable ( PPartnerAttributeTable  APPartnerAttributeDT,
PPartnerAttributeTypeTable  APPartnerAttributeTypeDT 
)
inlinestatic

Creates custom DataColumns that will be added to an instance of a PPartnerAttribute Table.

Returns
void

◆ DetermineBestAddress() [1/3]

static TLocationPK Ict.Petra.Server.MPartner.Common.Calculations.DetermineBestAddress ( DataSet  APartnerLocationsDS)
inlinestatic

Determines which address is the 'Best Address' of a Partner, and marks it in the DataColumn 'BestAddress'.

There are convenient overloaded server-side Methods, Ict.Petra.Server.MPartner.ServerCalculations.DetermineBestAddress, which work by specifying the PartnerKey of a Partner in an Argument.

Parameters
APartnerLocationsDSDataset containing the addresses of a Partner.
Returns
A TLocationPK which points to the 'Best Address'. If no 'Best Address' was found, SiteKey and LocationKey of this instance will be both -1.

◆ DetermineBestAddress() [2/3]

static TLocationPK Ict.Petra.Server.MPartner.Common.Calculations.DetermineBestAddress ( DataTable  APartnerLocationsDT)
inlinestatic

Determines which address is the 'Best Address' of a Partner, and marks it in the DataColumn 'BestAddress'.

There are convenient overloaded server-side Methods, Ict.Petra.Server.MPartner.ServerCalculations.DetermineBestAddress, which work by specifying the PartnerKey of a Partner in an Argument.

Parameters
APartnerLocationsDTDataTable containing the addresses of a Partner.
Returns
A TLocationPK which points to the 'Best Address'. If no 'Best Address' was found, SiteKey and LocationKey of this instance will be both -1.

◆ DetermineBestAddress() [3/3]

static bool Ict.Petra.Server.MPartner.Common.Calculations.DetermineBestAddress ( DataTable  APartnerLocationsDT,
out Int64  ASiteKey,
out int  ALocationKey 
)
inlinestatic

Determines which address is the 'Best Address' of a Partner, and marks it in the DataColumn 'BestAddress'.

This method overload exists primarily for use in data migration from a legacy DB system. It gets called via .NET Reflection from Ict.Tools.DataDumpPetra2! DO NOT REMOVE THIS METHOD - although an IDE will not find any references to this Method!

Parameters
APartnerLocationsDTDataTable containing the addresses of a Partner.
ASiteKeySite Key of the 'Best Address'.
ALocationKeyLocation Key of the 'Best Address'.
Returns
True if a 'Best Address' was found, otherwise false. In the latter case ASiteKey and ALocationKey will be both -1, too.

◆ DetermineCurrentAddresses()

static DataView Ict.Petra.Server.MPartner.Common.Calculations.DetermineCurrentAddresses ( PPartnerLocationTable  ATable)
inlinestatic

get the current address from a location table

Parameters
ATabletable with locations
Returns
data view containing the current address

◆ DetermineEmailAttributes()

static DataView Ict.Petra.Server.MPartner.Common.Calculations.DetermineEmailAttributes ( PPartnerAttributeTypeTable  APPartnerAttributeTypeDT)
inlinestatic

Determines which p_partner_attribute_type records are of p_attribute_type_value_kind_c 'CONTACTDETAIL_EMAILADDRESS'

Parameters
APPartnerAttributeTypeDTPass an instance of PPartnerAttributeTypeTable that holds Contact Detail datarows
Returns
DataView that is filtered so that it contains only p_partner_attribute_type records are of p_attribute_type_value_kind_c 'CONTACTDETAIL_EMAILADDRESS'.

◆ DetermineEmailPartnerAttributeTypes()

static string Ict.Petra.Server.MPartner.Common.Calculations.DetermineEmailPartnerAttributeTypes ( PPartnerAttributeTypeTable  APPartnerAttributeTypeDT)
inlinestatic

Determines all p_partner_attribute_type records that are of p_attribute_type_value_kind_c 'CONTACTDETAIL_EMAILADDRESS' and returns the result.

Parameters
APPartnerAttributeTypeDTPass an instance of PPartnerAttributeTypeTable that holds datarows that constitute Contact Details
Returns
String that contains all p_partner_attribute_type records are of p_attribute_type_value_kind_c 'CONTACTDETAIL_EMAILADDRESS'.

◆ DetermineLocationString() [1/2]

static String Ict.Petra.Server.MPartner.Common.Calculations.DetermineLocationString ( PLocationRow  ALocationDR,
TPartnerLocationFormatEnum  APartnerLocationStringFormat = TPartnerLocationFormatEnum.plfLineBreakSeparated,
Int32  AaddressOrder = 0,
String  ACountryName = "" 
)
inlinestatic

Builds a formatted String out of the data that is contained in a Location.

Parameters
ALocationDRDataRow containing the Location data.
APartnerLocationStringFormatSpecifies how to format the String that is returned.
AaddressOrderAddressOrder from PCountry row
ACountryNameIf this is blank, the PLocationRow CountryCode will be used.
Returns
Formatted String.

◆ DetermineLocationString() [2/2]

static String Ict.Petra.Server.MPartner.Common.Calculations.DetermineLocationString ( String  ABuilding1,
String  ABuilding2,
String  ALocality,
String  AStreetName,
String  AAddress3,
String  ASuburb,
String  ACity,
String  ACounty,
String  APostalCode,
String  ACountryName,
TPartnerLocationFormatEnum  PartnerLocationStringFormat = TPartnerLocationFormatEnum.plfLineBreakSeparated,
Int32  AaddressOrder = 0 
)
inlinestatic

Builds a formatted String out of the data that is contained in a Location.

Parameters
ABuilding1building name 1
ABuilding2building name 2
ALocalitylocality
AStreetNamestreet name
AAddress3address 3
ASuburbsuburb
ACitycity
ACountycounty
APostalCodepostal code
ACountryNamecountry name
PartnerLocationStringFormatrequested format
AaddressOrderAddressOrder from PCountry row
Returns
formatted string

◆ DeterminePartnerContactDetailAttributes()

static int Ict.Petra.Server.MPartner.Common.Calculations.DeterminePartnerContactDetailAttributes ( TDBTransaction  AReadTransaction,
PPartnerAttributeTable  APPartnerAttributeDT 
)
inlinestatic

Determines which Partner Attributes are and which aren't Partner Contact Attributes, and marks them in the DataColumn 'PartnerContactDetail': Partner Attributes whose AttributeType is not a PartnerAttributeType whose PartnerAttributeCategory is a Partner Contact one PPartnerAttributeCategory.PartnerContactCategory Column holds 'false') aren't!

Parameters
AReadTransaction
APPartnerAttributeDTPartner Attribute Table in which the Partner Contact Attributes should be determined.
Returns
Number of non-Partner Contact Attributes.

◆ DeterminePartnerEmailAddresses()

static DataView Ict.Petra.Server.MPartner.Common.Calculations.DeterminePartnerEmailAddresses ( TDBTransaction  AReadTransaction,
PPartnerAttributeTable  APPartnerAttributeDT,
bool  AOnlyCurrentEmailAddresses 
)
inlinestatic

Determines all p_partner_attribute records whose p_attribute_type points to a p_partner_attribute_type record that is of p_attribute_type_value_kind_c 'CONTACTDETAIL_EMAILADDRESS' and returns the result.

Parameters
AReadTransaction
APPartnerAttributeDTPPartnerAttributeTable that contains the Contact Detail records of a given Partner - or of MANY (!) Partners.
AOnlyCurrentEmailAddressesSet to true to only return 'Valid' p_partner_attribute records (i.e. p_partner_attribute records whose p_current_l Flag is set to true).
Returns
DataView that is filtered so that it contains only p_partner_attribute records whose p_attribute_type points to a p_partner_attribute_type record that is of p_attribute_type_value_kind_c 'CONTACTDETAIL_EMAILADDRESS'.

◆ DeterminePartnerFaxNumber()

static string Ict.Petra.Server.MPartner.Common.Calculations.DeterminePartnerFaxNumber ( TDBTransaction  AReadTransaction,
PPartnerAttributeTable  APPartnerAttributeDT 
)
inlinestatic

Determines the (first) current 'Fax Number' that is contained in the p_partner_attribute records of a given Partner.

Parameters
AReadTransaction
APPartnerAttributeDTPPartnerAttributeTable that contains the Contact Detail records of a given Partner.
Returns
The (first) current 'Fax Number' if it was found, otherwise null. Should there be several current 'Fax Numbers' then the one that comes first (in the order as seen by the user) will get returned.

◆ DeterminePartnerLocationsDateStatus() [1/2]

static void Ict.Petra.Server.MPartner.Common.Calculations.DeterminePartnerLocationsDateStatus ( DataSet  APartnerLocationsDS)
inlinestatic

check the validity of each location and update the icon for each location (current address, old address, future address) for the current date

Parameters
APartnerLocationsDSthe dataset with the locations

◆ DeterminePartnerLocationsDateStatus() [2/2]

static void Ict.Petra.Server.MPartner.Common.Calculations.DeterminePartnerLocationsDateStatus ( DataTable  APartnerLocationsDT,
DateTime  ADateToCheck 
)
inlinestatic

check the validity of each location and update the icon of each location (current address, old address, future address)

Parameters
APartnerLocationsDTthe datatable to check
ADateToCheck

◆ DeterminePartnerPhoneNumbers()

static DataView Ict.Petra.Server.MPartner.Common.Calculations.DeterminePartnerPhoneNumbers ( TDBTransaction  AReadTransaction,
PPartnerAttributeTable  APPartnerAttributeDT,
bool  AOnlyCurrentPhoneNumbers,
bool  AIncludeFaxNumbers 
)
inlinestatic

Determines all p_partner_attribute records whose p_attribute_type points to a p_partner_attribute_type record that has p_category_code_c 'Phone' and returns the result.

Parameters
AReadTransaction
APPartnerAttributeDTPPartnerAttributeTable that contains the Contact Detail records of a given Partner - or of MANY (!) Partners.
AOnlyCurrentPhoneNumbersSet to true to only return 'Valid' p_partner_attribute records (i.e. p_partner_attribute records whose p_current_l Flag is set to true).
AIncludeFaxNumbersSet to false to exclude p_partner_attribute records whose p_attribute_type_c is 'Fax'.
Returns
DataView that is filtered so that it contains only p_partner_attribute records whose p_attribute_type points to a p_partner_attribute_type record that has p_category_code_c 'Phone'.

◆ DeterminePartnerShortName() [1/4]

static String Ict.Petra.Server.MPartner.Common.Calculations.DeterminePartnerShortName ( String  AName)
inlinestatic

overload for DeterminePartnerShortName, no title, firstname and middle name

Parameters
ANamesurname
Returns

◆ DeterminePartnerShortName() [2/4]

static String Ict.Petra.Server.MPartner.Common.Calculations.DeterminePartnerShortName ( String  AName,
String  ATitle 
)
inlinestatic

overload for DeterminePartnerShortName, no middle name and no first name

Parameters
ANamesurname
ATitletitle
Returns

◆ DeterminePartnerShortName() [3/4]

static String Ict.Petra.Server.MPartner.Common.Calculations.DeterminePartnerShortName ( String  AName,
String  ATitle,
String  AFirstName 
)
inlinestatic

overload for DeterminePartnerShortName, no middle name

Parameters
ANamesurname
ATitletitle
AFirstNamefirstname
Returns

◆ DeterminePartnerShortName() [4/4]

static String Ict.Petra.Server.MPartner.Common.Calculations.DeterminePartnerShortName ( String  AName,
String  ATitle,
String  AFirstName,
String  AMiddleName 
)
inlinestatic

format the shortname for a partner in a standardized way

Parameters
ANamesurname of partner
ATitletitle
AFirstNamefirst name
AMiddleNamemiddle name
Returns
formatted shortname

◆ DeterminePartnerSystemCategorySettings()

static void Ict.Petra.Server.MPartner.Common.Calculations.DeterminePartnerSystemCategorySettings ( TDBTransaction  AReadTransaction,
PPartnerAttributeTable  APartnerAttributeDT,
ref TPartnersOverallContactSettings  AOverallContactSettings,
TOverallContSettingKind  AOverallContSettingKind 
)
inlinestatic

Determines the 'System Category' setting(s) for the Partner whose PPartnerAttributes records are contained in APartnerAttributeDT .

Parameters
AReadTransaction
APartnerAttributeDTPPartnerAttributeTable that contains the Contact Detail records of a given Partner. The DataTable must have a special DataColumn added that Method 'DeterminePartnerContactDetailAttributes' adds, hence that Method must be called before calling this Method.
AOverallContactSettingsPass in an instance of TOverallContactSettings.
AOverallContSettingKindSpecify the kind of Overall Contact Setting(s) that you want returned. Combine multiple ones with the binary OR operator ( | ).

◆ DeterminePhoneAttributes()

static DataView Ict.Petra.Server.MPartner.Common.Calculations.DeterminePhoneAttributes ( PPartnerAttributeTypeTable  APPartnerAttributeTypeDT)
inlinestatic

Determines which p_partner_attribute_type records have p_category_code_c 'Phone'

Parameters
APPartnerAttributeTypeDTPass an instance of PPartnerAttributeTypeTable that holds Contact Detail datarows
Returns
DataView that is filtered so that it contains only p_partner_attribute_type records that have p_category_code_c 'Phone'.

◆ DeterminePhonePartnerAttributeTypes()

static string Ict.Petra.Server.MPartner.Common.Calculations.DeterminePhonePartnerAttributeTypes ( PPartnerAttributeTypeTable  APPartnerAttributeTypeDT)
inlinestatic

Determines all p_partner_attribute_type records that have p_category_code_c 'Phone' and returns the result.

Parameters
APPartnerAttributeTypeDTPass an instance of PPartnerAttributeTypeTable that holds datarows that constitute Contact Details
Returns
String that contains all p_partner_attribute_type records that have p_category_code_c 'Phone'.

◆ DeterminePrimaryOrWithinOrgSettings()

static TOverallContactSettings Ict.Petra.Server.MPartner.Common.Calculations.DeterminePrimaryOrWithinOrgSettings ( TDBTransaction  AReadTransaction,
PPartnerAttributeTable  APPartnerAttributeDT,
TOverallContSettingKind  AOverallContSettingKind,
Int64  APartnerKey = -1 
)
inlinestatic

Determines the 'Primary' and/or 'Within Organisation' setting(s) for (each of) the Partner(s) contained in APPartnerAttributeDT .

Parameters
AReadTransaction
APPartnerAttributeDTPPartnerAttributeTable that contains the Contact Detail records of a given Partner - or of MANY (!) Partners. The DataTable must have a special DataColumn added that Method 'DeterminePartnerContactDetailAttributes' adds, hence that Method must be called before calling this Method.
APartnerKeySet this to a Partners' PartnerKey to retrieve the desired 'Primary' and/or 'Within Organisation' setting(s) for a specific Partner only (in case there are many Partners' PPartnerAttribute records contained in APPartnerAttributeDT ). (Default = -1, meaning: determine the 'Primary' and/or 'Within Organisation' setting(s) for each Partner for which PPartnerAttribute records exist in APPartnerAttributeDT .

Caveat 1: If you only need to determine the 'Primary' and/or 'Within Organisation' setting(s) for a single Partner and you have an instance of APPartnerAttributeDT that holds only the records for that Partner then it is more effective to call the Method DeterminePrimaryOrWithinOrgSettingsForPartner than the present Method!

Caveat 2: Don't call this Method multiple times, each time specifying a certain PartnerKey! Instead, don't pass anything for the optional APartnerKey Argument and use the Method TPrimaryContactAttributes.GetPrimaryEmailAddress for the retrieval of the individual Partners' 'Primary' and/or 'Within Organisation' setting(s)!

Parameters
AOverallContSettingKindSpecify the kind of Overall Contact Setting(s) that you want returned. Combine multiple ones with the binary OR operator ( | ).
Returns
An instance of TOverallContactSettings that holds the TPartnersOverallContactSettings for each of the Partner(s) contained in APPartnerAttributeDT . However, it returns null in case APPartnerAttributeDT holds no records, or when it contains only one record but this records' Current flag is false, or this records' PartnerKey isn't the PartnerKey that got passed in with Argument APartnerKey . It also returns null if no record was found that met what was asked for with AOverallContSettingKind !

◆ DeterminePrimaryOrWithinOrgSettingsForPartner()

static TPartnersOverallContactSettings Ict.Petra.Server.MPartner.Common.Calculations.DeterminePrimaryOrWithinOrgSettingsForPartner ( TDBTransaction  AReadTransaction,
PPartnerAttributeTable  APPartnerAttributeDT,
TOverallContSettingKind  AOverallContSettingKind 
)
inlinestatic

Determines the 'Primary' and/or 'Within Organisation' setting(s) for the Partner whose PPartnerAttributes records are contained in APPartnerAttributeDT .

Parameters
AReadTransaction
APPartnerAttributeDTPPartnerAttributeTable that contains the Contact Detail records of a given Partner. The DataTable must have a special DataColumn added that Method 'DeterminePartnerContactDetailAttributes' adds, hence that Method must be called before calling this Method.
AOverallContSettingKindSpecify the kind of Overall Contact Setting(s) that you want returned. Combine multiple ones with the binary OR operator ( | ).
Returns
An instance of TPartnersOverallContactSettings that holds the TPartnersOverallContactSettings for the Partner. However, it returns null in case APPartnerAttributeDT holds no records, or when it contains only one record but this records' Current flag is false. It also returns null if no record was found that met what was asked for with AOverallContSettingKind !

◆ DetermineValueKindOfPartnerAttributeRecord()

static void Ict.Petra.Server.MPartner.Common.Calculations.DetermineValueKindOfPartnerAttributeRecord ( object  AAttributeDR,
PPartnerAttributeTypeTable  APPartnerAttributeType,
out PPartnerAttributeTypeRow  AContactTypeDR,
out TPartnerAttributeTypeValueKind  AValueKind 
)
inlinestatic

Determines the Value Kind (TPartnerAttributeTypeValueKind) of a p_partner_attribute record.

Parameters
AAttributeDRTyped p_partner_attribute record. Must be of one of the following Types: PPartnerAttributeTypeRow, PartnerEditTDSPPartnerAttributeRow or PartnerInfoTDSPPartnerAttributeRow!
APPartnerAttributeTypeTyped p_partner_attribute Table.
AContactTypeDRTyped p_partner_attribute row that matches the Attribute Type of AAttributeDR .
AValueKindValue Kind (TPartnerAttributeTypeValueKind) of the p_partner_attribute record that got passed in with Argument AAttributeDR .

◆ FindBestAddressLocation() [1/2]

static PLocationRow Ict.Petra.Server.MPartner.Common.Calculations.FindBestAddressLocation ( PartnerEditTDSPPartnerLocationTable  APartnerLocationDT,
PLocationTable  ALocationDT 
)
inlinestatic

Returns the PLocationRow of the 'Best Address'.

One of the 'DetermineBestAddress' Methods must have been run before on the PartnerLocation Table that gets passed in in the APartnerLocationDT Argument!!!

Parameters
APartnerLocationDTTyped PartnerLocation Table that was already processed by one of the 'DetermineBestAddress' Methods.
ALocationDTLocation Table that contains all Location records that are referenced in APartnerLocationDT .
Returns
Location Row of the 'Best Address'.

◆ FindBestAddressLocation() [2/2]

static PLocationRow Ict.Petra.Server.MPartner.Common.Calculations.FindBestAddressLocation ( TLocationPK  ABestLocationPK,
PLocationTable  ALocationDT 
)
inlinestatic

Returns the PLocationRow of the 'Best Address'.

The 'DetermineBestAddress' Method overload that returns a TLocationPK must have been run before and that return value must be passed into the present Method with the ABestLocationPK Argument!!!

Parameters
ABestLocationPKPrimary Key of the 'Best Location' (as determined by the 'DetermineBestAddress' Method overload that returns a TLocationPK).
ALocationDTLocation Table that contains the Location record that is referenced with ABestLocationPK .
Returns
Location Row of the 'Best Address'.

◆ FindCountryRowInCachedCountryList()

static DataRow Ict.Petra.Server.MPartner.Common.Calculations.FindCountryRowInCachedCountryList ( string  ACountryCode)
inlinestatic

Looks up a Country by its Country Code in the 'CountryList' Cacheable DataTable.

Parameters
ACountryCodeCountry Code of the Country that is to be looked up.
Returns
DataRow of a Country that was found in the 'CountryList' Cacheable DataTable with the Country Code that got passed in with ACountryCode (or null if it wasn't found.)

◆ FormalGreeting()

static string Ict.Petra.Server.MPartner.Common.Calculations.FormalGreeting ( string  APartnerShortName)
inlinestatic

format a formal greeting for the given partner short name. this formal greeting can be used in a letter

◆ FormatShortName()

static string Ict.Petra.Server.MPartner.Common.Calculations.FormatShortName ( string  AShortname,
eShortNameFormat  AFormat 
)
inlinestatic

convert shortname from Lastname, firstname, title to another shortname format TODO: use partner key to get to the full name, resolve issues with couples that have different family names etc

◆ GetEmailPartnerAttributesConcatStr()

static string Ict.Petra.Server.MPartner.Common.Calculations.GetEmailPartnerAttributesConcatStr ( TDBTransaction  AReadTransaction)
inlinestatic

Determines all p_partner_attribute_type records that are of p_attribute_type_value_kind_c 'CONTACTDETAIL_EMAILADDRESS' and returns the result.

Returns
String that contains all p_partner_attribute_type records are of p_attribute_type_value_kind_c 'CONTACTDETAIL_EMAILADDRESS'.

◆ GetPhonePartnerAttributesConcatStr()

static string Ict.Petra.Server.MPartner.Common.Calculations.GetPhonePartnerAttributesConcatStr ( TDBTransaction  AReadTransaction)
inlinestatic

Determines all p_partner_attribute_type records that have p_category_code_c 'Phone'.

Returns
String that contains all p_partner_attribute_type records that have p_category_code_c 'Phone'.

◆ GetPrimaryEmailAddress() [1/2]

static bool Ict.Petra.Server.MPartner.Common.Calculations.GetPrimaryEmailAddress ( TDBTransaction  AReadTransaction,
PPartnerAttributeTable  APPartnerAttributeDT,
out string  APrimaryEmailAddress 
)
inlinestatic

Gets the 'Primary E-Mail Address' of a Partner.

Parameters
AReadTransaction
APPartnerAttributeDTPPartnerAttributeTable that contains the Contact Detail records of the Partner whose 'Primary Email Address' should be determined.
APrimaryEmailAddressThe 'Primary Email Address' if the Partner has got one, otherwise null.
Returns
True if the Partner has got a 'Primary Email Address', otherwise false.

◆ GetPrimaryEmailAddress() [2/2]

static bool Ict.Petra.Server.MPartner.Common.Calculations.GetPrimaryEmailAddress ( TPartnersOverallContactSettings  APrimaryContactAttributes,
out string  APrimaryEmailAddress 
)
inlinestatic

Gets the 'Primary E-Mail Address' of a Partner.

Parameters
APrimaryContactAttributesTPartnersOverallContactSettings instance that contains the 'Overall Contact Details' of a certain Partner.
APrimaryEmailAddressThe 'Primary E-Mail Address' if the Partner has got one, otherwise null.
Returns
True if the Partner has got a 'Primary E-Mail Address', otherwise false.

◆ GetPrimaryEmailAndPrimaryPhone() [1/2]

static bool Ict.Petra.Server.MPartner.Common.Calculations.GetPrimaryEmailAndPrimaryPhone ( TDBTransaction  AReadTransaction,
PPartnerAttributeTable  APPartnerAttributeDT,
out string  APrimaryPhoneNumber,
out string  APrimaryEmailAddress 
)
inlinestatic

Gets the 'Primary Phone Number' and the 'Primary E-mail Address' of a Partner.

Parameters
AReadTransaction
APPartnerAttributeDTPPartnerAttributeTable that contains the Contact Detail records of the Partner whose 'Primary Phone Number' and 'Primary E-mail Address'should be determined.
APrimaryPhoneNumberThe 'Primary Phone Number' if the Partner has got one, otherwise null.
APrimaryEmailAddressThe 'Primary E-mail Address' if the Partner has got one, otherwise null.
Returns
True if the Partner has got at least one of the 'Primary E-mail Address' and the 'Primary Phone Number' Contact Details, otherwise false.

◆ GetPrimaryEmailAndPrimaryPhone() [2/2]

static bool Ict.Petra.Server.MPartner.Common.Calculations.GetPrimaryEmailAndPrimaryPhone ( TPartnersOverallContactSettings  APrimaryContactAttributes,
out string  APrimaryPhoneNumber,
out string  APrimaryEmailAddress 
)
inlinestatic

Gets the 'Primary Phone Number' and the 'Primary E-mail Address' of a Partner.

Parameters
APrimaryContactAttributesTPartnersOverallContactSettings instance that contains the 'Overall Contact Details' of a certain Partner. records of the Partner whose 'Primary Phone Number' and 'Primary E-mail Address'should be determined.
APrimaryPhoneNumberThe 'Primary Phone Number' if the Partner has got one, otherwise null.
APrimaryEmailAddressThe 'Primary E-mail Address' if the Partner has got one, otherwise null.
Returns
True if the Partner has got at least one of the 'Primary E-mail Address' and the 'Primary Phone Number' Contact Details, otherwise false.

◆ GetPrimaryPhoneNumber() [1/2]

static bool Ict.Petra.Server.MPartner.Common.Calculations.GetPrimaryPhoneNumber ( TDBTransaction  AReadTransaction,
PPartnerAttributeTable  APPartnerAttributeDT,
out string  APrimaryPhoneNumber 
)
inlinestatic

Gets the 'Primary Phone Number' of a Partner.

Parameters
AReadTransaction
APPartnerAttributeDTPPartnerAttributeTable that contains the Contact Detail records of the Partner whose 'Primary Phone Number' should be determined.
APrimaryPhoneNumberThe 'Primary Phone Number' if the Partner has got one, otherwise null.
Returns
True if the Partner has got a 'Primary Phone Number', otherwise false.

◆ GetPrimaryPhoneNumber() [2/2]

static bool Ict.Petra.Server.MPartner.Common.Calculations.GetPrimaryPhoneNumber ( TPartnersOverallContactSettings  APrimaryContactAttributes,
out string  APrimaryPhoneNumber 
)
inlinestatic

Gets the 'Primary Phone Number' of a Partner.

Parameters
APrimaryContactAttributesTPartnersOverallContactSettings instance that contains the 'Overall Contact Details' of a certain Partner.
APrimaryPhoneNumberThe 'Primary Phone Number' if the Partner has got one, otherwise null.
Returns
True if the Partner has got a 'Primary Phone Number', otherwise false.

◆ GetSystemCategorySettingsConcatStr()

static string Ict.Petra.Server.MPartner.Common.Calculations.GetSystemCategorySettingsConcatStr ( TDBTransaction  AReadTransaction)
inlinestatic

Determines all p_partner_attribute_type records which constitute Partner Contact Details and returns the result.

Returns
String that contains all p_partner_attribute_type records which constitute Partner Contact Details.

◆ GetValueKind()

static TPartnerAttributeTypeValueKind Ict.Petra.Server.MPartner.Common.Calculations.GetValueKind ( PPartnerAttributeTypeRow  AContactTypeDR)
inlinestatic

Gets the Value Kind (TPartnerAttributeTypeValueKind) of a p_partner_attribute_type record.

Parameters
AContactTypeDRType p_partner_attribute_type record.
Returns
Value Kind (TPartnerAttributeTypeValueKind) of the p_partner_attribute_type record that got passed in with AContactTypeDR

◆ GetWithinOrganisationEmailAddress() [1/2]

static bool Ict.Petra.Server.MPartner.Common.Calculations.GetWithinOrganisationEmailAddress ( TDBTransaction  AReadTransaction,
PPartnerAttributeTable  APPartnerAttributeDT,
out string  AWithinOrganisationEmailAddress 
)
inlinestatic

Gets the 'Within Organisation E-Mail Address' of a Partner.

Parameters
AReadTransaction
APPartnerAttributeDTPPartnerAttributeTable that contains the Contact Detail records of the Partner whose 'Within Organisation E-Mail Address' should be determined.
AWithinOrganisationEmailAddressThe 'Within Organisation E-Mail Address' if the Partner has got one, otherwise null.
Returns
True if the Partner has got a 'Within Organisation E-Mail Address', otherwise false.

◆ GetWithinOrganisationEmailAddress() [2/2]

static bool Ict.Petra.Server.MPartner.Common.Calculations.GetWithinOrganisationEmailAddress ( TPartnersOverallContactSettings  APrimaryContactAttributes,
out string  AWithinOrganisationEmailAddress 
)
inlinestatic

Gets the 'Within Organisation E-Mail Address' of a Partner.

Parameters
APrimaryContactAttributesTPartnersOverallContactSettings instance that contains the 'Overall Contact Details' of a certain Partner.
AWithinOrganisationEmailAddressThe 'Within Organisation E-Mail Address' if the Partner has got one, otherwise null.
Returns
True if the Partner has got a 'Within Organisation E-Mail Address', otherwise false.

◆ RowHasPhoneAttributeType()

static bool Ict.Petra.Server.MPartner.Common.Calculations.RowHasPhoneAttributeType ( DataView  APhoneAttributesDV,
PPartnerAttributeRow  APartnerAttributeRow 
)
inlinestatic

Checks whether the DataRow passed in with APartnerAttributeRow has got an AttributeType that constitutes a Phone Number (but not a Fax Number).

Parameters
APhoneAttributesDVMust be the return value of a call to Method DeterminePhoneAttributes.
APartnerAttributeRowTyped p_partner_attribute Row.
Returns
Whether the DataRow passed in with APartnerAttributeRow has got an AttributeType that constitutes a Phone Number (but not a Fax Number).

◆ RowHasPhoneOrFaxAttributeType()

static bool Ict.Petra.Server.MPartner.Common.Calculations.RowHasPhoneOrFaxAttributeType ( DataView  APhoneAttributesDV,
PPartnerAttributeRow  APartnerAttributeRow,
bool  AExcludeFax 
)
inlinestatic

Checks whether the DataRow passed in with APartnerAttributeRow has got an AttributeType that constitutes a Phone Number or a Fax Number (but the latter only if AExcludeFax isn't true).

Parameters
APhoneAttributesDVMust be the return value of a call to Method DeterminePhoneAttributes.
APartnerAttributeRowTyped p_partner_attribute Row.
AExcludeFaxSet to true to exclude Fax Numbers in the check, set to false to include them in the check.
Returns
Whether the DataRow passed in with APartnerAttributeRow has got an AttributeType that constitutes a Phone Number or a Fax Number (but the latter only if AExcludeFax isn't true).

◆ SetColumnExpressions()

static void Ict.Petra.Server.MPartner.Common.Calculations.SetColumnExpressions ( PPartnerAttributeTable  APPartnerAttributeDT)
inlinestatic

Sets the Column Expressions for the calculated DataColumns

Member Data Documentation

◆ ATTR_TYPE_PARTNERS_PRIMARY_CONTACT_METHOD

const string Ict.Petra.Server.MPartner.Common.Calculations.ATTR_TYPE_PARTNERS_PRIMARY_CONTACT_METHOD = "PARTNERS_PRIMARY_CONTACT_METHOD"
static

Partner Attribute Type that denotes the 'Primary Contact Method'.

◆ ATTR_TYPE_PARTNERS_SECONDARY_EMAIL_ADDRESS

const string Ict.Petra.Server.MPartner.Common.Calculations.ATTR_TYPE_PARTNERS_SECONDARY_EMAIL_ADDRESS = "PARTNERS_SECONDARY_EMAIL_ADDRESS"
static

Partner Attribute Type that denotes the 'Secondary E-mail Address'.

◆ CALCCOLUMNNAME_CATEGORYINDEX

readonly string Ict.Petra.Server.MPartner.Common.Calculations.CALCCOLUMNNAME_CATEGORYINDEX = "CategoryIndex"
static

Column name for a column that can get added to a PPartnerAttribute Table (gets added by Method CreateCustomDataColumnsForAttributeTable).

◆ CALCCOLUMNNAME_CONTACTTYPE

readonly string Ict.Petra.Server.MPartner.Common.Calculations.CALCCOLUMNNAME_CONTACTTYPE = "ContactType"
static

Column name for a column that can get added to a PPartnerAttribute Table (gets added by Method CreateCustomDataColumnsForAttributeTable).

◆ CALCCOLUMNNAME_INTLPHONEPREFIX

readonly string Ict.Petra.Server.MPartner.Common.Calculations.CALCCOLUMNNAME_INTLPHONEPREFIX = "InternationalPhonePrefix"
static

Column name for a column that can get added to a PPartnerAttribute Table (gets added by Method CreateCustomDataColumnsForAttributeTable).

◆ CALCCOLUMNNAME_PARENTATTRIBUTEINDEX

readonly string Ict.Petra.Server.MPartner.Common.Calculations.CALCCOLUMNNAME_PARENTATTRIBUTEINDEX = "Parent_AttributeIndex"
static

Column name for a column that can get added to a PPartnerAttribute Table (gets added by Method CreateCustomDataColumnsForAttributeTable).

◆ CALCCOLUMNNAME_PARENTPARENTCATEGORYINDEX

readonly string Ict.Petra.Server.MPartner.Common.Calculations.CALCCOLUMNNAME_PARENTPARENTCATEGORYINDEX = "Parent_Parent_CategoryIndex"
static

Column name for a column that can get added to a PPartnerAttribute Table (gets added by Method CreateCustomDataColumnsForAttributeTable).

◆ CALCCOLUMNNAME_PARTNERATTRIBUTETYPE

readonly string Ict.Petra.Server.MPartner.Common.Calculations.CALCCOLUMNNAME_PARTNERATTRIBUTETYPE = "Parent_" + PPartnerAttributeTypeTable.GetAttributeTypeDBName()
static

Column name for a column that can get added to a PPartnerAttribute Table (gets added by Method CreateCustomDataColumnsForAttributeTable).

◆ CALCCOLUMNNAME_VALUE

readonly string Ict.Petra.Server.MPartner.Common.Calculations.CALCCOLUMNNAME_VALUE = "CalculatedValue"
static

Column name for a column that can get added to a PPartnerAttribute Table (gets added by Method CreateCustomDataColumnsForAttributeTable).

◆ PARTNERATTRIBUTE_PARTNERCONTACTDETAIL_COLUMN

readonly String Ict.Petra.Server.MPartner.Common.Calculations.PARTNERATTRIBUTE_PARTNERCONTACTDETAIL_COLUMN = "PartnerContactDetail"
static

Column name for the column 'Partner Contact Detail' that can get added to a PPartnerAttribute Table (gets added by Method DeterminePartnerContactDetailAttributes).

◆ PARTNERLOCATION_BESTADDR_COLUMN

const String Ict.Petra.Server.MPartner.Common.Calculations.PARTNERLOCATION_BESTADDR_COLUMN = "BestAddress"
static

column name for best address

◆ PARTNERLOCATION_ICON_COLUMN

const String Ict.Petra.Server.MPartner.Common.Calculations.PARTNERLOCATION_ICON_COLUMN = "Icon"
static

column name for the location icon


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