我有一個asp.net應用程序,我想將它連接到快速書籍桌面版,在web應用程序中,我想要做到以下幾點: 1-從quickbooks獲取客戶列表。 2-創建新發票並保存發送到快速書本。集成asp.net應用程序與quickbooks桌面版
這是我發現的示例代碼,但我想什麼是我必須在(sessionManager.BeginSession(「」,ENOpenMode.omDontCare);)中的AppId參數中設置的值。
private void getCustomers()
{
bool sessionBegun = false;
bool connectionOpen = false;
QBSessionManager sessionManager = null;
try
{
//Create the session Manager object
sessionManager = new QBSessionManager();
//Create the message set request object to hold our request
IMsgSetRequest requestMsgSet = sessionManager.CreateMsgSetRequest("US", 8, 0);
requestMsgSet.Attributes.OnError = ENRqOnError.roeContinue;
//Connect to QuickBooks and begin a session
sessionManager.OpenConnection(@"D:\A to Z Wholesale Inc.QBW", "QuickBooks Integration Demo");
connectionOpen = true;
sessionManager.BeginSession("", ENOpenMode.omDontCare);
sessionBegun = true;
ICustomerAdd customerAddRq = requestMsgSet.AppendCustomerAddRq();
customerAddRq.Name.SetValue("Amer");
ICustomerQuery customer = requestMsgSet.AppendCustomerQueryRq();
//Send the request and get the response from QuickBooks
IMsgSetResponse responseMsgSet = sessionManager.DoRequests(requestMsgSet);
IResponse response = responseMsgSet.ResponseList.GetAt(0);
ICustomerRet customerRet = (ICustomerRet)response.Detail;
}
catch (Exception ex)
{
}
finally
{
//End the session and close the connection to QuickBooks
if (sessionBegun)
{
sessionManager.EndSession();
}
if (connectionOpen)
{
sessionManager.CloseConnection();
}
}
}
那篇文章非常糟糕 - 它充滿了不準確之處。在一個快速的洞察,一些明顯的錯誤:「QuickBooks API是一個旨在失敗默默。」 (不,它總是會給你一個錯誤信息,他只是沒有正確處理錯誤)「......最低要求和限制......這些沒有記錄在我能找到的任何地方。」 (OSR:http://developer.intuit.com/qbsdk-current/common/newosr/index.html)等等。Ick。 –