我使用了 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();
如果您想了解更多信息,请告诉我。
谢谢,