Class BLOBAgent
Proxy class for the BLOB Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Inherited Members
Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.Implementation.dll
Syntax
public class BLOBAgent : IBLOBAgent, IAgent
Constructors
BLOBAgent(IBlobEntityImplementation, ISoRequestItemsAccessor)
Proxy class for the BLOB Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public BLOBAgent(IBlobEntityImplementation blobEntityImplementation, ISoRequestItemsAccessor accessor)
Parameters
Type | Name | Description |
---|---|---|
IBlobEntityImplementation | blobEntityImplementation | |
ISoRequestItemsAccessor | accessor |
BLOBAgent(IBlobEntityImplementation, ISoRequestItemsAccessor, IDebugUser, IServiceCallsRepository)
Proxy class for the BLOB Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public BLOBAgent(IBlobEntityImplementation blobEntityImplementation, ISoRequestItemsAccessor accessor, IDebugUser debugUser, IServiceCallsRepository serviceCallsRepository)
Parameters
Type | Name | Description |
---|---|---|
IBlobEntityImplementation | blobEntityImplementation | |
ISoRequestItemsAccessor | accessor | |
IDebugUser | debugUser | |
IServiceCallsRepository | serviceCallsRepository |
Methods
ChangeContactImageAsync(int, int, CancellationToken)
Changes the contact image link. If the Binary object id is 0, any image link is removed from the contact.
Declaration
public Task ChangeContactImageAsync(int contactId, int blobId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | contactId | The Contact the image is linked to |
int | blobId | The Binary object id. If the Binary object id is 0, any image link is removed from the Contact. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task |
ChangePersonImageAsync(int, int, CancellationToken)
Proxy class for the BLOB Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public Task ChangePersonImageAsync(int personId, int blobId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | personId | The person the image is linked to |
int | blobId | The Binary object id. If the Binary object id is 0, any image link is removed from the person. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task |
ChangeProductImageAsync(int, int, CancellationToken)
Proxy class for the BLOB Agent Used when communicating remote using WebServices. Avoid using directly. Use the AgentFactory to create the proxy instead.
Declaration
public Task ChangeProductImageAsync(int productId, int blobId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | productId | The product the image is linked to |
int | blobId | The Binary object id. If the Binary object id is 0, any image link is removed from the product. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task |
ChangeProjectImageAsync(int, int, CancellationToken)
Changes the project image link. If the Binary object id is 0, any image link is removed from the project.
Declaration
public Task ChangeProjectImageAsync(int projectId, int blobId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectId | The project the image is linked to |
int | blobId | The Binary object id. If the Binary object id is 0, any image link is removed from the project. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task |
CleanupBatchTaskAsync(int, CancellationToken)
Removes the binary objects linked to the batch task, the links themselves and the batch task.
Declaration
public Task CleanupBatchTaskAsync(int batchTaskId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | batchTaskId | The ID of the batchtask that created the output data |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task |
CreateDefaultBlobEntityAsync(CancellationToken)
Loading default values into a new BlobEntity. NetServer calculates default values (e.g. Country) on the entity, which is required when creating/storing a new instance
Declaration
public Task<BlobEntity> CreateDefaultBlobEntityAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<BlobEntity> | New BlobEntity with default values |
DeleteBlobEntityAsync(int, CancellationToken)
Deletes the BlobEntity
Declaration
public Task DeleteBlobEntityAsync(int blobEntityId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | blobEntityId | The identity of the BlobEntity |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task |
GetBlobEntityAsync(int, CancellationToken)
Gets a BlobEntity object.
Declaration
public Task<BlobEntity> GetBlobEntityAsync(int blobEntityId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | blobEntityId | The identifier of the BlobEntity object |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<BlobEntity> | BlobEntity |
GetBlobEntityOnContactAsync(int, CancellationToken)
Gets the blob entity that represents the contact image binary object.
Declaration
public Task<BlobEntity> GetBlobEntityOnContactAsync(int contactId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | contactId | The Contact id |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<BlobEntity> | BlobEntity object |
GetBlobEntityOnCountryAsync(int, CancellationToken)
Gets the blob entity that represents the country flag binary object.
Declaration
public Task<BlobEntity> GetBlobEntityOnCountryAsync(int countryId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | countryId | The country id |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<BlobEntity> | BlobEntity object |
GetBlobEntityOnPersonAsync(int, CancellationToken)
Gets the blob entity that represents the person image binary object.
Declaration
public Task<BlobEntity> GetBlobEntityOnPersonAsync(int personId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | personId | The person id |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<BlobEntity> | BlobEntity object |
GetBlobEntityOnProductAsync(int, CancellationToken)
Gets the blob entity that represents the product image binary object.
Declaration
public Task<BlobEntity> GetBlobEntityOnProductAsync(int productId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | productId | The product id |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<BlobEntity> | BlobEntity object |
GetBlobEntityOnProjectAsync(int, CancellationToken)
Gets the blob entity that represents the project image binary object.
Declaration
public Task<BlobEntity> GetBlobEntityOnProjectAsync(int projectId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectId | The project id |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<BlobEntity> | BlobEntity object |
GetBlobStreamAsync(int, CancellationToken)
Get the binary object as a stream
Declaration
public Task<Stream> GetBlobStreamAsync(int blobEntityId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | blobEntityId | The ID of the BLOB entity object that refers to the binary data |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<Stream> | The binary object as a Stream |
GetChatImageWithSizeAsync(int, int, int, CancellationToken)
Returns the chat image that is displayed in chat with a specified maximum size.
Declaration
public Task<Image> GetChatImageWithSizeAsync(int chatTopicId, int width, int height, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | chatTopicId | The project id of the project the image belongs to. |
int | width | The maximum with of the returned image. Specify <= 0 to preserve aspect ratio of existing image |
int | height | The maximum height of the returned image. Specify <= 0 to preserve aspect ratio of existing image |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<Image> | The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a jpeg/base64 encoded string.) |
GetContactImageAsync(int, CancellationToken)
Returns the contact image that is displayed in the CRM application.
Declaration
public Task<Image> GetContactImageAsync(int contactId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | contactId | The contact id of the contact the image belongs to. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<Image> | The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a Base64 encoded string.) |
GetContactImageWithSizeAsync(int, int, int, CancellationToken)
Returns the contact image that is displayed in the CRM application with a specified maximum size.
Declaration
public Task<Image> GetContactImageWithSizeAsync(int contactId, int width, int height, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | contactId | The contact id of the Contact the image belongs to. |
int | width | The maximum with of the returned image. Specify <= 0 to preserve aspect ratio of existing image |
int | height | The maximum height of the returned image. Specify <= 0 to preserve aspect ratio of existing image |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<Image> | The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a jpeg/base64 encoded string.) |
GetOutputFromBatchAsync(int, CancellationToken)
Get the output of a batchtask as a stream
Declaration
public Task<Stream> GetOutputFromBatchAsync(int batchTaskId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | batchTaskId | The ID of the batchtask that created the output data |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<Stream> | The binary object as a Stream |
GetPersonImageAsync(int, CancellationToken)
Returns the person image that is displayed in the CRM application.
Declaration
public Task<Image> GetPersonImageAsync(int personId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | personId | The person id of the person the image belongs to. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<Image> | The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a Base64 encoded string.) |
GetPersonImageWithSizeAsync(int, int, int, CancellationToken)
Returns the person image that is displayed in the CRM application with a specified maximum size.
Declaration
public Task<Image> GetPersonImageWithSizeAsync(int personId, int width, int height, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | personId | The person id of the person the image belongs to. |
int | width | The maximum with of the returned image. Specify <= 0 to preserve aspect ratio of existing image |
int | height | The maximum height of the returned image. Specify <= 0 to preserve aspect ratio of existing image |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<Image> | The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a jpeg/base64 encoded string.) |
GetProductImageAsync(int, CancellationToken)
Returns the product image (rank=1) that is displayed in the CRM application.
Declaration
public Task<Image> GetProductImageAsync(int productId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | productId | The product id of the product the image belongs to. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<Image> | The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a Base64 encoded string.) |
GetProductThumbnailAsync(int, CancellationToken)
Returns the product thumbnail that is displayed in the CRM application.
Declaration
public Task<Image> GetProductThumbnailAsync(int productId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | productId | The product id of the product the thumbnail belongs to. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<Image> | The thumbnail as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a Base64 encoded string.) |
GetProjectImageAsync(int, CancellationToken)
Returns the project image that is displayed in the CRM application.
Declaration
public Task<Image> GetProjectImageAsync(int projectId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectId | The project id of the project the image belongs to. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<Image> | The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a Base64 encoded string.) |
GetProjectImageWithSizeAsync(int, int, int, CancellationToken)
Returns the project image that is displayed in the CRM application with a specified maximum size.
Declaration
public Task<Image> GetProjectImageWithSizeAsync(int projectId, int width, int height, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectId | The project id of the project the image belongs to. |
int | width | The maximum with of the returned image. Specify <= 0 to preserve aspect ratio of existing image |
int | height | The maximum height of the returned image. Specify <= 0 to preserve aspect ratio of existing image |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<Image> | The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a jpeg/base64 encoded string.) |
GetQuoteLineImageAsync(int, CancellationToken)
Returns the quoteline image (rank=1) that is displayed in the CRM application.
Declaration
public Task<Image> GetQuoteLineImageAsync(int quoteLineId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | quoteLineId | The product id of the quoteline the image belongs to. |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<Image> | The image as a System.Drawing.Image. (If the the image is returned over webservices, the stream is returned as a Base64 encoded string.) |
SaveBlobEntityAsync(BlobEntity, CancellationToken)
Updates the existing BlobEntity or creates a new BlobEntity if the id parameter is empty
Declaration
public Task<BlobEntity> SaveBlobEntityAsync(BlobEntity blobEntity, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
BlobEntity | blobEntity | The BlobEntity that is saved. |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<BlobEntity> | New or updated BlobEntity |
SaveImageStreamAsync(BlobLinkType, Image, string, CancellationToken)
Stores an image in the database without linking it to a project or a person. It is possible to ChangePersonImage or ChangeProjectImage to attach image later.
Declaration
public Task<int> SaveImageStreamAsync(BlobLinkType type, Image image, string description, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
BlobLinkType | type | The type of the image. |
Image | image | Image to store |
string | description | Image description |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task<int> | The blob id |
SaveProjectImageAsync(string, Image, CancellationToken)
Saves a project image that is displayed in the CRM application's project image selection dialog to the database.
Declaration
public Task SaveProjectImageAsync(string description, Image image, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | description | Image description. Should be image name (e.g. winter.jpg) for project images |
Image | image | The project image (System.Drawing.Image) |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task |
SetBlobStreamAsync(int, Stream, CancellationToken)
Store a binary object from it's stream
Declaration
public Task SetBlobStreamAsync(int blobEntityId, Stream stream, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | blobEntityId | Id of the BLOB entity object that the binary data should be stored to. |
Stream | stream | The binary object as a Stream |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task |
SetContactImageAsync(int, Image, CancellationToken)
Stores the contact image that is displayed in the CRM application.
Declaration
public Task SetContactImageAsync(int contactId, Image image, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | contactId | The contact id of the contact the image belongs to. |
Image | image | The image that is stored on the contact (System.Drawing.Image) |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task |
SetPersonImageAsync(int, Image, CancellationToken)
Stores the person image that is displayed in the CRM application.
Declaration
public Task SetPersonImageAsync(int personId, Image image, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | personId | The person id of the person the image belongs to. |
Image | image | The image that is stored on the person (System.Drawing.Image) |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task |
SetProductImageAsync(int, Image, CancellationToken)
Stores the product image that is displayed in the CRM application. The image is scaled down to max 1000x1000. This method operates only the main (rank=1) image; future extensions may support multiple images. A thumbnail of size 75x75 is also automatically set.
Declaration
public Task SetProductImageAsync(int productId, Image image, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | productId | The product id of the product the image belongs to. |
Image | image | The image that is stored on the product (System.Drawing.Image), scaled down to no more than 1000x1000 |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task |
SetProductThumbnailAsync(int, Image, CancellationToken)
Stores the product thumbnail that is displayed in the CRM application. The image is scaled down to max 200x200 pixels.
Declaration
public Task SetProductThumbnailAsync(int productId, Image image, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | productId | The product id of the product the image belongs to. |
Image | image | The image that is stored on the product (System.Drawing.Image); scaled down to no more than 200x200 |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task |
SetProjectImageAsync(int, Image, CancellationToken)
Stores the project image that is displayed in the CRM application.
Declaration
public Task SetProjectImageAsync(int projectId, Image image, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
int | projectId | The project id of the project the image belongs to. |
Image | image | The image that is stored on the project (System.Drawing.Image) |
CancellationToken | cancellationToken | This operation cannot be cancelled; the cancellationToken parameter is ignored |
Returns
Type | Description |
---|---|
Task |