Click or drag to resize

IWsCommonGetCreditProjection Method

The method does a projection on the user credit and tells in wich time the credit expires

Namespace:  Aruba.Cloud.WsCommon
Assembly:  Aruba.Cloud.WsCommon (in Aruba.Cloud.WsCommon.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
[OperationContractAttribute]
WsResult<CreditProjection> GetCreditProjection(
	Nullable<DateTime> maxLookupDate,
	Nullable<decimal> creditThreshold,
	Nullable<int> datacenterID
)

Parameters

maxLookupDate
Type: SystemNullableDateTime
The maximum date limit
creditThreshold
Type: SystemNullableDecimal
Optional parameter giving a threshold for calculation
datacenterID
Type: SystemNullableInt32
The data center to inspect

Return Value

Type: WsResultCreditProjection
Return an object of type CreditProjection telling when the credit expires or the credit state on maxLookupDate
Examples
This example shows how to use the function to get the projection of User's credit after 30 days
public CreditProjection GetCreditProjection()
{
    var maxLookupDate = DateTime.Now.AddDays(30);

    using (var client = new WsCommonClient())
    {
        var projection = client.GetCreditProjection(maxLookupDate, null, null);
        if (projection.Success)
        {
            if (projection.Value != null)
                return projection.Value;
        }
        else
        {
            throw new CodedException(result.ResultCode, result.ResultMessage);
        }
    }
}
See Also