Show / Hide Table of Contents

Class TemplateVariables

This class holds template variables that can be used in template variable substitution.

Inheritance
object
TagContainer
TemplateVariables
Inherited Members
TagContainer._bInitiated
TagContainer.AddData(params object[])
TagContainer.GetData()
TagContainer.ClearData()
TagContainer.GetTags()
TagContainer.SetValue(string, string)
TagContainer.RemoveCustomValue(string)
TagContainer.CurrentUiCulture
TagContainer.Data
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 class TemplateVariables : TagContainer
Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

Constructors

TemplateVariables(TemplateVariableIds)

Create a template variable substitution instance, and set entity ID's from parameters. Use the AddData method to add other parameters, such as Entity objects that you may have (and don't want to re-read from the database).

Declaration
public TemplateVariables(TemplateVariableIds templateVariableIds)
Parameters
Type Name Description
TemplateVariableIds templateVariableIds

Object containing the relevant ids for substituting labels.

Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

TemplateVariables(int, int, int, int, int, int, int)

Create a template variable substitution instance, and set entity ID's from parameters. Assume the sending associate is the current user. Use the AddData method to add other parameters, such as Entity objects that you may have (and don't want to re-read from the database).

Declaration
public TemplateVariables(int contactId, int personId, int appointmentId, int documentId, int saleId, int selectionId, int projectId)
Parameters
Type Name Description
int contactId

Primary id of the current contact.

int personId

Primary id of the current person.

int appointmentId

Primary id of the current appointment.

int documentId

Primary id of the current document.

int saleId

Primary id of the current sale.

int selectionId

Primary id of the current selection.

int projectId

Primary id of the current project

Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

TemplateVariables(int, int, int, int, int, int, int, int)

Create a template variable substitution instance, and set entity ID's from parameters. Use the AddData method to add other parameters, such as Entity objects that you may have (and don't want to re-read from the database).

Declaration
public TemplateVariables(int associateId, int contactId, int personId, int appointmentId, int documentId, int saleId, int selectionId, int projectId)
Parameters
Type Name Description
int associateId

AssociateId for sender.

int contactId

Primary id of the current contact.

int personId

Primary id of the current person.

int appointmentId

Primary id of the current appointment.

int documentId

Primary id of the current document.

int saleId

Primary id of the current sale.

int selectionId

Primary id of the current selection.

int projectId

Primary id of the current project

Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

Fields

_currentContact

This class holds template variables that can be used in template variable substitution.

Declaration
protected ContactTags _currentContact
Field Value
Type Description
ContactTags
Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

_currentPerson

This class holds template variables that can be used in template variable substitution.

Declaration
protected CurrentPersonVariables _currentPerson
Field Value
Type Description
CurrentPersonVariables
Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

Properties

AssociateId

This class holds template variables that can be used in template variable substitution.

Declaration
public int AssociateId { get; }
Property Value
Type Description
int
Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

ContactId

This class holds template variables that can be used in template variable substitution.

Declaration
public int ContactId { get; }
Property Value
Type Description
int
Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

CurrentContact

This class holds template variables that can be used in template variable substitution.

Declaration
public ContactTags CurrentContact { get; set; }
Property Value
Type Description
ContactTags
Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

CurrentPerson

This class holds template variables that can be used in template variable substitution.

Declaration
public CurrentPersonVariables CurrentPerson { get; set; }
Property Value
Type Description
CurrentPersonVariables
Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

DoGetPersonTags

This class holds template variables that can be used in template variable substitution.

Declaration
protected virtual bool DoGetPersonTags { get; }
Property Value
Type Description
bool
Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

PersonId

This class holds template variables that can be used in template variable substitution.

Declaration
public int PersonId { get; }
Property Value
Type Description
int
Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

QuoteAlternativeId

This class holds template variables that can be used in template variable substitution.

Declaration
public int QuoteAlternativeId { get; }
Property Value
Type Description
int
Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

QuoteId

This class holds template variables that can be used in template variable substitution.

Declaration
public int QuoteId { get; }
Property Value
Type Description
int
Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

QuoteVersionId

This class holds template variables that can be used in template variable substitution.

Declaration
public int QuoteVersionId { get; }
Property Value
Type Description
int
Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

TicketId

This class holds template variables that can be used in template variable substitution.

Declaration
public int TicketId { get; }
Property Value
Type Description
int
Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

Methods

GetIdAsync(CancellationToken)

Primary key of the

Declaration
public override Task<int> GetIdAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<int>
Overrides
TagContainer.GetIdAsync(CancellationToken)
Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

GetValueAsync(string, bool, CancellationToken)

Get a value for a tag, and optionally skip fadX templates

Declaration
public Task<string> GetValueAsync(string tag, bool ignoreFad, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string tag

Name of the tag.

bool ignoreFad
CancellationToken cancellationToken
Returns
Type Description
Task<string>

Value of the tag. An empty string is returned if there is no valid value.

Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

GetValueAsync(string, CancellationToken)

Get a value for a tag.

Declaration
public override Task<string> GetValueAsync(string tag, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string tag

Name of the tag.

CancellationToken cancellationToken
Returns
Type Description
Task<string>

Value of the tag. An empty string is returned if there is no valid value.

Overrides
TagContainer.GetValueAsync(string, CancellationToken)
Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

InitAsync(CancellationToken)

Create the type-specific tag containers, and give them what we know

Declaration
protected override Task InitAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task
Overrides
TagContainer.InitAsync(CancellationToken)
Remarks

base.Data is an object array that might contain things like Entity objects; if so then these will be discovered and used by the Info providers once the template variable objects need them.

An object such as DocumentTags will add the document id to whatever else is already in the array, and then that gets passed to the factory method for DocumentInfo. The method will iterate through the array, and if it sees a Entities.Document instance that matches the document id, then it will use that one as the basis for the DocumentInfo; otherwise the factory will create a new Entities.Document instance that reads data from the database.

It's a flexible system, but somewhat hard to trace if you have forgotten the original design.

IsTagInContextAsync(string, CancellationToken)

Is this a valid tag in the given context. If there are no current sale, there are no valid tags for sale.

Declaration
public override Task<bool> IsTagInContextAsync(string tag, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string tag

Name of the tag.

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

True if the tag is valid in hte given context.

Overrides
TagContainer.IsTagInContextAsync(string, CancellationToken)
Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

IsTagLegalAsync(string, CancellationToken)

Is this a legal tag?

Declaration
public override Task<bool> IsTagLegalAsync(string tag, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string tag

Name of the tag.

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

True is returned if this is a legal tag.

Overrides
TagContainer.IsTagLegalAsync(string, CancellationToken)
Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

SetCurrentContact()

This class holds template variables that can be used in template variable substitution.

Declaration
protected virtual void SetCurrentContact()
Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

SetCurrentPerson()

This class holds template variables that can be used in template variable substitution.

Declaration
protected virtual void SetCurrentPerson()
Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

SetInviteePersonIdAsync(int, CancellationToken)

This class holds template variables that can be used in template variable substitution.

Declaration
public Task SetInviteePersonIdAsync(int personId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int personId
CancellationToken cancellationToken
Returns
Type Description
Task
Remarks

This class can be instantiated with current values in the form if id’s. Only values required are fetched from the database. Data objects holding information about values can be provided in order to reduce fetching data from the database.

Extension Methods

EnumUtil.MapEnums<From, To>(From)
Converters.MapEnums<From, To>(From)
© SuperOffice. All rights reserved.
SuperOffice |  Community |  Release Notes |  Privacy |  Site feedback |  Search Docs |  About Docs |  Contribute |  Back to top