1

我正在尝试通过 Quickbooks POS SDK 将 C# 程序与 Quickbooks POS 集成。我安装了 Quickbooks、Quickbooks SDK、Quickbooks POS 和 Quickbooks POS SDK。

当下面的代码点击“sessionManager.BeginSession("");” 我收到错误消息“读取 btnHelp.BorderColorSelected:Property BorderCo 时出错”。不是以 BorderCo 结尾的错字。

有人请帮忙!

using System;
using System.Net;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using Interop.qbposfc3;

namespace POSTest2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void CustomerAdd()
        {                        
            QBPOSSessionManager sessionManager = new QBPOSSessionManager();

            IMsgSetRequest request = sessionManager.CreateMsgSetRequest(3, 0);
            request.Attributes.OnError = ENRqOnError.roeContinue;
            BuildItemInventoryAddRq(request);
            sessionManager.OpenConnection("appID", "Application");
            sessionManager.BeginSession("");
            IMsgSetResponse response = sessionManager.DoRequests(request);
            sessionManager.EndSession();
            sessionManager.CloseConnection();
        }

        private void BuildItemInventoryAddRq(IMsgSetRequest request)
        {
            IItemInventoryAdd ItemInventoryAddRq = request.AppendItemInventoryAddRq();
            ItemInventoryAddRq.ALU.SetValue("M9ine");
        }

        private void button1_Click(object sender, EventArgs e)
        {
            CustomerAdd();
        }
    }
}
4

2 回答 2

1

我不确定您是否仍然需要答案,但可能您需要在 sessionManager.BeginSession() 方法中设置连接字符串:

string connectionString = "Computer Name=WORKPC;Company Data=YourQBCompany;Version=10";
sessionManager.BeginSession(connectionString)

请参阅 QB POS SDK 开发指南,特别是使用 Begin Session 方法:http ://dev.developer.intuit.com/POSSDK-Current/doc/pdf/QBPOS_ProgramGd.pdf

于 2013-07-30T21:26:34.567 回答
0

还请确保公司文件处于多用户模式。

于 2018-09-10T11:05:12.730 回答