コード例 #1
0
    public static string buildSalesReceiptAddRqXML(Session sess, string[,] sales)
    {
        QBSessionManager sessionManager = new QBSessionManager();
        IMsgSetRequest   requestSet     = sessionManager.CreateMsgSetRequest(sess.getCountry(), sess.getMajorVers(), sess.getMinorVers());

        requestSet.Attributes.OnError = ENRqOnError.roeStop;

        buildSalesRequest(sales, requestSet);
        return(requestSet.ToXMLString());
    }
コード例 #2
0
    public static String queryAll(Session sess)
    {
        QBSessionManager sessionManager = new QBSessionManager();
        IMsgSetRequest   requestSet     = sessionManager.CreateMsgSetRequest(sess.getCountry(), sess.getMajorVers(), sess.getMinorVers());

        requestSet.Attributes.OnError = ENRqOnError.roeStop;
        IItemInventoryQuery ItemQ = requestSet.AppendItemInventoryQueryRq();

        ItemQ.iterator.SetValue(ENiterator.itStart);
        ItemQ.ORListQueryWithOwnerIDAndClass.ListWithClassFilter.MaxReturned.SetValue(chunkSize);
        return(requestSet.ToXMLString());
    }
コード例 #3
0
        public static string queryNext(Session sess)
        {
            QBSessionManager sessionManager = new QBSessionManager();
            IMsgSetRequest   requestSet     = sessionManager.CreateMsgSetRequest(sess.getCountry(), sess.getMajorVers(), sess.getMinorVers());

            requestSet.Attributes.OnError = ENRqOnError.roeStop;
            IItemInventoryQuery ItemQ = requestSet.AppendItemInventoryQueryRq();

            ItemQ.iterator.SetValue(ENiterator.itContinue);
            ItemQ.iteratorID.SetValue(sess.getProperty("queryContext").ToString());
            //ItemQ.ORListQuery.ListFilter.MaxReturned.SetValue(chunkSize);
            return(requestSet.ToXMLString());
        }
コード例 #4
0
 private IMsgSetResponse processRequestFromQB(IMsgSetRequest requestSet)
 {
     try
     {
         consoleOutput.AppendText("\r\n" + requestSet.ToXMLString());
         IMsgSetResponse responseSet = sessionManager.doRequest(true, ref requestSet);
         consoleOutput.AppendText("\r\n Response:" + responseSet.ToXMLString());
         return(responseSet);
     }
     catch (Exception e)
     {
         consoleOutput.AppendText("\r\n" + e.Message);
         return(null);
     }
 }
コード例 #5
0
ファイル: InvoiceAddHelper.cs プロジェクト: papyr/QbfcSamples
        private void BuildInvoiceAddRq(IMsgSetRequest requestMsgSet)
        {
            IInvoiceAdd invoiceAddRq = requestMsgSet.AppendInvoiceAddRq();

            invoiceAddRq.CustomerRef.FullName.SetValue("City");
            invoiceAddRq.Other.SetValue("12345");
            invoiceAddRq.TxnDate.SetValue(DateTime.Now);

            IORInvoiceLineAdd oRInvoiceLineAddList     = invoiceAddRq.ORInvoiceLineAddList.Append();
            string            orInvoiceListElementType = "InvoiceLineAdd";

            if (orInvoiceListElementType == "InvoiceLineAdd")
            {
                // oRInvoiceLineAddList.InvoiceLineAdd.ItemRef.FullName.SetValue("Storage");
                oRInvoiceLineAddList.InvoiceLineAdd.Desc.SetValue("January Storage");
                // oRInvoiceLineAddList.InvoiceLineAdd.Quantity.SetValue(2);
                // oRInvoiceLineAddList.InvoiceLineAdd.Amount.SetValue(9.99);
                // oRInvoiceLineAddList.InvoiceLineAdd.UnitOfMeasure.SetValue("each");
                //  oRInvoiceLineAddList.InvoiceLineAdd.ORRatePriceLevel.Rate.SetValue(9.99);
            }

            // Add blank line
            var invLine3 = invoiceAddRq.ORInvoiceLineAddList.Append();
            var line3    = invLine3.InvoiceLineAdd;

            line3.Desc.SetEmpty();



            IORInvoiceLineAdd oRInvoiceLineAddList2 = invoiceAddRq.ORInvoiceLineAddList.Append();
            var invoiceLineAdd2 = oRInvoiceLineAddList2.InvoiceLineAdd;

            if (orInvoiceListElementType == "InvoiceLineAdd")
            {
                invoiceLineAdd2.ItemRef.FullName.SetValue("Storage");
                invoiceLineAdd2.Desc.SetValue("Test Transaction Item");
                invoiceLineAdd2.Quantity.SetValue(2);
                // oRInvoiceLineAddList.InvoiceLineAdd.Amount.SetValue(9.99);
                // oRInvoiceLineAddList.InvoiceLineAdd.UnitOfMeasure.SetValue("each");
                invoiceLineAdd2.ORRatePriceLevel.Rate.SetValue(9.99);
            }
            //invoiceAddRq.IncludeRetElementList.Add("ab");



            Console.WriteLine(requestMsgSet.ToXMLString());
        }