Show / Hide Table of Contents

Class PersonNameFormatter

Collection of helper functions to format names.

Inheritance
Object
PersonNameFormatter
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Namespace: SuperOffice.CRM.Globalization
Assembly: SoDataBase.dll
Syntax
public static class PersonNameFormatter

Methods

GetAssociateNameFormatStylePreference()

Get the name formatting preference for associates; fallback to persons' preference, ultimately to First/Last name

Declaration
public static PersonNameFormatter.NameFormatStylePreference GetAssociateNameFormatStylePreference()
Returns
Type Description
PersonNameFormatter.NameFormatStylePreference

GetAssociateOrderBy(PersonTableInfo)

Declaration
public static FieldInfo[] GetAssociateOrderBy(this PersonTableInfo personInfo)
Parameters
Type Name Description
PersonTableInfo personInfo
Returns
Type Description
FieldInfo[]

GetFormalName(Person)

Get formal name for a person, as used in labels.

Declaration
public static string GetFormalName(this Person person)
Parameters
Type Name Description
Person person

Person to get formal name for.

Returns
Type Description
String

Formal name for a person, as used in labels.

GetFormalName(PersonRow)

Get formal name for a person, as used in labels.

Declaration
public static string GetFormalName(this PersonRow person)
Parameters
Type Name Description
PersonRow person

Person to get formal name for.

Returns
Type Description
String

Formal name for a person, as used in labels.

GetFormalName(String, String, String, Int32, String, String)

Get formal name for a person, as used in labels.

Declaration
public static string GetFormalName(string firstName, string middleName, string lastName, int countryId, string title, string mrMrs)
Parameters
Type Name Description
String firstName

First name of the person.

String middleName

Middle name of the person.

String lastName

Last name of a person.

Int32 countryId

CountryId for the person, the persons origin.

String title

Title of the person.

String mrMrs

Mr/Mrs/Miss/Ms, etc. for the person.

Returns
Type Description
String

Formal name for a person, as used in labels.

GetFullName(Person)

Get the persons full name (internal name used in clients for employees).

Declaration
public static string GetFullName(this Person person)
Parameters
Type Name Description
Person person

Person to get full name for.

Returns
Type Description
String

Persons full name.

GetFullName(Person, PersonNameFormatter.NameFormatStylePreference)

Get the persons full name (internal name used in clients for employees).

Declaration
public static string GetFullName(this Person person, PersonNameFormatter.NameFormatStylePreference style)
Parameters
Type Name Description
Person person

Person to get full name for.

PersonNameFormatter.NameFormatStylePreference style
Returns
Type Description
String

Persons full name.

GetFullName(PersonRow)

Get the persons full name (internal name used in clients for employees).

Declaration
public static string GetFullName(this PersonRow person)
Parameters
Type Name Description
PersonRow person

Person to get full name for.

Returns
Type Description
String

Persons full name.

GetFullName(PersonRow, PersonNameFormatter.NameFormatStylePreference)

Get the persons full name (internal name used in clients for employees).

Declaration
public static string GetFullName(this PersonRow person, PersonNameFormatter.NameFormatStylePreference style)
Parameters
Type Name Description
PersonRow person

Person to get full name for.

PersonNameFormatter.NameFormatStylePreference style
Returns
Type Description
String

Persons full name.

GetFullName(String, String, String)

Get the persons full name (internal name used in clients for employees).

Declaration
public static string GetFullName(string firstName, string middleName, string lastName)
Parameters
Type Name Description
String firstName

Persons first name.

String middleName

Persons middle name.

String lastName

Persons last name.

Returns
Type Description
String

Persons full name.

GetFullName(String, String, String, PersonNameFormatter.NameFormatStylePreference)

Get the persons full name (internal name used in clients for employees).

Declaration
public static string GetFullName(string firstName, string middleName, string lastName, PersonNameFormatter.NameFormatStylePreference style)
Parameters
Type Name Description
String firstName

Persons first name.

String middleName

Persons middle name.

String lastName

Persons last name.

PersonNameFormatter.NameFormatStylePreference style
Returns
Type Description
String

Persons full name.

GetNameFormatStylePreference()

Get the name formatting preference for persons

Declaration
public static PersonNameFormatter.NameFormatStylePreference GetNameFormatStylePreference()
Returns
Type Description
PersonNameFormatter.NameFormatStylePreference

GetOrderBy(PersonTableInfo, PersonNameFormatter.NameFormatStylePreference)

Declaration
public static FieldInfo[] GetOrderBy(PersonTableInfo personInfo, PersonNameFormatter.NameFormatStylePreference format)
Parameters
Type Name Description
PersonTableInfo personInfo
PersonNameFormatter.NameFormatStylePreference format
Returns
Type Description
FieldInfo[]

GetPersonOrderBy(PersonTableInfo)

Declaration
public static FieldInfo[] GetPersonOrderBy(this PersonTableInfo personInfo)
Parameters
Type Name Description
PersonTableInfo personInfo
Returns
Type Description
FieldInfo[]

TryGetNameParts(String, out String, out String, out String)

Tries to extract the name into parts based on database preferences.

Declaration
public static bool TryGetNameParts(string fullName, out string firstName, out string middleName, out string lastName)
Parameters
Type Name Description
String fullName

The full name of the person, without salutation.

String firstName

Firstname only if database is configured to use middlenames. Otherwise, all components not lastname.

String middleName

MiddleName is database is configured to use it. Otherwise null.

String lastName

LastName only.

Returns
Type Description
Boolean

true if parsing succeeded.

© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top