Exemplo n.º 1
0
        public static async Task <List <ItemInventoryRet> > GetAllInventoryQuery(string QBCompanyFile)
        {
            int    increment      = 1000;
            int    toItemNumber   = 0;
            int    fromItemNumber = 0;
            string errstring      = null;


            var lst = new List <ItemInventoryRet>();

            while (errstring == null)
            {
                toItemNumber += increment;

                var requestXml = ItemInventoryViewModel.BuildItemInventoryQueryRq(fromItemNumber, toItemNumber);
                fromItemNumber = toItemNumber;
                var res  = QBPosContext.ProcessXML(requestXml.OuterXml, QBCompanyFile);
                var itms = GetQBInventoryItems(res);
                if (!itms.Any())
                {
                    break;
                }
                lst.AddRange(itms);
            }

            return(lst);
        }
Exemplo 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));
        }
Exemplo n.º 3
0
        public static List <CustomerRet> GetAllCustomersQuery(string QBCompanyFile)
        {
            int increment = 1000000;

            double startNumber = 0;
            double endNumber   = 0;
            string errstring   = null;


            var lst = new List <CustomerRet>();

            while (errstring == null)
            {
                endNumber += increment;
                var requestXml = ItemInventoryViewModel.BuildCustomerQueryRq(startNumber.ToString(), endNumber.ToString());
                var res        = QBPosContext.ProcessXML(requestXml.OuterXml, QBCompanyFile);
                var itms       = GetQBCustomers(res);

                lst.AddRange(itms);
                startNumber = endNumber;
                if (startNumber > 9999999)
                {
                    break;
                }
            }



            return(lst);
        }
Exemplo n.º 4
0
        public static List <ItemInventoryRet> GetInventoryItemQuery(string QBCompanyFile, string itemNumber)
        {
            var modxml = ItemInventoryViewModel.BuildModifiedItemInventoryQuery(itemNumber);


            var modres = QBPosContext.ProcessXML(modxml.OuterXml, QBCompanyFile);

            //if(sessionBegun == true)

            var lst = new List <ItemInventoryRet>();

            lst.AddRange(GetQBInventoryItems(modres));

            return(lst.GroupBy(x => x.ListID).Select(grp => grp.First()).ToList());
        }