Ejemplo n.º 1
0
        public async Task UpdateAsync(Models.Item type)
        {
            var itemDL = new DataLogic.Models.ItemDL()
            {
                ItemId      = type.ItemId,
                Name        = type.Name,
                Description = type.Description,
                ShelfLife   = type.ShelfLife,
                BuyPrice    = type.BuyPrice,
                SellPrice   = type.SellPrice
            };

            await _itemRepository.UpdateAsync(itemDL);
        }
Ejemplo n.º 2
0
        public async Task <Models.Item> InsertAsync(Models.Item item)
        {
            var itemDL = new DataLogic.Models.ItemDL()
            {
                ItemId      = Guid.NewGuid(),
                Name        = item.Name,
                Description = item.Description,
                ShelfLife   = item.ShelfLife,
                BuyPrice    = item.BuyPrice,
                SellPrice   = item.SellPrice
            };

            var retVal = await _itemRepository.InsertAsync(itemDL);

            return(new Models.Item()
            {
                ItemId = retVal.ItemId,
                Name = retVal.Name,
                Description = retVal.Description,
                ShelfLife = retVal.ShelfLife,
                BuyPrice = retVal.BuyPrice,
                SellPrice = retVal.SellPrice
            });
        }