Table of Contents

Class UserAddress

Namespace
Dynamicweb.Security.UserManagement
Assembly
Dynamicweb.Security.dll
Represents a user address
public class UserAddress : DbObject
Inheritance
UserAddress
Inherited Members

Constructors

UserAddress()

Creates a new instance of a class.
public UserAddress()

Properties

Address

Gets or sets address.
[AddInName("Address")]
[AddInIsEditable(true)]
public string Address { get; set; }

Property Value

string
Address

Address2

Gets or sets Address2.
[AddInName("Address2")]
[AddInIsEditable(true)]
public string Address2 { get; set; }

Property Value

string
Address2

AddressType

Gets or sets Address Type
public bool AddressType { get; set; }

Property Value

bool
Address Type

AddressValidatorResults

Gets the address validator results.
public IEnumerable<AddressValidatorResult> AddressValidatorResults { get; set; }

Property Value

IEnumerable<AddressValidatorResult>

CallName

Gets or sets user address Call Name.
[AddInName("CallName")]
[AddInIsEditable(true)]
public string CallName { get; set; }

Property Value

string
User address Call Name.

Remarks

Address name like: Home, Business, etc.

Cell

Gets or sets User Address Cell.
[AddInName("Cell")]
[AddInIsEditable(true)]
public string Cell { get; set; }

Property Value

string
User Address Cell.

City

Gets or sets User Address City.
[AddInName("City")]
[AddInIsEditable(true)]
public string City { get; set; }

Property Value

string
User Address City.

Company

Gets or sets user address Company name.
[AddInName("Company")]
[AddInIsEditable(true)]
public string Company { get; set; }

Property Value

string
User address Company Name.

Country

Gets or sets User Address Country.
[AddInName("Country")]
[AddInIsEditable(true)]
public string Country { get; set; }

Property Value

string
User Address Country.

CountryCode

Gets or sets address country code
[AddInName("CountryCode")]
[AddInIsEditable(true)]
public string CountryCode { get; set; }

Property Value

string

CustomerNumber

Gets or sets User Address Customer Number.
[AddInName("CustomerNumber")]
[AddInIsEditable(true)]
public string CustomerNumber { get; set; }

Property Value

string
User Address Customer Number.

CustomFieldValues

Gets or sets User Address Is Default.
public CustomFieldValueCollection CustomFieldValues { get; set; }

Property Value

CustomFieldValueCollection
User Address Is Default.

Remarks

Represents if the User Address is default.

Email

Gets or sets User Address Email.
[AddInName("Email")]
[AddInIsEditable(true)]
public string Email { get; set; }

Property Value

string
User Address Email.

Fax

Gets or sets User Address Fax.
[AddInName("Fax")]
[AddInIsEditable(true)]
public string Fax { get; set; }

Property Value

string
User Address Fax.

ID

Gets or sets user address ID.
[AddInName("ID")]
public int ID { get; set; }

Property Value

int
User address ID.

IsDefault

Gets or sets User Address Is Default.
[AddInName("IsDefault")]
[AddInIsEditable(true)]
public bool IsDefault { get; set; }

Property Value

bool
User Address Is Default.

Remarks

Represents if the User Address is default.

Name

Gets or sets user address name.
[AddInName("Name")]
[AddInIsEditable(true)]
public string Name { get; set; }

Property Value

string
User address name.

Remarks

Address name like: Home, Business, etc.

Phone

Gets or sets User Address Phone.
[AddInName("Phone")]
[AddInIsEditable(true)]
public string Phone { get; set; }

Property Value

string
User Address Phone.

PhoneBusiness

Gets or sets User Address Phone (business).
[AddInName("PhoneBusiness")]
[AddInIsEditable(true)]
public string PhoneBusiness { get; set; }

Property Value

string
User Address Phone (business).

Region

Gets address region info
public RegionInfo Region { get; }

Property Value

RegionInfo

State

Gets or sets User Address State.
[AddInName("State")]
[AddInIsEditable(true)]
public string State { get; set; }

Property Value

string
User Address State.

UID

Gets or sets User Address UID.
[AddInName("UID")]
[AddInIsEditable(true)]
[Obsolete("Use UniqueIdentifier instead")]
public string UID { get; set; }

Property Value

string
User Address UID.

UniqueIdentifier

Gets or sets User Address UID.
[AddInName("UniqueIdentifier")]
[AddInIsEditable(true)]
public string UniqueIdentifier { get; set; }

Property Value

string
User Address UID.

UserID

Gets or sets user ID
public int UserID { get; set; }

Property Value

int
User ID

Zip

Gets or sets User Address Zip.
[AddInName("Zip")]
[AddInIsEditable(true)]
public string Zip { get; set; }

Property Value

string
User Address Zip.

Methods

Delete()

public void Delete()

Delete(int)

Deletes the user address from database
public static void Delete(int addressId)

Parameters

addressId int
Address id for deletion

DeleteUserAddresses(int)

Deletes all user addresses from db
public static void DeleteUserAddresses(int userId)

Parameters

userId int
The user id

Fill(IDataReader)

Fills object properties according to provided IDataReader.
public override void Fill(IDataReader reader)

Parameters

reader IDataReader
Data holder.

FillRow(DataRow)

Override the FillRow method to map all the properties values to their respective field on the datarow. Used when the object is being saved.
protected override void FillRow(DataRow row)

Parameters

row DataRow
The datarow to fill with data.

GetUserAddressById(int)

Retrieves the user address according to user address iD.
public static UserAddress GetUserAddressById(int id)

Parameters

id int
User address id

Returns

UserAddress
User address if found, otherwise returns Nothing.

GetUserAddresses()

Retrieves all user addresses
public static IEnumerable<UserAddress> GetUserAddresses()

Returns

IEnumerable<UserAddress>
IEnumerable<T>

GetUserAddresses(int)

Retrieves the user addresses collection according to user id
public static IEnumerable<UserAddress> GetUserAddresses(int userId)

Parameters

userId int
User id

Returns

IEnumerable<UserAddress>
User addresses collection

GetUserAddressesBySql(string)

Retrieves a collection of user addresses according to provided SQL statement.
[Obsolete]
public static IEnumerable<UserAddress> GetUserAddressesBySql(string sqlCommandText)

Parameters

sqlCommandText string
SQL statement to be used to retrieve user addresses.

Returns

IEnumerable<UserAddress>
Retrieved user addresses.

GetUserDefaultAddress(int)

Retrieves default user address from AccessUserAddress table. If no default address is set returns user address from AccessUserTable
public static UserAddress GetUserDefaultAddress(int userID)

Parameters

userID int
User id to be used for searching default address

Returns

UserAddress
UserAddress

GetUserDefaultUserAddressesCustomFields(int)

Retrieves a collection of user default addresses custom fields.
public static CustomFieldValueCollection GetUserDefaultUserAddressesCustomFields(int userId)

Parameters

userId int
User id

Returns

CustomFieldValueCollection

HasUserDefaultAddress(int)

Returns true if the user has a default address
public static bool HasUserDefaultAddress(int userID)

Parameters

userID int
User id to be used for search default address

Returns

bool
True or false

RemoveDefaultAddress(int)

Deletes the user default address from database
public static void RemoveDefaultAddress(int userID)

Parameters

userID int
User id to be used for searching default address

Save()

Saves current user address
public override void Save()
To top