Class TimeZoneAgent
Facade for the TimeZone Agent TimeZone maintenance
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
public class TimeZoneAgent : AgentBase<ITimeZoneAgent>, IDisposable, 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...
}
}
Constructors
TimeZoneAgent()
Facade for the TimeZone Agent TimeZone maintenance
Declaration
public TimeZoneAgent()
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
CheckNewTimeZoneDataAvailable()
Check to see if new timezone data is available
Declaration
public bool CheckNewTimeZoneDataAvailable()
Returns
Type | Description |
---|---|
Boolean | Returns true if new timezone info is found available, false otherwise |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TimeZoneAgent agent = new TimeZoneAgent())
{
// call methods on agent here...
}
}
DeleteTimeZones()
Deletes all time zone data (locations and rules) from the database
Declaration
public void DeleteTimeZones()
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TimeZoneAgent agent = new TimeZoneAgent())
{
// call methods on agent here...
}
}
GetBaseTimeZoneId()
Get the base timezone id.
Declaration
public int GetBaseTimeZoneId()
Returns
Type | Description |
---|---|
Int32 | Returns the base timezone id. Returns 0 if not set. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TimeZoneAgent agent = new TimeZoneAgent())
{
// call methods on agent here...
}
}
GetDefaultTimeZoneInformation()
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
public PreferredTimeZone GetDefaultTimeZoneInformation()
Returns
Type | Description |
---|---|
PreferredTimeZone | Get information about the current, preferred timezone for the current user. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TimeZoneAgent agent = new TimeZoneAgent())
{
// call methods on agent here...
}
}
GetDefaultTimeZonePreference()
Returns the id of the default timezone preference with deflevel system wide
Declaration
public int GetDefaultTimeZonePreference()
Returns
Type | Description |
---|---|
Int32 | The id of the system wide default timezone preference |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TimeZoneAgent agent = new TimeZoneAgent())
{
// call methods on agent here...
}
}
InitializeTimeZoneData()
Initalizes the TimeZoneData
Declaration
public TimeZoneData[] InitializeTimeZoneData()
Returns
Type | Description |
---|---|
TimeZoneData[] |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TimeZoneAgent agent = new TimeZoneAgent())
{
// call methods on agent here...
}
}
SetActiveTimeZoneRow(Int32, Boolean)
Set active state of singe row in the TZLocation table
Declaration
public void SetActiveTimeZoneRow(int id, bool active)
Parameters
Type | Name | Description |
---|---|---|
Int32 | id | Id of row to set active state on |
Boolean | active | Set active to true or false |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TimeZoneAgent agent = new TimeZoneAgent())
{
// call methods on agent here...
}
}
SetActiveTimeZonesByFilter(String, Boolean)
Toggles active state of a single row in the TZLocation table
Declaration
public void SetActiveTimeZonesByFilter(string filter, bool active)
Parameters
Type | Name | Description |
---|---|---|
String | filter | Filter timezones |
Boolean | active | Set active to true or false |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TimeZoneAgent agent = new TimeZoneAgent())
{
// call methods on agent here...
}
}
SetBaseTimeZoneId(Int32)
Set the base timezone id.
Declaration
public bool SetBaseTimeZoneId(int timezoneId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | timezoneId | The timezone id to save |
Returns
Type | Description |
---|---|
Boolean | Returns true if setting of base timezone was done |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TimeZoneAgent agent = new TimeZoneAgent())
{
// call methods on agent here...
}
}
TimeOfLastTimeZoneUpdate()
Get the time time zone data was last updated
Declaration
public DateTime TimeOfLastTimeZoneUpdate()
Returns
Type | Description |
---|---|
DateTime | Time of last update |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TimeZoneAgent agent = new TimeZoneAgent())
{
// call methods on agent here...
}
}
ToggleActiveTimeZoneRow(Int32)
Toggles active state of a single row in the TZLocation table
Declaration
public void ToggleActiveTimeZoneRow(int id)
Parameters
Type | Name | Description |
---|---|---|
Int32 | id | Id of row to toggle active state on |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TimeZoneAgent agent = new TimeZoneAgent())
{
// call methods on agent here...
}
}
UpdateTimeZoneData()
Retrieve time zone data from the SuperOffice server and update TimeZone data in the database
Declaration
public bool UpdateTimeZoneData()
Returns
Type | Description |
---|---|
Boolean | Returns true if the operation succeeded |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (TimeZoneAgent agent = new TimeZoneAgent())
{
// call methods on agent here...
}
}