private bool NavHandler(string args) { Guid noteID = Guid.Parse(args.Split(':')[1]); try { PXEntitySearch search = new PXEntitySearch(); search.Redirect(noteID); } catch (PXRedirectRequiredException ex) { string url = PX.Web.UI.PXDataSource.getMainForm(ex.Graph.GetType()); if (url != null) { ex.Graph.Unload(); PXContext.Session.RedirectGraphType[PXUrl.ToAbsoluteUrl(url)] = ex.Graph.GetType(); throw new PXRedirectRequiredException(url, ex.Graph, "Redirect0:" + this.ResolveUrl/**/ (url)); } } return(false); } private bool NavHandlerFiles(string args) { try { String FileName = args.Split(':')[1]; WikiFileMaintenance graph = PXGraph.CreateInstance <WikiFileMaintenance>(); UploadFileWithIDSelector cur = PXSelect <UploadFileWithIDSelector, Where <UploadFileWithIDSelector.name, Equal <Required <UploadFileWithIDSelector.name> > > > .Select(graph, HttpUtility.UrlDecode(FileName)); if (cur != null) { graph.Files.Current = cur; } PXRedirectHelper.TryRedirect(graph, PXRedirectHelper.WindowMode.Same); } catch (PXRedirectRequiredException ex) { string url = PX.Web.UI.PXDataSource.getMainForm(ex.Graph.GetType()); if (url != null) { ex.Graph.Unload(); PXContext.Session.RedirectGraphType[PXUrl.ToAbsoluteUrl(url)] = ex.Graph.GetType(); throw new PXRedirectRequiredException(url, ex.Graph, "Redirect0:" + this.ResolveUrl/**/ (url)); } } return(false); }
protected virtual void Page_LoadComplete(object sender, EventArgs e) { string noteID = Request.Params["navigate"]; if (!string.IsNullOrEmpty(noteID)) { try { PXEntitySearch search = new PXEntitySearch(); search.Redirect(Guid.Parse(noteID)); } catch (PXRedirectRequiredException ex) { string url = PX.Web.UI.PXDataSource.getMainForm(ex.Graph.GetType()); if (url != null) { ex.Graph.Unload(); PXContext.Session.RedirectGraphType[PXUrl.ToAbsoluteUrl(url)] = ex.Graph.GetType(); Response.Redirect(this.ResolveUrl/**/ (url)); //throw new PXRedirectRequiredException(url, ex.Graph, "Redirect0:" + this.ResolveUrl/**/(url)); } } } string fileName = Request.Params["file"]; if (!string.IsNullOrEmpty(fileName)) { try { WikiFileMaintenance graph = PXGraph.CreateInstance <WikiFileMaintenance>(); UploadFileWithIDSelector cur = PXSelect <UploadFileWithIDSelector, Where <UploadFileWithIDSelector.name, Equal <Required <UploadFileWithIDSelector.name> > > > .Select(graph, HttpUtility.UrlDecode(fileName)); if (cur != null) { graph.Files.Current = cur; } PXRedirectHelper.TryRedirect(graph, PXRedirectHelper.WindowMode.Same); } catch (PXRedirectRequiredException ex) { string url = PX.Web.UI.PXDataSource.getMainForm(ex.Graph.GetType()); if (url != null) { ex.Graph.Unload(); PXContext.Session.RedirectGraphType[PXUrl.ToAbsoluteUrl(url)] = ex.Graph.GetType(); Response.Redirect(this.ResolveUrl/**/ (url)); //throw new PXRedirectRequiredException(url, ex.Graph, "Redirect0:" + this.ResolveUrl/**/(url)); } } } //if (Page.IsPostBack && !Page.IsCallback) // AcceptInput(); //int page = 0; //int.TryParse(Request.Params["page"], out page); string query = TrimLongString(txtSearch.Text); switch (searchType) { case SearchService.SearchLookupType.ActiveModule: case SearchService.SearchLookupType.AllEntities: if (PerformSearchEntity(query, pageIndex)) { divMessage.Visible = false; } break; case SearchService.SearchLookupType.ActiveWiki: case SearchService.SearchLookupType.AllHelp: if (PerformSearchArticle(query, pageIndex)) { divMessage.Visible = false; } break; case SearchService.SearchLookupType.Files: if (PerformSearchFile(query, pageIndex)) { divMessage.Visible = false; } break; } }