//Method for getting provider numbers for hotlines /// <summary> /// Returns providers that include a helpline , that is not 911 /// </summary> /// <returns>Return crisis contact providers</returns> public List <HotLineProviderViewModel> GetHotlines() { var hotLineProviders = new List <HotLineProviderViewModel>(); var accessData = new ServiceProviderRepo(); var serviceProviders = accessData.GetAllActiveServiceProviders(); foreach (ServiceProvider t in serviceProviders) { foreach (var location in t.Locations) { if (location.Display && location.Contact.HelpLine != null && location.Contact.HelpLine.Trim() != "911") { var hotLineProvider = new HotLineProviderViewModel { ProviderName = t.ProviderName, CrisisNumber = location.Contact.HelpLine, ProviderLocation = location.Name }; hotLineProviders.Add(hotLineProvider); } } } return(hotLineProviders); }
/// <summary> /// Gets the count of service providers for the given search fields /// </summary> /// <param name="searchText">The search text by provider name</param> /// <param name="countyId">County to search within </param> /// <param name="categoryId">Category id to search for</param> /// <returns></returns> public int GetServiceProvidersCount(string searchText, int?countyId, int?categoryId) { if (searchText == "") { searchText = null; } var serviceProviderRepo = new ServiceProviderRepo(); return(serviceProviderRepo.GetAllServiceProvidersByNameCount(searchText, countyId, categoryId)); }