public ReturnValueModel CreateNewItem(ItemViewModel newItem, int userId)
        {
            var rv = new ReturnValueModel();

            newItem.LifeSpan = newItem.LifeSpan == 0 ? 5 : newItem.LifeSpan;

            var newItemId = itemRepostory.Insert(newItem, userId);


            var catRepo     = new ItemTypeRepository();
            var itemType    = catRepo.QueryItemType(newItem.TypeId);
            var itemSubtype = catSubRepository.QuerySubTypeById(newItem.SubTypeId);


            var assetTag = GenerateAssetTag(itemType.Name, itemSubtype.Name, newItemId);

            rv.Success = itemRepostory.AttachAssetTag(newItemId, assetTag);
            if (rv.Success)
            {
                rv.Param1 = newItemId.ToString();
                rv.Param2 = assetTag;
            }

            return(rv);
        }
 public ItemSubTypeViewModel GetSubTypeById(int id)
 {
     return(subTypeRepository.QuerySubTypeById(id));
 }