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