Esempio n. 1
0
        public SalesReceiptRet AddSalesReceipt(SalesReceipt salesreceipt)
        {
            //Create the message set request object to hold our request

            if (sessionManager != null)
            {
                IMsgSetRequest SalesReceiptRequestMsgSet = sessionManager.CreateMsgSetRequest(3, 0);
                SalesReceiptRequestMsgSet.Attributes.OnError = ENRqOnError.roeContinue;
                SalesReceiptViewModel SalesReceiptVM = new SalesReceiptViewModel();
                SalesReceiptVM.BuildSalesReceiptAddRq(SalesReceiptRequestMsgSet,
                                                      SalesReceiptVM.BuildSalesReceipt(salesreceipt));

                try
                {
                    return(GetQBSalesReceipt(salesreceipt, SalesReceiptRequestMsgSet, SalesReceiptVM));
                }
                catch (COMException ce)
                {
                    // MessageBox.Show("QuickBooks Problem: " + ce.Message);
                    return(new SalesReceiptRet()
                    {
                        Comments = "QuickBooks Problem: " + ce.Message
                    });
                }
            }
            return(new SalesReceiptRet());
        }
Esempio n. 2
0
        public static QBResult AddSalesReceipt(SalesReceipt salesreceipt, string QBCompanyFile)
        {
            var saleXml     = SalesReceiptViewModel.BuildSalesReceiptAddRq(salesreceipt);
            var responseXml = QBPosContext.ProcessXML(saleXml.OuterXml, QBCompanyFile);

            return(GetQBResult(responseXml));
        }
Esempio n. 3
0
        public SalesReceiptRet AddSalesReceipt(SalesReceipt salesreceipt)
        {
            //Create the message set request object to hold our request
            IMsgSetRequest SalesReceiptRequestMsgSet = sessionManager.CreateMsgSetRequest(3, 0);

            SalesReceiptRequestMsgSet.Attributes.OnError = ENRqOnError.roeContinue;
            SalesReceiptViewModel SalesReceiptVM = new SalesReceiptViewModel();

            SalesReceiptVM.BuildSalesReceiptAddRq(SalesReceiptRequestMsgSet,
                                                  SalesReceiptVM.BuildSalesReceipt(salesreceipt));

            try
            {
                return(GetQBSalesReceipt(salesreceipt, SalesReceiptRequestMsgSet, SalesReceiptVM));
            }
            catch (COMException ce)
            {
                MessageBox.Show("Connection to QuickBooks failed, please retry");
                return(null);
            }
        }