Click or drag to resize

IWsCommonGetPurchasedCustomProductDetails Method

The method gets the Custom Products purchased for one specific Custom Product

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<CustomProductDetails> GetPurchasedCustomProductDetails(
	int customProductID
)

Parameters

customProductID
Type: SystemInt32

Return Value

Type: WsResultCustomProductDetails
The entity contain the details of Custom Products purchased, with the validitiy Date of billing
Remarks
This method allows you to retrieve the specific Custom Product purchased and the history of changes made to it
Examples
/// IWsCommon.GetPurchasedCustomProductDetails Method (c# .NET)
public static string GetPurchasedCustomProductDetails(WsCommonClient client, int customProductId)
{
  //specify the account login details
  client.ClientCredentials.UserName.UserName = "ARU-0000";
  client.ClientCredentials.UserName.Password = "0123456789";

  StringBuilder stringBuilder = new StringBuilder();

  try
  {
    // call method WsResultOfCustomProductDetails
    // obtaining a GetPurchasedCustomProductDetails item
    WsResultOfCustomProductDetails result =
    client.GetPurchasedCustomProductDetails(customProductId);

    // if the call is Success print returned values
    if (result.Success)
    {
      stringBuilder.Append("Operation ends successfully\n");

      // get Value returned from server
      CustomProduct item = result.Value;

      if (item != null)
      {
        stringBuilder.Append("Custom Product detail\n");

        stringBuilder.Append("\nProductID: ");
        stringBuilder.Append(item.ProductID);
        stringBuilder.Append("\nCustomProductID: ");
        stringBuilder.Append(item.CustomProductID);
        stringBuilder.Append("\nName: ");
        stringBuilder.Append(item.ProductName);
        stringBuilder.Append("\nQuantity: ");
        stringBuilder.Append(item.Quantity);
        stringBuilder.Append("\nDescription: ");
        stringBuilder.Append(item.ProductDescription);
        stringBuilder.Append("\nBillingType: ");
        stringBuilder.Append(item.BillingType);
        stringBuilder.Append("\nExpiryDate: ");
        stringBuilder.Append(item.ExpiryDate);
        stringBuilder.Append("\nPrice: ");
        stringBuilder.Append(item.Price);

      }
    }
    else
    {
      throw new ApplicationException(result.ResultMessage);
    }
  }
  catch (Exception ex)
  {
    // re-run the error
    throw new ApplicationException(ex.Message);
  }

  return stringBuilder.ToString();
}
See Also