public static string DeletePortal(PortalInfo portal, string serverPath) { string strPortalName; string strMessage = string.Empty; int portalCount = DataProvider.Instance().GetPortalCount(); if (portalCount > 1) { if (portal != null) { Globals.DeleteFilesRecursive(serverPath, ".Portal-" + portal.PortalID.ToString() + ".resx"); PortalAliasController objPortalAliasController = new PortalAliasController(); ArrayList arr = objPortalAliasController.GetPortalAliasArrayByPortalID(portal.PortalID); if (arr.Count > 0) { PortalAliasInfo objPortalAliasInfo = (PortalAliasInfo)arr[0]; strPortalName = Globals.GetPortalDomainName(objPortalAliasInfo.HTTPAlias, null, true); if (objPortalAliasInfo.HTTPAlias.IndexOf("/") > -1) { strPortalName = objPortalAliasInfo.HTTPAlias.Substring(objPortalAliasInfo.HTTPAlias.LastIndexOf("/") + 1); } if (!String.IsNullOrEmpty(strPortalName) && System.IO.Directory.Exists(serverPath + strPortalName)) { Globals.DeleteFolderRecursive(serverPath + strPortalName); } } Globals.DeleteFolderRecursive(serverPath + "Portals\\" + portal.PortalID.ToString()); if (!string.IsNullOrEmpty(portal.HomeDirectory)) { string HomeDirectory = portal.HomeDirectoryMapPath; if (System.IO.Directory.Exists(HomeDirectory)) { Globals.DeleteFolderRecursive(HomeDirectory); } } PortalController objPortalController = new PortalController(); objPortalController.DeletePortalInfo(portal.PortalID); } } else { strMessage = Localization.GetString("LastPortal"); } return strMessage; }