Skip to main content

Class NumberAllocationAgent

Namespace: SuperOffice.WebApi.Agents
Assembly: SuperOffice.WebApi.dll
This agent can be used to manage number allocation

Inheritance

objectAgentBaseNumberAllocationAgent

Implements

INumberAllocationAgent, IAgentBase, IDisposable

Inherited Members

AgentBase._json, AgentBase._binary, AgentBase._config, AgentBase._client, AgentBase._disposeClient, AgentBase.Merge(RequestOptions), AgentBase.BuildRequestFromObject(HttpMethod, string, object, WebApiOptions, string), AgentBase.BuildRequestFromStream(HttpMethod, string, Stream, WebApiOptions, string), AgentBase.BuildRequestFromObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string), AgentBase.ParseAuthorization(IAuthorization), AgentBase.CancelRequest(), AgentBase.SendRequestObject(HttpMethod, string, object, WebApiOptions, string), AgentBase.SendRequestObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string), AgentBase.SendRequest(HttpRequestMessage, RequestOptions), AgentBase.ThrowOnResponseErrorAsync(HttpRequestMessage, HttpResponseMessage), AgentBase.ParseResponse<T&gt;(HttpResponseMessage), AgentBase.Finally(RequestOptions), AgentBase.Dispose(), AgentBase.Configuration, AgentBase.Client, AgentBase.HasRunningRequest, AgentBase.ClientCancellationTokenSource, AgentBase.ProgressListener, AgentBase.UploadProgressListener, object.ToString(), object.Equals(object), object.Equals(object, object), object.ReferenceEquals(object, object), object.GetHashCode(), object.GetType(), object.MemberwiseClone()

Examples

<pre><code class=“lang-csharp”>using SuperOffice.WebApi; using SuperOffice.WebApi.Agents; var mySession = new WebApiOptions(“http://example.com/super/api”); mySession.Authorization = new AuthorizationUsernamePassword(“user”, “pass”); using (NumberAllocationAgent agent = new NumberAllocationAgent(mySession)) { // call methods on agent here… }</code></pre>

Constructors

NumberAllocationAgent(HttpClient)

Constructor: This agent can be used to manage number allocation

Parameters

httpClient HttpClient Use this HTTP client instead of making own HttpClient instance.

NumberAllocationAgent(WebApiOptions, HttpClient)

Constructor: This agent can be used to manage number allocation

Parameters

options WebApiOptions Base URL and authentication values. httpClient HttpClient Optional: Use this HTTP client instead of making a new one.

Methods

CreateDefaultRefCountEntityAsync(RequestOptions)

Set default values into a new RefCountEntity. NetServer calculates default values on the entity, which is required when creating/storing a new instance

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<RefCountEntity&gt; A blank RefCountEntity

DeleteRefCountEntityAsync(int, RequestOptions)

Deletes the RefCountEntity

Parameters

refCountEntityId int The identity of the RefCountEntity requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task

GetNumberEachTemplateAsync(RequestOptions)

Returns true or false if Automatically create new counters for new document templates

Parameters

requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<bool&gt; Is NumberEachTemplate?

GetRefCountEntityAsync(int, RequestOptions)

Gets a specific RefCountEntity object.

Parameters

refCountEntityId int The identifier of the RefCountEntity object requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<RefCountEntity&gt; RefCountEntity

SaveDefaultNumberingAsync(RefCountEntity, RequestOptions)

Saves default numbering values in preferences

Parameters

refCountEntity RefCountEntity The refCountEntity that holds the values that will be saved requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task void

SaveRefCountEntityAsync(RefCountEntity, RequestOptions)

Updates the existing RefCountEntity or creates a new RefCountEntity if the id parameter is 0.

Parameters

refCountEntity RefCountEntity The RefCountEntity that is saved. requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task<RefCountEntity&gt; New or updated RefCountEntity

SetNumberEachTemplateAsync(bool, RequestOptions)

Saves true or false if Automatically create new counters for new document templates

Parameters

setValue bool true or false if Automatically create new counters for new document templates requestOptions RequestOptions Override language/culture codes on this request.

Returns

Task void