Beispiel #1
0
        private string FindSimilarCategoriesByName(string value)
        {
            string similarProduct = "";

            string[] caetgories = _storeLogic.GetAllCategorysNames();
            foreach (var category in caetgories)
            {
                if (MarketMistakeService.IsSimilar(value, category))
                {
                    similarProduct = category;
                }
            }

            return(similarProduct);
        }
        public void GetAllCategoryNames()
        {
            try
            {
                _shopper.ValidateCanBrowseMarket();
                MarketLog.Log("StoreCenter", "User has enetered the system!");
                string[] categories = _storeLogic.GetAllCategorysNames();
                Answer = new StoreAnswer(GetCategoriesStatus.Success, "All categories names have been granted!", categories);
            }
            catch (StoreException e)
            {
                MarketLog.Log("StoreCenter", "");
                Answer = new StoreAnswer((GetCategoriesStatus)e.Status, e.GetErrorMessage());
            }

            catch (DataException e)
            {
                Answer = new StoreAnswer((StoreEnum)e.Status, e.GetErrorMessage());
            }

            catch (MarketException)
            {
                MarketLog.Log("StoreCenter", "no premission");
                Answer = new StoreAnswer(GetCategoriesStatus.DidntEnterSystem,
                                         "User didn't enter the system!");
            }
        }