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(); }
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); }
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); }
public void UpdateInventoryItemSubCategory([FromBody] InventoryItemSubCategoryDto value) { InventoryItemSubCategoryService.UpdateInventoryItemSubCategory(value); }