public IHttpActionResult GetNextItemToProduce(string fields = null)
        {
            try
            {
                List <string> listOfFields = new List <string>();

                if (fields != null)
                {
                    listOfFields = fields.ToLower().Split(',').ToList();
                }

                var nextItemToProduce = _uOW.PRODUCTION.GetNextItemToProduce();

                if (nextItemToProduce == null)
                {
                    return(NotFound());
                }

                return(Ok(_itemMapper.CreateItemDTOFromItem(nextItemToProduce)));
            }
            catch (Exception)
            {
                return(InternalServerError());
            }
        }
Beispiel #2
0
        public IHttpActionResult GetAllItems(string fields = null)
        {
            try
            {
                List <string> listOfFields = new List <string>();

                if (fields != null)
                {
                    listOfFields = fields.ToLower().Split(',').ToList();
                }

                var items = _uOW.ITEMs.GetAllItems();


                return(Ok(items.ToList().Select(i => _itemMapper.CreateItemDTOFromItem(i))));
            }

            catch (Exception)
            {
                return(InternalServerError());
            }
        }