Пример #1
0
        public static List <Service> GetServices()
        {
            var sp = new DomainServices.Services.ServiceProvider(context);

            var services = sp.GetAllServices().OrderBy(x => x.Code).ToList();

            var items = new List <Service>();

            foreach (var service in services)
            {
                items.Add(new Service()
                {
                    ID   = service.ID,
                    Code = service.Code,
                    Name = service.Name
                });
            }

            return(items);
        }
Пример #2
0
        public LocationsAndServicesResponse GetLocationsAndServices(int caseID, int providerID, DateTime date)
        {
            var c               = _context.Cases.Find(caseID);
            var provider        = _context.Providers.Find(providerID);
            var domainLocations = _context.ServiceLocations.ToList();
            var localLocations  = new List <Location>();

            var sp       = new DomainServices.Services.ServiceProvider(_context);
            var services = sp.GetServices(c, provider, date);

            var response = new LocationsAndServicesResponse
            {
                Services = new List <Service>()
            };

            // the api expects locations per-service, but the system tracks them as a standalone
            // create a list of mapped locations that we can apply to each api service object
            foreach (var loc in domainLocations)
            {
                localLocations.Add(new Location()
                {
                    ID          = loc.ID,
                    Description = loc.Name
                });
            }

            foreach (var service in services)
            {
                response.Services.Add(new Service()
                {
                    ID          = service.ID,
                    Description = service.Name,
                    Locations   = localLocations,
                });
            }

            return(response);
        }
        public int[] GetAssessmentIDs()
        {
            var sp = new DomainServices.Services.ServiceProvider(_context);

            return(sp.GetServicesByType(Domain2.Services.ServiceTypes.Assessment).Select(x => x.ID).ToArray());
        }
Пример #4
0
        public static List <Service> GetServices(ProviderTypeIDs typeID)
        {
            var sp = new DomainServices.Services.ServiceProvider(_context);

            return(sp.GetLegacyServicesByProviderType(typeID));
        }