public ActionResult ApiClient_Update2(int apiClientId)
        {
            var client = _apiClientBusiness.GetApiClient(apiClientId);


            var apiClientModel = new ApiClientModel
            {
                ApiClientId              = client.ApiClientId,
                Name                     = client.Name,
                Key                      = client.Key,
                Secret                   = client.Secret,
                SecretIsHashed           = client.SecretIsHashed,
                ApplicationApplicationId = client.ApplicationApplicationId,
                SecretDisplay            = client.SecretDisplay
            };

            return(PartialView("_ApiClient", apiClientModel));
        }
예제 #2
0
        public ActionResult ResetSecret(int id)
        {
            var client = _apiClientBusiness.GetApiClient(id);
            var model  = new ChangeSecretModel {
                ApiClientId = client.ApiClientId, Key = client.Key, Secret = Guid.NewGuid().ToString()
            };

            return(PartialView("_ResetSecret", model));
        }
        public void Unsubscribe(string wamsId, int edOrgId, int apiClientId)
        {
            var apiClient = _apiClientBusiness.GetApiClient(apiClientId);
            var vendorId  = apiClient?.Application?.VendorVendorId;

            if (!vendorId.HasValue)
            {
                return;
            }

            _adminDbContext.Subscriptions.Add(new Subscription
            {
                EducationOrganizationId = edOrgId,
                SubscriptionActionId    = (int)SubscriptionActionEnum.Unsubscribe,
                VendorId    = vendorId.Value,
                WamsId      = wamsId,
                CreatedDate = DateTime.Now
            });
            _adminDbContext.SaveChanges(wamsId);

            _apiClientBusiness.TryDestroy(wamsId, apiClientId);
        }