Exemplo n.º 1
0
        public IEnumerable <StorageSiteOverview> GetSitesOverview()
        {
            List <StorageSiteOverview> overview = new List <StorageSiteOverview>();
            var sites = LocationsRepository.GetAllStorageSites();

            foreach (var site in sites)
            {
                overview.Add(new StorageSiteOverview()
                {
                    Site          = site,
                    Temperature   = EnvironmentalDataRepository.GetLatestValue(site, EnvironmentalFactor.Temperature).Value,
                    Humidity      = EnvironmentalDataRepository.GetLatestValue(site, EnvironmentalFactor.Humidity).Value,
                    TotalMaterial = BatchRepository.GetMaterialBatches(null, site.Id).Sum(b => b.Quantity)
                });
            }
            return(overview);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Gets all storage sites.
 /// </summary>
 /// <returns>Returns a list of storage sites.</returns>
 public IEnumerable <StorageSite> GetAllStorageSites()
 {
     return(LocationsRepository.GetAllStorageSites());
 }