Esempio n. 1
0
        public static string ToString(ProductCategoryEnum val)
        {
            switch (val)
            {
            case ProductCategoryEnum.ClothingShoesAccessories:
            {
                return("Одежда, обувь, аксессуары");
            }

            case ProductCategoryEnum.ChildrenClothingAndShoes:
            {
                return("Детская одежда и обувь");
            }

            case ProductCategoryEnum.ProductsForChildrenAndToys:
            {
                return("Товары для детей и игрушки");
            }

            case ProductCategoryEnum.WatchesAndJewelry:
            {
                return("Часы и украшения");
            }

            case ProductCategoryEnum.BeautyAndHealth:
            {
                return("Красота и здоровье");
            }

            default:
            {
                throw new BusinessLogicException(ExceptionCodes.FORBIDDEN);
            }
            }
        }
Esempio n. 2
0
        public static int GetTypeId(ProductCategoryEnum val)
        {
            switch (val)
            {
            case ProductCategoryEnum.ClothingShoesAccessories:
            {
                return((int)ProductTypeEnum.PersonalThing);
            }

            case ProductCategoryEnum.ChildrenClothingAndShoes:
            {
                return((int)ProductTypeEnum.PersonalThing);
            }

            case ProductCategoryEnum.ProductsForChildrenAndToys:
            {
                return((int)ProductTypeEnum.PersonalThing);
            }

            case ProductCategoryEnum.WatchesAndJewelry:
            {
                return((int)ProductTypeEnum.PersonalThing);
            }

            case ProductCategoryEnum.BeautyAndHealth:
            {
                return((int)ProductTypeEnum.PersonalThing);
            }

            default:
            {
                throw new BusinessLogicException(ExceptionCodes.FORBIDDEN);
            }
            }
        }
        private Product createProduct
            (int pID, string pName, decimal pShelfPrice, bool pIsImported = false, ProductCategoryEnum pType = ProductCategoryEnum.Other)
        {
            var product = new Product(pID, pName, pShelfPrice)
            {
                ProductType = pType, IsImported = pIsImported
            };

            return(product);
        }
Esempio n. 4
0
        private static Product createProduct
            (string pName, decimal pShelfPrice, bool pIsImported = false, ProductCategoryEnum pType = ProductCategoryEnum.Other)
        {
            var product = new Product(getNextProductID(), pName, pShelfPrice)
            {
                ProductType = pType, IsImported = pIsImported
            };

            return(product);
        }
Esempio n. 5
0
 public Percentage GetApplicableTaxRateForProduct(ProductCategoryEnum pProductCategory, bool pIsImported)
 {
     return(GetApplicableTaxRateForProduct(IsProductCategoryExemptFromBaseTax(pProductCategory), pIsImported));
 }
Esempio n. 6
0
 public bool IsProductCategoryExemptFromBaseTax(ProductCategoryEnum pProductCategory)
 {
     return(Array.IndexOf(GetExemptCategories(), pProductCategory) != -1);
 }