One moment please...
 
 
Exact Synergy Enterprise   
 

Exact Synergy Enterprise Class Reference: Environment

On this page

1.Description
2.Members
 

 

Class name:   Environment
Namespace:   Exact.Core
Assembly:   Exact.Core.dll

Description
Provides all services required by Exact Synergy Enterprise applications: Initialization of database connection, rights checks, license checks, settings, etc.

  • Web applications never create their own environment object, but receive this object of the protected member "env" of the base-page class (Exact.Web.UI.Page.Base).
  • Background processes receive their environment object as the env Property of the Exact.System.ProcessBase class
  • Stand-alone applications create their own Environment object, with "env = New Environment".

Members

Name Type Description
AccountStatus Read-only property: String The customer status of the current user, if it is a customer or partner
AccountType Read-only property: String The account type of the current user, if it is a customer or partner
AvailableStyleSheets Read-only property: IDictionary Object An collection of style sheets that are available.
AppRoot Read-only property: String The root of the Web application, e.g. http://eportal.exact.nl/001
BatchNumberDatabase Read-only property: Integer The batch number of the database
BatchNumberSoftware Read-only property: Integer The batch number of the software
Blocked Read-only property: Boolean True if the current user is blocked. No application needs to check on this, because a blocked user is always immediately redirected to the "Access denied" page.
Cache Read-only property: Cache Object Can be used by components to share data among all users of the Web application. Is a wrapper around the Web-cache object, but can also be used outside of Web applications.
CacheDivisionSettings(Division As String, Prefix As String)s Sub Retrieves all division based settings with a specified prefix in a single query, and caches them for later user.
CacheSettings(SettingType As SettingType, Prefix As String)s Sub Retrieves all settings with a specified prefix in a single query, and caches them for later user.
CheckFunction Function: Boolean
Returns true if the current user is in one of the roles linked to the specified function id, in the division.
CheckFunctionEx Function: Boolean Returns true if the current user is in one of the roles linked to the specified function id, in the division and cost center.
CheckFunctionLevel Function: Boolean Returns true if the current user is in one of the roles linked to the specified function id, with security level, in the division.
Classification Read-only property: String The account classification of the current user (in the customer or partner portal)
ClearRights Sub Uncaches all rights for the current user. Can be called if something has changed in the rights for the current user.
Connection Read-only property: EDLConnection Returns a correctly initialized EDLConnection object
CostCenter Read-only property: String The cost center of the current user
CostCenterGroup Read-only property: String The cost center group of the current user's cost center
CurrencyCalculator Read-only property: CurrencyCalculator Object Returns an initialized CurrencyCalculator object
CurrentLicenseUsers Read-only property: Integer The number of users defined in the system that counts against the license.
CustomerID Read-only property: String (GUID) The account GUID of the current user, if the current user is a customer or partner.
CustomerName Read-only property: String The account name of the current user, if the current user is a customer or partner.
Data(ByVal key As String) Default read-write
property: Object
Can be used by components to share data across instances in the same session, similar to the Session object for web pages, but it also works outside of web applications.

Example:

Dim env As Environment
                        Dim data As Object = env("MyComponent.MyData")
                        If IsNothing(data) Then
                        data = conn.Query(sql)
                        env("MyComponent.MyData") = data
                        End If
DateFormat Read-only property: String The date format of the current user
DateFormats Read-only property: String() String versions of the date formats supported by Exact Synergy Enterprise ("dd-mm-yyyy", "mm/dd/yyyy", etc.)
DefaultDateFormat Read-only property: String The default date format of the Exact Synergy Enterprise software system
DefaultStyleSheet Read-only property: String Returns the style sheet that is marked as default in the XML. Otherwise it will return "Symplefied.css"
Division Read-only property: String The division code of the current user
DivisionCountry Read-only property: String The code of the country of the current user's division
DivisionGroup Read-only property: String The code of the group of the current user's division
DivisionName Read-only property: String The division name of the current user
DivisionSetting(Division As String, SettingName As String, Optional Byval DeafultValue As Object) Read-only property: Object Reads or writes a division-specific setting
DomainName Read-only property: String  The name to the web bomain where the application is running on.
FormatCurrency(ByVal value As Object, ByVal Currency As String, Optional ByVal IncludeSymbol As Boolean = False, Optional ByVal CalcType As CalcType=CalcType.Amount) Function: String Formats a currency amount with the correct precision for the currency. If the IncludeSymbol argument is True, the currency symbol (such as $) is included in the result.
FormatDateTime(Expression As Object, Optional ByVal Format As DateTimeFormat = DateTimeFormat.DateTime) Function: String
Returns a date and/or time formatted according to the user's date/time settings:
  • DateTimeFormat.DateTime = Date + time
  • DateTimeFormat.ShortDate = Date only
  • DateTimeFormat.ShortTime = Time only
  • DateTimeFormat.DateTimeSeconds = Date + time + seconds
  • DateTimeFormat.DateTimeMilliseconds = Date + time + seconds + milliseconds
FormatInteger(ByVal value As Object) Function: String Formats the supplied numeric value as an integer, with the thousand separator specified for the current user
FormatNumber(Byval value As Object, Optional NumDigits As Integer = 2, Optional IncludeLeadingDigit As Boolean = True, Optional UseParensForNegativeNumbers = False, Optional GroupDigits As Boolean = False) Function: String Returns a number formatted according to the current user's number settings.
FormatNumberSignificant(ByVal value As Object, ByVal Digits As Integer) Function: String
Formats a number to a specified number of significant digits

FormatNumber(0.001234, 3) -> "0,001"
FormatNumberSignificant(0.01234, 3) -> "0,0123"

FormatQuantity(ByVal value As Object) Function: String Formats a number that represent an item quantity.
FormatRate(ByVal Value As Object) Function: String Formats an exchange rate
FormatTime(ByVal Time As TimeSpan, Optional ByVal tf As TimeFormat = TimeFormat.NoSeconds) Function: String
Formats a TimeSpan value according to the current user's time settings, with the following time options:
  • TimeFormat.NoSeconds
  • TimeFormat.Seconds
  • TimeFormat.Milliseconds
FullName Read-only property: String The full name of the current user
GetDateFormat Read-only property: DateFormat enum Returns the date format of the current user
GetDateFormatter Function: String Returns a client-side script function named "BacoFormatDate(expr)" to format dates on the client-side,according to the user's date settings.
GetNumberFormatInfo   Returns the .NET framework NumberFormatInfo class used to format the current user's numbers
GetNumberFormatter Function: String Returns a client-side script function "BacoFormatNumber(expr)" that format's a number on the client side, according to the user's number settings on the server.
GetNumberParser Function: String Returns a client-side script function "BacoParseNumber(expr)" that parses a number on the client side, according to the user's number settings on the server.
Integrated Read-only property: Boolean True if the environment is an integrated scenario with globe.
IsAdmin Read-only property: Boolean True if the current user is in the administrator role on the corporate level.
IsFulltextEntry(Word As String) Function: Boolean True if the word exists in the NoiseWords table
IsMainContact Read-only property: Boolean True if the current user is a customer or partner, and is the main contact person of the account.
IsManager(ResourceID As String) Function: Boolean Returns true if the current user is the direct or indirect manager of the supplied resource.
IsReseller Read-only property: Boolean Returns True if the current user in the partner portal is a reseller
IsSupplier Read-only property: Boolean Returns True if the current user in the partner portal is a supplier
IsUserInRole(Role As Object, Optional Company As String, Opional CostCenter As String, Optional ByVal Level As Ineger = 4) Function: Boolean Checks if the current user is in the specified role, for the specified division and/or cost center.
IsWeekend(ByVal d As Date) Function: Boolean Returns True if the specified date is a weekend-day according the the user's preferences.
JobGroup Read-only property: String The job group code of the current user
JobActivity Read-only property: String The job activity code of the current user
License   Returns a License object that can be used for all option, user-count, division-count, and module checks.
LocalRoot Read-only property: Boolean The root on the local machine of the current Web application, e.g. "d:\synergy"
LogError(ByVal Context As HttpContext, ByVal LogText As String) Sub Logs an error from an ASPX page. Normally error-logging is done automatically, but this can be called if you catch and handle your own errors on the page, and still want to log the error.
LogProcess(ByVal LogType As ProcessLogType, Optional ByVal LogText As String = "") Sub Used by background processes to log errors, warnings, and additional information.
New(Contect As HttpContect)
New(Optional ProcessName As String = "", Optional CommandLine As String = "", Optional Options As ProcessOptions = 0)
Constructor
Used to initialize an environment from a web page, or from a background process.
  • Web pages should never create an Environment object themselves, this is automatically handled by the base page class.
  • Most background processes can simply do "env = New Environment", without any parameters, to create their Environment object
NumberFormats Read-only property: String() Returns the number formats supported by Exact Synergy Enterprise
ParseDateTime(expr As Object) Function: Object Parses a date/and or time string according to the current-user's date format, and returns a "real" date.
ParseDateTime(expr As Object, fmt As DateFormat) Function: Object
Parses a date/and or time string, and returns a result that includes the date/time parts specified in the passed DateFormat. Example:

ParseDateTime('19-5-2003 11:23:34', DateTimeFormat.ShortDate)

returns the date "19-5-2003" (as a Date object), without the time.

ParseNumber(expr As String) Function: Object Parses a number string according the current user's number format
PortalType Read-only property: PortalType enum
Indicates in what kind of portal the current user currently is:
  • PortalType.Public
  • PortalType.Customer
  • PortalType.Reseller
  • PortalType.Supplier
  • PortalType.Employee
RealResourceID Read-only property: Integer If delegation is active, the resource ID of the real user. Otherwise a zero
ResourceID Read-only property: Integer The ID (GUID) of the current user
ResourceStatus Read-only property: ActiveState A value from the ActiveState enum, indicating the active state of the current user
  • ActiveState.Active
  • ActiveState.Future
  • ActiveState.Inactive
  • ActiveState.Past
ResourceType Read-only property: String The resource type of the current user (a single character)
Round(ByVal Value As Double, ByVal Precision As Double, Optional ByVal rm As RoundingMethod = RoundingMethod.None) Function: Double
Rounds a number to the specified precision, according to the specified rounding method:
  • RoundingMethod.None (uses the rounding method specified for this database, with a default of RoundingMethod.bankers)
  • RoundingMethod.Bankers. Rounds to the nearest number, with 5 values rounded up or down, depending on the preceding digit.
  • RoundingMethod.Arithmetic. Rounds to the nearest number, with 5 values rounded up.
  • RoundingMethod.Up. Always rounds up.
  • RoundingMethod.Down. Always rounds down.

A non-integer precision can be supplied to round to non-multiples of 10. For example, to round to 0.05 (5 "cent"), a precision of 1.301 (-Math.Log10(0.05)) can be supplied.

Round(ByVal amount As Double, Optional ByVal Currency As String = "", Optional ByVal CalcType As CalcType = CalcType.Amount, Optional ByVal RoundingMethod As RoundingMethod = RoundingMethod.None) Function: Double Rounds a number according to the precision of the specified currency (or the default currency, if no currency is supplied)
Sector Read-only property: String The account sector of the current user's account in the customer or partner portal
SecurityLevel Read-only property: Integer The security level of the current user
Setting(SettingType As SettingType, SettingName As String, Optional DefaultValue As Object = Nothing) Read-only property: Object
Reads or writes a general or user settings. The SettingType argument must be one of the following values:
  • SettingType.General
  • SettingType.User
  • SettingType.Exact (backoffice settings)
For division-specific settings, the property DivisionSetting should be used.
Term Read-only property: Term object Returns a term object, initialized according the the current-user's language
Unicode Read-only property: Boolean Returns true if the current database is a Unicode Exact Synergy Enterprise database
UserName Read-only property: String The login name of the current user, as he/she has type in the login box.
UserIdentification Read-only property: UID enum
Indicates how the current user is identified with his login name:
  • UID.Anonymous (not logged in, on public web site)
  • UID.Customer (logged with customer code)
  • UID.Resource (logged in with personal user name)
UserType Read-only property: UserType
One of the values of the UserType enum: Resource, Partner, Customer, or Anonymous.

This property should be used, instead on checks on specific security levels to determine the type of the current user.

ValidateDomain(Value As Object, Domain As String) Function: Object Validates a value according to a domain defined in the Repository, and returns the validated value, which may be modified (e.g. right-aligned, etc.)
WebGuestID Read-only property: String Returns the Resource ID of the "ExactWebGuest" user
WeekNumber(ByVal d As Date) Function: Integer Returns the week number of the specified date, according the the user's preferences for week numbers.

     
 Main Category: Support Product Know How  Document Type: Online help main
 Category: SDK  Security  level: All - 0
 Sub category: General  Document ID: 09.453.719
 Assortment:  Date: 19-05-2018
 Release:  Attachment:
 Disclaimer