Exemplo n.º 1
0
        public List <ApiBatch> GetList()
        {
            string          id             = User.Identity.Name;
            IBatchManager   batchManager   = UnityResolver.Resolve <IBatchManager>();
            List <Batch>    batchModelList = batchManager.GetAllBatches();
            List <ApiBatch> batchList      = new List <ApiBatch>();

            foreach (Batch batchModel in batchModelList)
            {
                ApiBatch batch = new ApiBatch
                {
                    ID         = batchModel.ID,
                    Date       = batchModel.Date,
                    Qty        = batchModel.Qty,
                    UnitPrice  = batchModel.UnitPrice,
                    ItemID     = batchModel.ItemID,
                    SupplierID = batchModel.SupplierID
                };

                batchList.Add(batch);
            }

            return(batchList);
        }