public ClientCertificatesForUserViewModel(IClientCertificatesRepository clientCertificatesRepository, IUserManagementRepository userManagementRepository, string username)
        {
            this.clientCertificatesRepository = clientCertificatesRepository;
            this.userManagementRepository     = userManagementRepository;
            var allnames =
                userManagementRepository.GetUsers()
                .Select(x => new SelectListItem
            {
                Text = x
            }).ToList();

            allnames.Insert(0, new SelectListItem {
                Text = "-Choose-", Value = ""
            });
            this.AllUserNames = allnames;

            this.UserName  = username;
            NewCertificate = new ClientCertificate {
                UserName = username
            };
            if (!IsNew)
            {
                var certs =
                    this.clientCertificatesRepository
                    .GetClientCertificatesForUser(this.UserName)
                    .ToArray();
                this.Certificates = certs;
            }
            else
            {
                this.Certificates = new ClientCertificate[0];
            }
        }
 public ClientCertificatesForUserViewModel(IClientCertificatesRepository clientCertificatesRepository, IUserManagementRepository userManagementRepository, string username)
 {
     this.clientCertificatesRepository = clientCertificatesRepository;
     this.userManagementRepository = userManagementRepository;
     var allnames =
         userManagementRepository.GetUsers()
         .Select(x => new SelectListItem
         {
             Text = x
         }).ToList();
     allnames.Insert(0, new SelectListItem { Text = "-Choose-", Value = "" });
     this.AllUserNames = allnames;
     
     this.UserName = username;
     NewCertificate = new ClientCertificate { UserName = username };
     if (!IsNew)
     {
         var certs =
                 this.clientCertificatesRepository
                 .GetClientCertificatesForUser(this.UserName)
                     .ToArray();
         this.Certificates = certs;
     }
     else
     {
         this.Certificates = new ClientCertificate[0];
     }
 }
 public ClientCertificatesViewModel(IClientCertificatesRepository clientCertificatesRepository)
 {
     this.clientCertificatesRepository = clientCertificatesRepository;
     this.Users =
         clientCertificatesRepository.List(-1, -1)
         .Select(x => new ClientCertificateUserInputModel
         {
             Username = x
         }).ToArray();
 }
 public ClientCertificatesViewModel(IClientCertificatesRepository clientCertificatesRepository)
 {
     this.clientCertificatesRepository = clientCertificatesRepository;
     this.Users =
         clientCertificatesRepository.List(-1, -1)
         .Select(x => new ClientCertificateUserInputModel
     {
         Username = x
     }).ToArray();
 }
 public ClientCertificatesAdminController(IClientCertificatesRepository repository)
 {
     Repository = repository;
 }
Exemplo n.º 6
0
 public ClientCertificateController(IClientCertificatesRepository clientCertificatesRepository, IUserManagementRepository userManagementRepository)
 {
     this.clientCertificatesRepository = clientCertificatesRepository;
     this.userManagementRepository     = userManagementRepository;
 }
 public TableStorageUserRepository(string storageConnectionString, IClientCertificatesRepository repository)
     : this(storageConnectionString)
 {
     ClientCertificateRepository = repository;
 }
 public ClientCertificateController(IClientCertificatesRepository clientCertificatesRepository, IUserManagementRepository userManagementRepository)
 {
     this.clientCertificatesRepository = clientCertificatesRepository;
     this.userManagementRepository = userManagementRepository;
 }
 public ClientCertificatesController(IClientCertificatesRepository clientCertificatesRespository)
 {
     _clientCertificatesRepository = clientCertificatesRespository;
 }
 public TableStorageUserRepository(string storageConnectionString, IClientCertificatesRepository repository)
     : this(storageConnectionString)
 {
     ClientCertificateRepository = repository;
 }
 public ClientCertificatesAdminController(IClientCertificatesRepository repository)
 {
     Repository = repository;
 }