Esempio n. 1
0
        public void UpdateInventoryItemSubCategory(InventoryItemSubCategoryDto inventoryItemSubCategoryDto)
        {
            var inventoryItemSubCategory = this.inventoryItemSubCategoryService.GetInventoryItemSubCategory(inventoryItemSubCategoryDto.ID);

            inventoryItemSubCategory.Name                    = inventoryItemSubCategoryDto.Name;
            inventoryItemSubCategory.Description             = inventoryItemSubCategoryDto.Description;
            inventoryItemSubCategory.InventoryItemCategoryID = inventoryItemSubCategoryDto.InventoryItemCategoryID;

            this.inventoryItemSubCategoryService.SaveChanges();
        }
Esempio n. 2
0
        public void AddInventoryItemSubCategory(InventoryItemSubCategoryDto value)
        {
            var inventoryItemSubCategory = new InventoryItemSubCategory();

            inventoryItemSubCategory.Name                    = value.Name;
            inventoryItemSubCategory.Description             = value.Description;
            inventoryItemSubCategory.InventoryItemCategoryID = value.InventoryItemCategoryID;


            this.inventoryItemSubCategoryService.AddInventoryItemSubCategory(inventoryItemSubCategory);
        }
Esempio n. 3
0
        public InventoryItemSubCategoryDto GetInventoryItemSubCategory(int id)
        {
            var inventoryItemSubCategory = this.inventoryItemSubCategoryService.GetInventoryItemSubCategory(id);

            var inventoryItemSubCategoryDto = new InventoryItemSubCategoryDto();

            inventoryItemSubCategoryDto.ID                      = inventoryItemSubCategory.ID;
            inventoryItemSubCategoryDto.Name                    = inventoryItemSubCategory.Name;
            inventoryItemSubCategoryDto.Description             = inventoryItemSubCategory.Description;
            inventoryItemSubCategoryDto.InventoryItemCategoryID = inventoryItemSubCategory.InventoryItemCategoryID;

            var inventoryItemCategories = inventoryItemCategoryService.GetInventoryItemCategories();
            var inventoryItemCategory   = inventoryItemCategories.FirstOrDefault(p => p.ID == inventoryItemSubCategoryDto.ID);

            if (inventoryItemCategory != null)
            {
                inventoryItemSubCategoryDto.CategoryName = inventoryItemCategory.Name;
            }

            return(inventoryItemSubCategoryDto);
        }
Esempio n. 4
0
 public void UpdateInventoryItemSubCategory([FromBody] InventoryItemSubCategoryDto value)
 {
     InventoryItemSubCategoryService.UpdateInventoryItemSubCategory(value);
 }