public static ActionResult DeletePackage(DeletePackageDto deletePackage)
        {
            ActionResult actionResult = new ActionResult();

            try
            {
                PackageInfo package = PackageController.Instance.GetExtensionPackage(Null.NullInteger, p => p.PackageID == deletePackage.Id);
                if (package == null)
                {
                    actionResult.AddError("NotFound", "NotFound");
                    return(actionResult);
                }

                Installer installer = new Installer(package, Globals.ApplicationMapPath);
                installer.UnInstall(deletePackage.DeleteFiles);

                actionResult.IsSuccess = true;
                return(actionResult);
            }
            catch (Exception ex)
            {
                actionResult.HasErrors = true;
                actionResult.AddError("", "", ex);
                return(actionResult);
            }
        }
        internal static List <IUIData> GetData(int PortalID, Dictionary <string, string> Parameters)
        {
            Dictionary <string, IUIData> Settings = new Dictionary <string, IUIData>();
            int pid = 0;

            try
            {
                pid = int.Parse(Parameters["pid"]);
            }
            catch { }

            PackageSettingsDto packageSettings = new PackageSettingsDto
            {
                PortalId = PortalID
            };
            DeletePackageDto deletePackage = new DeletePackageDto();
            PackageInfo      package       = PackageController.Instance.GetExtensionPackage(Null.NullInteger, p => p.PackageID == pid);

            if (package != null)
            {
                Dnn.PersonaBar.Extensions.Components.Editors.IPackageEditor packageEditor = PackageEditorFactory.GetPackageEditor(package.PackageType);
                PackageInfoDto packageDetail = packageEditor?.GetPackageDetail(PortalID, package) ?? new PackageInfoDto(PortalID, package);
                Settings.Add("packageDetail", new UIData {
                    Name = "packageDetail", Options = packageDetail
                });
                packageSettings.PackageId = packageDetail.PackageId;
                deletePackage.Id          = packageDetail.PackageId;
            }
            Settings.Add("packageSettings", new UIData {
                Name = "packageSettings", Options = packageSettings
            });
            Settings.Add("deletePackage", new UIData {
                Name = "deletePackage", Options = deletePackage
            });
            return(Settings.Values.ToList());
        }
 public ActionResult DeletePackage(DeletePackageDto deletePackage)
 {
     return(Managers.ExtensionsManager.DeletePackage(deletePackage));
 }