Click or drag to resize

LoyaltyClientSelectVoucherList Method

Syntax
C#
public ResultOfPagedCollectionOfVoucherStub SelectVoucherList(
	ManagementGroupRequestOfVoucherSearchFilter request
)

Parameters

request
Type: LoyaltyServiceManagementGroupRequestOfVoucherSearchFilter

Return Value

Type: ResultOfPagedCollectionOfVoucherStub
Examples
C#
using (var svc = new LoyaltyService.LoyaltyClient())
{
  var request = new LoyaltyService.ManagementGroupRequestOfVoucherSearchFilter();
  request.Token = "Token";//Required - Token returned from AccountService.ManagementGroupLogin
  request.ManagementGroup = "Management group";//Required - ManagementGroup supplied when calling AccountService.ManagementGroupLogin

  var search = new LoyaltyService.VoucherSearchFilter();
  search.PageNumber = 1;//Optional - defaults to 1 if not supplied
  search.PageSize = 100;//Optional - default to 100 if not supplied
  search.DateFrom = DateTime.Now.AddDays(-7);//Optional
  search.DateTo = DateTime.Now;//Optional
  search.VoucherCode = "Voucher code";//Optional
  search.VoucherStatus = "VALID"; //Optional - Valid values are : 'VALID', or 'EXPIRED'

  //add search to request
  request.Value = search;

  LoyaltyService.ResultOfPagedCollectionOfVoucherStub result = svc.SelectVoucherList(request);

  if (result.FaultCode == 0)
  {
    //Request succeeded
  }
  else
  {
    //Request failed
    throw new Exception(result.FaultDescription);
  }
}
See Also