Class TemplateVariables
This class holds template variables that can be used in template variable substitution.
Inherited Members
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.
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.
Id
Primary key of the
Declaration
public override int Id { get; }
Property Value
Type | Description |
---|---|
int |
Overrides
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
GetValue(string)
Get a value for a tag.
Declaration
public override string GetValue(string tag)
Parameters
Type | Name | Description |
---|---|---|
string | tag | Name of the tag. |
Returns
Type | Description |
---|---|
string | Value of the tag. An empty string is returned if there is no valid value. |
Overrides
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.
GetValue(string, bool)
Get a value for a tag, and optionally skip fadX templates
Declaration
public string GetValue(string tag, bool ignoreFad)
Parameters
Type | Name | Description |
---|---|---|
string | tag | Name of the tag. |
bool | ignoreFad |
Returns
Type | Description |
---|---|
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.
Init()
Create the type-specific tag containers, and give them what we know
Declaration
protected override void Init()
Overrides
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.IsTagInContext(string)
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 bool IsTagInContext(string tag)
Parameters
Type | Name | Description |
---|---|---|
string | tag | Name of the tag. |
Returns
Type | Description |
---|---|
bool | True if the tag is valid in hte given context. |
Overrides
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.
IsTagLegal(string)
Is this a legal tag?
Declaration
public override bool IsTagLegal(string tag)
Parameters
Type | Name | Description |
---|---|---|
string | tag | Name of the tag. |
Returns
Type | Description |
---|---|
bool | True is returned if this is a legal tag. |
Overrides
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.
SetContactPersonId(int, int)
Set new identities for contact and person
Declaration
public void SetContactPersonId(int contactId, int personId)
Parameters
Type | Name | Description |
---|---|---|
int | contactId | Identity of new contact |
int | personId | Identity of new person |
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.
SetInviteePersonId(int)
This class holds template variables that can be used in template variable substitution.
Declaration
public void SetInviteePersonId(int personId)
Parameters
Type | Name | Description |
---|---|---|
int | personId |
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.