public DepotDTO GetById(int id)
        {
            var depot = depots.GetById(id)?.ToDTO();

            AddCountryToDepot(depot);

            return(depot);
        }
Esempio n. 2
0
        DepotPivot IDepotService.GetDepotPivot(long id)

        {
            var        item        = depotRepository.GetById((int)id);
            DepotPivot depotsPivot = Mapper.Map <GES_Depot, DepotPivot>(item);

            return(depotsPivot);
        }
Esempio n. 3
0
        public List <DrugType> GetAssociatedDrugTypes(int id)
        {
            List <DrugType> result = new List <DrugType>();

            Depot depot = _depotRepository.GetById(id);

            depot.DrugUnits.ForEach(drugUnit =>
            {
                if (result.Count > 0 && !result.Any(r => r.DrugTypeID == drugUnit.DrugType.DrugTypeID))
                {
                    result.Add(drugUnit.DrugType);
                }
                if (result.Count == 0)
                {
                    result.Add(drugUnit.DrugType);
                }
            });

            return(result);
        }