2013-07-22 70 views
0

我使用QuickBooks API。通过这个API,我试图让所有的客户细节,如全名,地址(地址1,地址2 ....),市,州,邮编等如何使用Quickbooks获取客户详细信息QBXML

下面是我的代码:

RequestProcessor2Class rp = new RequestProcessor2Class(); 


public void connectToQB() 
     { 
      rp = new RequestProcessor2Class(); 
      rp.OpenConnection(appID, appName); 
      ticket = rp.BeginSession(companyFile, mode); 
      string[] versions = rp.get_QBXMLVersionsForSession(ticket); 
      maxVersion = versions[versions.Length - 1]; 
     } 

public string processRequestFromQB(string request) 
     { 
      try 
      { 
       return rp.ProcessRequest(ticket, request); 
      } 
      catch (Exception e) 
      { 
       MessageBox.Show(e.Message); 
       return null; 
      } 
     } 


string request = "CustomerQueryRq"; 
      objConnect.connectToQB(); 
      int count = objConnect.getCount(request); 
      string response = objConnect.processRequestFromQB(objConnect.buildCustomerQueryRqXML(new string[] { "FullName", "City" }, null)); 
      string[] customerList = objConnect.parseCustomerQueryRs(response, count); 
      objConnect.disconnectFromQB(); 

让我知道如果你想了解更多信息。

谢谢,

回答

0

这是获取客户名称的示例代码。

ICustomerRetList customerRetList = (ICustomerRetList)response.Detail; 
    ICustomerRet customerRet = customerRetList.GetAt(0); 
    textBox1.Text = customerRet.Name.GetValue().ToString(); 

请了解更多。

- >>获取其他细节。

+0

我使用“RequestProcessor2Class”对象其引用“Interop.QBXMLRP2.dll”,所以我想我不能使用ICustomerRetList这个对象。 –

+0

您的文章,您使用Quickbooks QBFC。现在你说你使用QBXML。 !!请检查您的发布细节。 我的示例代码在“使用QBFC10Lip”中工作。 – Chanakan

+0

好的,你有没有提供QBXML的代码? –

相关问题