Show / Hide Table of Contents

Interface ITimeZoneAgent

Interface for the TimeZone Agent TimeZone maintenance

Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
[Agent("TimeZone Agent", "Interface for the TimeZone Agent. TimeZone maintenance")]
public interface ITimeZoneAgent : IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;

using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
   using (TimeZoneAgent agent = new TimeZoneAgent())
   {
      // call methods on agent here...
   }
}

Methods

CheckNewTimeZoneDataAvailableAsync(CancellationToken)

Check to see if new timezone data is available

Declaration
Task<bool> CheckNewTimeZoneDataAvailableAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<bool>

Returns true if new timezone info is found available, false otherwise

DeleteTimeZonesAsync(CancellationToken)

Deletes all time zone data (locations and rules) from the database

Declaration
Task DeleteTimeZonesAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task

GetBaseTimeZoneIdAsync(CancellationToken)

Get the base timezone id.

Declaration
Task<int> GetBaseTimeZoneIdAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<int>

Returns the base timezone id. Returns 0 if not set.

GetDefaultTimeZoneInformationAsync(CancellationToken)

Get information about the current, preferred timezone for the current user. If no such preference has been set, returns the correct fallback (and UserPreferenceId is 0)

Declaration
Task<PreferredTimeZone> GetDefaultTimeZoneInformationAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<PreferredTimeZone>

Get information about the current, preferred timezone for the current user.

GetDefaultTimeZonePreferenceAsync(CancellationToken)

Returns the id of the default timezone preference with deflevel system wide

Declaration
Task<int> GetDefaultTimeZonePreferenceAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<int>

The id of the system wide default timezone preference

InitializeTimeZoneDataAsync(CancellationToken)

Initalizes the TimeZoneData

Declaration
Task<TimeZoneData[]> InitializeTimeZoneDataAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<TimeZoneData[]>

SetActiveTimeZoneRowAsync(int, bool, CancellationToken)

Set active state of singe row in the TZLocation table

Declaration
Task SetActiveTimeZoneRowAsync(int id, bool active, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int id

Id of row to set active state on

bool active

Set active to true or false

CancellationToken cancellationToken
Returns
Type Description
Task

SetActiveTimeZonesByFilterAsync(string, bool, CancellationToken)

Toggles active state of a single row in the TZLocation table

Declaration
Task SetActiveTimeZonesByFilterAsync(string filter, bool active, CancellationToken cancellationToken = default)
Parameters
Type Name Description
string filter

Filter timezones

bool active

Set active to true or false

CancellationToken cancellationToken
Returns
Type Description
Task

SetBaseTimeZoneIdAsync(int, CancellationToken)

Set the base timezone id.

Declaration
Task<bool> SetBaseTimeZoneIdAsync(int timezoneId, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int timezoneId

The timezone id to save

CancellationToken cancellationToken
Returns
Type Description
Task<bool>

Returns true if setting of base timezone was done

TimeOfLastTimeZoneUpdateAsync(CancellationToken)

Get the time time zone data was last updated

Declaration
Task<DateTime> TimeOfLastTimeZoneUpdateAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<DateTime>

Time of last update

ToggleActiveTimeZoneRowAsync(int, CancellationToken)

Toggles active state of a single row in the TZLocation table

Declaration
Task ToggleActiveTimeZoneRowAsync(int id, CancellationToken cancellationToken = default)
Parameters
Type Name Description
int id

Id of row to toggle active state on

CancellationToken cancellationToken
Returns
Type Description
Task

UpdateTimeZoneDataAsync(CancellationToken)

Retrieve time zone data from the SuperOffice server and update TimeZone data in the database

Declaration
Task<bool> UpdateTimeZoneDataAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken
Returns
Type Description
Task<bool>

Returns true if the operation succeeded

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