Exemple #1
0
        public void UpdateItemCategory(ItemCategoryDTO itemCategoryDTO)
        {
            ItemCategory itemCategory = new ItemCategory();

            ItemConvertor.ConvertToItemCategoryEntity(ref itemCategory, itemCategoryDTO, true);
            unitOfWork.ItemRepository.Update(itemCategory);
        }
Exemple #2
0
        public void AddItemCategory(ItemCategoryDTO itemDTO)
        {
            ItemCategory itemCategory = new ItemCategory();

            ItemConvertor.ConvertToItemCategoryEntity(ref itemCategory, itemDTO, false);
            unitOfWork.ItemRepository.Add(itemCategory);
        }
Exemple #3
0
        public ItemCategoryDTO GetItemCategoryById(int itemId)
        {
            ItemCategoryDTO itemCategoryDTO = null;
            var             itemCategory    = unitOfWork.ItemRepository.GetById(itemId);

            if (itemCategory != null)
            {
                itemCategoryDTO = ItemConvertor.ConvertToItemCategoryDto(itemCategory);
            }
            return(itemCategoryDTO);
        }
Exemple #4
0
        public List <ItemCategoryDTO> GetAllItemCategory()
        {
            List <ItemCategoryDTO> itemCategoryList = new List <ItemCategoryDTO>();
            var itemCategories = unitOfWork.ItemRepository.GetAll();

            if (itemCategories != null)
            {
                foreach (var itemCategory in itemCategories)
                {
                    itemCategoryList.Add(ItemConvertor.ConvertToItemCategoryDto(itemCategory));
                }
            }

            return(itemCategoryList);
        }