Don't like ads? PRO users don't see any ads ;-)

IPP .NET DevKit v2 - QBD CustomerQuery - Retrieve All

By: IDNPeterL on May 9th, 2012  |  syntax: C#  |  size: 0.82 KB  |  hits: 134  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //Retrieve all QBD Customers
  2. //Documentation: http://goo.gl/XsxjR
  3.  
  4. List<Intuit.Ipp.Data.Qbd.Customer> customerSet = new List<Intuit.Ipp.Data.Qbd.Customer>();
  5. List<Intuit.Ipp.Data.Qbd.Customer> customerQueryResult = null;
  6. int startPage = 1;
  7.  
  8. do
  9. {
  10.     Intuit.Ipp.Data.Qbd.CustomerQuery qbdCustomerQuery = new Intuit.Ipp.Data.Qbd.CustomerQuery();
  11.     qbdCustomerQuery.ChunkSize = "100";
  12.     qbdCustomerQuery.ItemElementName = ItemChoiceType4.StartPage;
  13.     qbdCustomerQuery.Item = startPage.ToString();
  14.     customerQueryResult = qbdCustomerQuery.ExecuteQuery<Intuit.Ipp.Data.Qbd.Customer>(context).ToList<Intuit.Ipp.Data.Qbd.Customer>();
  15.     if (customerQueryResult.Count > 0) { customerSet.AddRange(customerQueryResult); }
  16.     startPage++;
  17. } while (customerQueryResult.Count > 0);
  18.  
  19. int customerCount = customerSet.Count;