public void UpdateItemCategory(ItemCategoryDTO itemCategoryDTO) { ItemCategory itemCategory = new ItemCategory(); ItemConvertor.ConvertToItemCategoryEntity(ref itemCategory, itemCategoryDTO, true); unitOfWork.ItemRepository.Update(itemCategory); }
public void AddItemCategory(ItemCategoryDTO itemDTO) { ItemCategory itemCategory = new ItemCategory(); ItemConvertor.ConvertToItemCategoryEntity(ref itemCategory, itemDTO, false); unitOfWork.ItemRepository.Add(itemCategory); }
public ItemCategoryDTO GetItemCategoryById(int itemId) { ItemCategoryDTO itemCategoryDTO = null; var itemCategory = unitOfWork.ItemRepository.GetById(itemId); if (itemCategory != null) { itemCategoryDTO = ItemConvertor.ConvertToItemCategoryDto(itemCategory); } return(itemCategoryDTO); }
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); }