public ActionResult IndexPOST()
        {
            if (!_orchardServices.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not allowed to migrate Contrib.Taxonomies.")))
            {
                return(new HttpUnauthorizedResult());
            }
            try {
                _upgradeService.CopyTable("Contrib_Taxonomies_TaxonomyPartRecord", "Orchard_Taxonomies_TaxonomyPartRecord", new string[0]);
                _upgradeService.CopyTable("Contrib_Taxonomies_TermContentItem", "Orchard_Taxonomies_TermContentItem", new[] { "Id" });
                _upgradeService.CopyTable("Contrib_Taxonomies_TermPartRecord", "Orchard_Taxonomies_TermPartRecord", new string[0]);
                _upgradeService.CopyTable("Contrib_Taxonomies_TermsPartRecord", "Orchard_Taxonomies_TermsPartRecord", new string[0]);

                _orchardServices.Notifier.Information(T("Taxonomies were migrated successfully."));
            }
            catch (Exception e) {
                Logger.Error(e, "Unexpected error while migrating to Orchard.Taxonomies. Please check the log.");
                _orchardServices.Notifier.Error(T("Unexpected error while migrating to Orchard.Taxonomies. Please check the log."));
            }

            return(RedirectToAction("Index"));
        }
예제 #2
0
        public ActionResult IndexPOST()
        {
            if (!_orchardServices.Authorizer.Authorize(StandardPermissions.SiteOwner, T("Not allowed to migrate Orchard.ContentPicker.")))
            {
                return(new HttpUnauthorizedResult());
            }

            try {
                _upgradeService.ExecuteReader("DELETE FROM " + _upgradeService.GetPrefixedTableName("Orchard_ContentPicker_ContentMenuItemPartRecord"), null);
                _upgradeService.CopyTable("Navigation_ContentMenuItemPartRecord", "Orchard_ContentPicker_ContentMenuItemPartRecord", new string[0]);

                _orchardServices.Notifier.Information(T("Content Picker menu items were migrated successfully."));
            }
            catch (Exception e) {
                Logger.Error(e, "Unexpected error while migrating to Orchard.ContentPicker. Please check the log.");
                _orchardServices.Notifier.Error(T("Unexpected error while migrating to Orchard.ContentPicker. Please check the log."));
            }

            return(RedirectToAction("Index"));
        }