public Load ( ) : BVNetwork.NotFound.Core.CustomRedirects.CustomRedirectCollection | ||
return | BVNetwork.NotFound.Core.CustomRedirects.CustomRedirectCollection |
public FileUploadJsonResult ImportRedirects(HttpPostedFileBase xmlfile) { CheckAccess(); // Read all redirects from xml file RedirectsXmlParser parser = new RedirectsXmlParser(xmlfile.InputStream); // Save all redirects from xml file CustomRedirectCollection redirects = parser.Load(); string message; if (redirects != null || redirects.Count != 0) { CustomRedirectHandler.Current.SaveCustomRedirects(redirects); message = string.Format(LocalizationService.Current.GetString("/gadget/redirects/importsuccess"), redirects.Count); } else { message = LocalizationService.Current.GetString("/gadget/redirects/importnone"); } return new FileUploadJsonResult { Data = new { message = message } }; }