Class ConfigurationProviderBase
- Namespace
- RetailForce.Fiscalisation.Configuration
- Assembly
- RetailForce.Fiscalisation.Model.dll
Abstract configuration provider to load the configuration for the fiscal system.
public abstract class ConfigurationProviderBase
- Inheritance
-
ConfigurationProviderBase
- Derived
- Inherited Members
Fields
EncryptionSalt
public const string EncryptionSalt = "RetailForce_2021!"
Field Value
Methods
ClientExists(CompanyIdentification, string, string)
Returns whether the given client exists in the client dictionary.
public abstract bool ClientExists(CompanyIdentification companyIdentification, string storeNumber, string terminalNumber)
Parameters
companyIdentificationCompanyIdentificationstoreNumberstringterminalNumberstring
Returns
- bool
True if the given client exists; otherwise false.
Exceptions
- ArgumentNullException
Thrown if the parameter
companyIdentificationis set to null.- ArgumentNullException
Thrown if the parameter
storeNumberis set to null or string.Empty.- ArgumentNullException
Thrown if the parameter
terminalNumberis set to null or string.Empty.
ClientExists(Guid)
Returns whether the given client exists in the client dictionary.
public abstract bool ClientExists(Guid clientId)
Parameters
clientIdGuidThe client id to search.
Returns
- bool
True if the given client exists; otherwise false.
Exceptions
- ArgumentNullException
Thrown if parameter
clientIdis set to Empty.
ClientExists(Guid, string, string)
Returns whether the given client exists in the client dictionary.
public abstract bool ClientExists(Guid licenseConsumerId, string storeNumber, string terminalNumber)
Parameters
Returns
- bool
True if the given client exists; otherwise false.
Exceptions
- ArgumentNullException
Thrown if the parameter
licenseConsumerIdis set to Empty.- ArgumentNullException
Thrown if the parameter
storeNumberis set to null or string.Empty.- ArgumentNullException
Thrown if the parameter
terminalNumberis set to null or string.Empty.
CreateClient(FiscalClient)
Creates a new client and stores it to the store.
public abstract void CreateClient(FiscalClient client)
Parameters
clientFiscalClientThe new client.
DecryptString(Guid, string)
Decrypts a string of the fiscal client configuration.
public static string DecryptString(Guid uniqueClientId, string stringToDecrypt)
Parameters
uniqueClientIdGuidThe unique client id of the fiscal client of the configuration.
stringToDecryptstringThe string to decrypt.
Returns
- string
The decrypted string.
DeleteClient(Guid)
This method deletes the client from the configuration (and stores the configuration).
public abstract void DeleteClient(Guid clientId)
Parameters
clientIdGuidThe id of the client to delete.
Exceptions
- ArgumentNullException
Thrown if parameter
clientIdis set to Empty.- KeyNotFoundException
Thrown if given client was not found in the configuration.
EncryptString(Guid, string)
Encrypts a string of the fiscal client configuration.
public static string EncryptString(Guid uniqueClientId, string stringToEncrypt)
Parameters
uniqueClientIdGuidThe unique client id of the fiscal client of the configuration.
stringToEncryptstringThe string to encrypt.
Returns
- string
The encrypted string.
GetClientConfiguration(Guid)
Returns the client configuration for the requested id.
public abstract FiscalClient GetClientConfiguration(Guid clientId)
Parameters
Returns
- FiscalClient
The client configuration for the requested id.
Exceptions
- ArgumentOutOfRangeException
Thrown if the client with the given parameter
clientIddoes not exist.
GetClients()
Gets a list of all available clients stored at the system.
public abstract Guid[] GetClients()
Returns
- Guid[]
A list of all available unique client id's.
GetFiscalClients()
Gets a list of all available clients stored at the system.
public abstract FiscalClient[] GetFiscalClients()
Returns
- FiscalClient[]
A list of all available unique client id's.
TryGetClientConfiguration(Guid, out FiscalClient)
Tries to return the client configuration (return value = true); otherwise false.
public abstract bool TryGetClientConfiguration(Guid clientId, out FiscalClient fiscalClient)
Parameters
clientIdGuidThe id (Guid) of the requested client configuration.
fiscalClientFiscalClientThe client configuration for the requested id (if found).
Returns
- bool
True if the client configuration was found; otherwise false.
UpdateClient(FiscalClient)
Updates a client and stores the configuration.
public abstract void UpdateClient(FiscalClient client)
Parameters
clientFiscalClientThe client to update.
Exceptions
- ArgumentNullException
Thrown if parameter
clientis set to null.- KeyNotFoundException
Thrown if client is not found in the store to update.