Class LicenseAgent
Facade for the License Agent License query, download, activation
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
public class LicenseAgent : AgentBase<ILicenseAgent>, IDisposable, ILicenseAgent, IAgent
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
Constructors
LicenseAgent()
Facade for the License Agent License query, download, activation
Declaration
public LicenseAgent()
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
Methods
ActivateLicenseInfo(ExtendedLicenseInfo)
Save a new license to the database.
Declaration
public LicenseResult ActivateLicenseInfo(ExtendedLicenseInfo newLicense)
Parameters
Type | Name | Description |
---|---|---|
ExtendedLicenseInfo | newLicense | New license to save to the database. |
Returns
Type | Description |
---|---|
LicenseResult |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
AddLicenseFromFile(String)
Load and activate a new license from file/string if the new license is valid.
Declaration
public ExtendedLicenseInfo AddLicenseFromFile(string fileContent)
Parameters
Type | Name | Description |
---|---|---|
String | fileContent | Content of the license file as XML. |
Returns
Type | Description |
---|---|
ExtendedLicenseInfo | Activated license |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
AssignThirdPartyLicenses(Int32, String, String[])
Assign third party licenses
Declaration
public ModuleLicenseLink[] AssignThirdPartyLicenses(int associateId, string moduleOwner, string[] moduleLicenseNames)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | User to assign third party licenses for |
String | moduleOwner | Name of the module owner to assign license for |
String[] | moduleLicenseNames | Name of module licenses to assign |
Returns
Type | Description |
---|---|
ModuleLicenseLink[] | All module license names assigned |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
ChangeSerialNumber(String, String)
Change the new serial number for the installation. Requests a new license from SuperLicense, checks if change is authorized.
Declaration
public LicenseResult ChangeSerialNumber(string newCompanyName, string newSerialNumber)
Parameters
Type | Name | Description |
---|---|---|
String | newCompanyName | The new company name |
String | newSerialNumber | New serial number to change to. |
Returns
Type | Description |
---|---|
LicenseResult | License after serial number/name change |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
GetLicenseForAllOwnersFromDB()
Get all licenses, with usage, from all module owners as they are stored in the database
Declaration
public ExtendedLicenseInfo[] GetLicenseForAllOwnersFromDB()
Returns
Type | Description |
---|---|
ExtendedLicenseInfo[] |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
GetLicenseFromDB(String)
Get license, with usage, as it is stored in the database for one particular module owner.
Declaration
public ExtendedLicenseInfo GetLicenseFromDB(string ownerName)
Parameters
Type | Name | Description |
---|---|---|
String | ownerName | Name of the module owner. |
Returns
Type | Description |
---|---|
ExtendedLicenseInfo | License, with usage, as it is stored in the database. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
GetLicenseFromFile(String)
Load a new license from file
Declaration
public ExtendedLicenseInfo GetLicenseFromFile(string fileContent)
Parameters
Type | Name | Description |
---|---|---|
String | fileContent | Content of the license file as read. |
Returns
Type | Description |
---|---|
ExtendedLicenseInfo |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
GetLicenseFromLicenseServer(String)
Facade for the License Agent License query, download, activation
Declaration
public ExtendedLicenseInfo GetLicenseFromLicenseServer(string ownerName)
Parameters
Type | Name | Description |
---|---|---|
String | ownerName |
Returns
Type | Description |
---|---|
ExtendedLicenseInfo |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
GetLicenseStatusFromLicenseServer(String)
Get License from the license server for a particular module owner.
Declaration
public CheckLicenseStatusResult GetLicenseStatusFromLicenseServer(string ownerName)
Parameters
Type | Name | Description |
---|---|---|
String | ownerName | Name of the module owner to get license from. |
Returns
Type | Description |
---|---|
CheckLicenseStatusResult | License from the database, from the license server and with usage. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
GetModuleLicenseFromDB(String, String)
Get license information for one particular license module.
Declaration
public ModuleLicense GetModuleLicenseFromDB(string ownerName, string moduleName)
Parameters
Type | Name | Description |
---|---|---|
String | ownerName | Name of the module owner. |
String | moduleName | Name of the license module. |
Returns
Type | Description |
---|---|
ModuleLicense | Module License details, as it is stored in the database. NULL if not found. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
GetModuleLicenseHistoryFromLicenseServer(ExtendedLicenseInfo, ExtendedModuleLicense)
Get details about a license from the license server.
Declaration
public string GetModuleLicenseHistoryFromLicenseServer(ExtendedLicenseInfo licenseInfo, ExtendedModuleLicense moduleLicense)
Parameters
Type | Name | Description |
---|---|---|
ExtendedLicenseInfo | licenseInfo | Description of the license |
ExtendedModuleLicense | moduleLicense | Information about a particular module to get information for. |
Returns
Type | Description |
---|---|
String | Information about a particular license module. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
GetSatelliteLicenses(Int32)
Obtain information about satellite module licenses
Declaration
public LicenseOwner[] GetSatelliteLicenses(int satelliteId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | satelliteId | Satellite id to check for satellite module licenses |
Returns
Type | Description |
---|---|
LicenseOwner[] | Satellite module licenses grouped by owners. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
GetShopUrl(String)
Get the shop URL for the specified module owner. This can be used to redirect user to the web shop.
Declaration
public string GetShopUrl(string ownerName)
Parameters
Type | Name | Description |
---|---|---|
String | ownerName | Name of the module owner. |
Returns
Type | Description |
---|---|
String | The URL which contains the shop for the specified module owner. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
GetThirdPartyLicenseAssignments(Int32, String)
Get license assignments for an associate for licenses belonging to an other module owner than SuperOffice
Declaration
public ModuleLicenseLink[] GetThirdPartyLicenseAssignments(int associateId, string moduleOwner)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | User to get third party license assignments for |
String | moduleOwner | Name of the module owner to get license assignments for |
Returns
Type | Description |
---|---|
ModuleLicenseLink[] | Module license names |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
GetUserAndInstallationLicenceStatus(Int32)
Get status values for user licenses and installation license that can be used for feedback to the user.
Declaration
public UserAndInstallationLicenceStatus GetUserAndInstallationLicenceStatus(int associateId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | Associate id to use when loading information about user licenses and installation license status. |
Returns
Type | Description |
---|---|
UserAndInstallationLicenceStatus | An object that holds information for producing license status feedback to the user. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
GetUserLicenses(Int32)
Obtain information about associate module licenses
Declaration
public LicenseOwner[] GetUserLicenses(int associateId)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | Associate id to check for associate module licenses |
Returns
Type | Description |
---|---|
LicenseOwner[] | Associate module licenses grouped by owners. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
GetUserLicensesMDOList()
Get all licenses in a MDOListItem structure.
Declaration
public SelectableMDOListItem[] GetUserLicensesMDOList()
Returns
Type | Description |
---|---|
SelectableMDOListItem[] | Hierarchical structure of user licenses. |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
RemoveLicenseFromDB(String)
Remove the license from a particular module owner from the database. It is not permitted to remove licenses from SuperOffice
Declaration
public LicenseResult RemoveLicenseFromDB(string moduleOwner)
Parameters
Type | Name | Description |
---|---|---|
String | moduleOwner | Name of the module owner to remove license from. |
Returns
Type | Description |
---|---|
LicenseResult |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
UnassignThirdPartyLicenses(Int32, String, String[])
Unassign (remove) third party licenses
Declaration
public ModuleLicenseLink[] UnassignThirdPartyLicenses(int associateId, string moduleOwner, string[] moduleLicenseNames)
Parameters
Type | Name | Description |
---|---|---|
Int32 | associateId | User to unassign third party licenses for |
String | moduleOwner | Name of the module owner to unassign license for |
String[] | moduleLicenseNames | Name of module licenses to unassign (remove) |
Returns
Type | Description |
---|---|
ModuleLicenseLink[] | All module license names assigned |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}
ValidateLicenseInfo(ExtendedLicenseInfo)
Validate that a license is consistant.
Declaration
public LicenseResult ValidateLicenseInfo(ExtendedLicenseInfo licenseInfo)
Parameters
Type | Name | Description |
---|---|---|
ExtendedLicenseInfo | licenseInfo | License to validate consistancy for |
Returns
Type | Description |
---|---|
LicenseResult |
Examples
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
using (LicenseAgent agent = new LicenseAgent())
{
// call methods on agent here...
}
}