protected void OnChangeProviderStatus(object sender, EventArgs e)
        {
            var checkbox   = (sender as CheckBox);
            var providerId = Convert.ToInt32((checkbox.Parent.FindControl("urlProviderId") as HiddenField).Value);

            if (checkbox.Checked)
            {
                ExtensionUrlProviderController.EnableProvider(providerId, ModuleContext.PortalId);
            }
            else
            {
                ExtensionUrlProviderController.DisableProvider(providerId, ModuleContext.PortalId);
            }
        }
示例#2
0
 public HttpResponseMessage UpdateExtensionUrlProviderStatus(UpdateExtensionUrlProviderStatusRequest request)
 {
     try
     {
         if (request.IsActive)
         {
             ExtensionUrlProviderController.EnableProvider(request.ProviderId, this.PortalId);
         }
         else
         {
             ExtensionUrlProviderController.DisableProvider(request.ProviderId, this.PortalId);
         }
         return(this.Request.CreateResponse(HttpStatusCode.OK, new { Success = true }));
     }
     catch (Exception exc)
     {
         Logger.Error(exc);
         return(this.Request.CreateErrorResponse(HttpStatusCode.InternalServerError, exc));
     }
 }