public AdminHomeViewModel New()
 {
     return(new AdminHomeViewModel
     {
         ApplicationCount = licenceRepository.GetAllApplications().Count(),
         LicenceCount = licenceRepository.GetAllLicences().Count()
     });
 }
Beispiel #2
0
 public PublicRegisterLicenceListViewModel BuildAllLicences()
 {
     return(new PublicRegisterLicenceListViewModel
     {
         //We only want licences with status that are allowed to be shown using the "ShowInPublicRegister" field.
         Licences = _licenceRepository.GetAllLicences().Select(BuildSummary),
         PublicRegisterSearchCriteria = BuildPublicRegisterSearchViewModel(),
         AvailableCountries = BuildAvailableCountries()
     });
 }
 public AdminLicenceListViewModel Build(LicenceOrApplication type)
 {
     return(type == LicenceOrApplication.Application
         ? new AdminLicenceListViewModel
     {
         Title = "Applications",
         Licences = licenceRepository.GetAllApplications().Select(BuildSummary)
     }
         : new AdminLicenceListViewModel
     {
         Title = "Licences",
         Licences = licenceRepository.GetAllLicences().Select(BuildSummary)
     });
 }