/// <summary> /// UniGrid actions. /// </summary> protected void Control_OnAction(string actionName, object actionArgument) { if (actionName == "delete") { int aliasId = ValidationHelper.GetInteger(actionArgument, 0); SiteDomainAliasInfoProvider.DeleteSiteDomainAliasInfo(aliasId); } }
/// <summary> /// Deletes site domain alias. Called when the "Delete alias" button is pressed. /// Expects the CreateSiteDomainAlias method to be run first. /// </summary> private bool DeleteSiteDomainAlias() { // Get the site domain alias SiteDomainAliasInfo deleteAlias = SiteDomainAliasInfoProvider.GetSiteDomainAliasInfo("127.0.0.1", CMSContext.CurrentSiteID); // Delete the site domain alias SiteDomainAliasInfoProvider.DeleteSiteDomainAliasInfo(deleteAlias); return(deleteAlias != null); }
/// <summary> /// UniGrid actions. /// </summary> protected void UniGridAliases_OnAction(string actionName, object actionArgument) { if (actionName == "edit") { URLHelper.Redirect("Site_Edit_DomainAlias_Edit.aspx?siteId=" + siteId.ToString() + "&domainAliasId=" + actionArgument.ToString()); } else if (actionName == "delete") { int aliasId = ValidationHelper.GetInteger(actionArgument, 0); SiteDomainAliasInfoProvider.DeleteSiteDomainAliasInfo(aliasId); UniGridAliases.ReloadData(); } }
/// <inheritdoc/> public void RemoveSiteDomainAlias(ISite site, string aliasName) { // Gets the site object SiteInfo siteToWork = SiteInfoProvider.GetSiteInfo(site.SiteName); if (siteToWork != null) { // Gets the specified domain alias for the site SiteDomainAliasInfo deleteAlias = SiteDomainAliasInfoProvider.GetSiteDomainAliasInfo(aliasName, siteToWork.SiteID); // Deletes the site domain alias SiteDomainAliasInfoProvider.DeleteSiteDomainAliasInfo(deleteAlias); } }
/// <summary> /// Deletes site domain alias. Called when the "Delete alias" button is pressed. /// Expects the CreateSiteDomainAlias method to be run first. /// </summary> private bool DeleteSiteDomainAlias() { // Get the site object SiteInfo site = SiteInfoProvider.GetSiteInfo("MyNewSite"); if (site != null) { // Get the site domain alias SiteDomainAliasInfo deleteAlias = SiteDomainAliasInfoProvider.GetSiteDomainAliasInfo("127.0.0.1", site.SiteID); // Delete the site domain alias SiteDomainAliasInfoProvider.DeleteSiteDomainAliasInfo(deleteAlias); return(deleteAlias != null); } return(false); }