Beispiel #1
0
        /// <summary>
        /// Registra l'arrivo di un nuovo carico di gemme
        /// </summary>
        /// <returns></returns>
        //public bool Post()
        //{
        //    try
        //    {
        //        if (manager == null)
        //            manager = new GemInventoryManager();
        //        manager.StoreNewGems();
        //    }
        //    catch (Exception ex)
        //    {
        //        throw ex;
        //    }
        //    return true;
        //}

        /// <summary>
        /// Vende (rimuovendola dall'inventario) una singola gemma
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool Post([FromBody] Models.GemBuy gem)
        {
            try
            {
                if (manager == null)
                {
                    manager = new GemInventoryManager();
                }
                return(manager.SellSingleGem(gem.id));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #2
0
        public bool Post([FromBody] string name)
        {
            bool retVal = false;

            try
            {
                if (manager == null)
                {
                    manager = new GemInventoryManager();
                }

                retVal = manager.SellSingleGem(name);
                return(retVal);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }