Beispiel #1
0
 public UserController(IUserRepository repository, ILoginRepository loginRepository,
                       ISubscriptionRepository subscriptionRepository, AuthTokenHandler authTokenHandler,
                       ISubscriptionTypeRepository subscriptionTypeRepository)
 {
     Repository                      = repository;
     this.loginRepository            = loginRepository;
     SubscriptionRepository          = subscriptionRepository;
     AuthTokenHandler                = authTokenHandler;
     this.subscriptionTypeRepository = subscriptionTypeRepository;
 }
        public bool SendWorkstation()
        {
            Uri  urlWorkstation = new Uri(ConfigurationManager.AppSettings["workstation-persister"]);
            bool ret            = false;

            if (_ws != null)
            {
                //Get Token
                var token = new AuthTokenHandler().GetAuthToken();
                if (token != null && token.Authenticated)
                {
                    //Send Workstation
                    ret = SendPostAPI(token, urlWorkstation);
                }
            }
            return(ret);
        }
        public bool SendWorkstationSoftware()
        {
            Uri    urlHardware = new Uri(ConfigurationManager.AppSettings["workstation-persister"]);
            string clientId    = "";//ConfigurationManager.AppSettings["client-id"];

            bool ret = false;

            if (_listSftw != null)
            {
                clientId = _listSftw[0].workStation;
                //Get Token
                var token = new AuthTokenHandler().GetAuthToken();
                if (token != null && token.Authenticated)
                {
                    //Send Workstation
                    ret = SendPostAPI(token, urlHardware);
                }
            }
            return(ret);
        }