public List <IntershopWebService.ProductStock> GetItemsStock(List <IntershopWebService.ProductStockIn> products, string company)
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            MessageLogger.info(string.Format("GetItemsStock(count={0}, company={1})", (object)products.Count, (object)company));
            Axapta axapta = (Axapta)null;
            List <IntershopWebService.ProductStock> productStockList = new List <IntershopWebService.ProductStock>();

            try
            {
                axapta = this.axLogon(company);
                foreach (IntershopWebService.ProductStockIn product in products)
                {
                    string str = Convert.ToString(axapta.CallStaticClassMethod("BTX_ISHItemDescriptionProxy", "GetOnHandUrl", (object)product.itemId, (object)string.Empty));
                    IntershopWebService.ProductStock productStock = new IntershopWebService.ProductStock();
                    productStock.itemId     = product.itemId;
                    productStock.stockLevel = str;
                    productStockList.Add(productStock);
                    stopwatch.Stop();
                    MessageLogger.info(string.Format("GetItemsStock({0}, {1}, {2}, {3}) -> {4} , exec time -> {5} ms", (object)product.itemId, (object)product.size, (object)product.color, (object)company, (object)productStock.stockLevel, (object)stopwatch.ElapsedMilliseconds));
                }
                return(productStockList);
            }
            catch (Exception ex)
            {
                return((List <IntershopWebService.ProductStock>)null);
            }
            finally
            {
                axapta.Logoff();
            }
        }
        public List <IntershopWebService.ProductStock> GetItemsStockSize(List <IntershopWebService.ProductStockIn> products, string company)
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();

            if (products.Count == 1)
            {
                MessageLogger.info(string.Format("GetItemsStockSize(itemId={0}, company={1})", products[0].itemId, company));
            }
            else
            {
                MessageLogger.info(string.Format("GetItemsStockSize(count={0}, company={1})", products.Count, company));
            }

            Axapta axapta = (Axapta)null;
            List <IntershopWebService.ProductStock> productStockList = new List <IntershopWebService.ProductStock>();

            try
            {
                axapta = this.axLogon(company);
                foreach (IntershopWebService.ProductStockIn product in products)
                {
                    IntershopWebService.ProductStockIn productIn    = product;
                    IntershopWebService.ProductStock   productStock = new IntershopWebService.ProductStock();
                    productStock.itemId = productIn.itemId;
                    string str1 = string.Empty;
                    productIn.size  = this.normalizeXmlString(productIn.size);
                    productIn.color = this.normalizeXmlString(productIn.color);
                    List <IntershopWebService.SizeStock> itemDims = this.getItemDims(productIn.itemId, company);
                    if (itemDims.Count > 0 && (!string.IsNullOrEmpty(productIn.size) || !string.IsNullOrEmpty(productIn.color)))
                    {
                        if (itemDims.FindIndex((Predicate <IntershopWebService.SizeStock>)(f => f.size == productIn.size)) >= 0)
                        {
                            str1 = productIn.size;
                        }
                        if (itemDims.FindIndex((Predicate <IntershopWebService.SizeStock>)(f => f.color == productIn.color)) >= 0)
                        {
                            str1 = productIn.color;
                        }
                    }
                    string str2 = Convert.ToString(axapta.CallStaticClassMethod("BTX_ISHItemDescriptionProxy", "GetOnHandUrl", (object)productIn.itemId, (object)str1));
                    productStock.stockLevel = str2;
                    productStockList.Add(productStock);
                    stopwatch.Stop();
                    MessageLogger.info(string.Format("GetItemsStockSize({0}, {1}, {2}, {3}) -> {4}, exec time: {5} ms", (object)productIn.itemId, (object)productIn.size, (object)productIn.color, (object)company, (object)productStock.stockLevel, (object)stopwatch.ElapsedMilliseconds));
                }
                return(productStockList);
            }
            catch (Exception ex)
            {
                if (products.Count == 1)
                {
                    MessageLogger.info(string.Format("GetItemsPriceSize(itemId={0}, company={1}) -> error: {2}", products[0].itemId, company, ex.Message));
                }
                else
                {
                    MessageLogger.info(string.Format("GetItemsPriceSize(count={0}, company={1}) -> error: {2}", products.Count, company, ex.Message));
                }

                MessageLogger.info(string.Format("Stack trace: {0}", ex.StackTrace.ToString()));

                return((List <IntershopWebService.ProductStock>)null);
            }
            finally
            {
                axapta.Logoff();
            }
        }