0

我使用了 QuickBooks API。通过这个 API,我尝试获取所有客户详细信息,例如全名、地址(Addr1、Addr2 ....)、城市、州、邮政编码等。

下面是我的代码:

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();

如果您想了解更多信息,请告诉我。

谢谢,

4

1 回答 1

1

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

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

请了解更多。

->> 获取其他详细信息。

于 2013-07-25T09:53:28.787 回答