protected void tab_DataBound(object sender, EventArgs e) { PXButton button = (PXButton)this.tab.FindControl("btnChangePassword"); if (button != null) { PXSmartPanel panel = (PXSmartPanel)this.tab.FindControl("pnlChangePassword"); PXTextEdit edit = (PXTextEdit)panel.FindControl("edNewPassword"); if (edit != null) { button.Enabled = edit.Enabled; button.Hidden = edit.Hidden; } } int index; if (int.TryParse(Request["tab"], out index) && index < this.tab.Items.Count) { this.tab.SelectedIndex = index; } var outlookLinkControl = (HyperLink)tab.Items["EmailSettings"].TemplateContainer.FindControl("form2").FindControl("OutlookAddin"); outlookLinkControl.Text = PX.Data.PXMessages.LocalizeNoPrefix(PX.Web.Controls.Messages.OutlookAddin); }
protected void Page_Init(object sender, EventArgs e) { string query = Request.QueryString["query"]; WikiID = Request.QueryString["wikiid"]; WikiNumber = Request.QueryString["wikinumber"]; CategoryID = Request.QueryString["categoryID"]; ProductID = Request.QueryString["productID"]; OrderID = Request.QueryString["orderID"]; imgMessage = PXFormView1.FindControl("imgMessage") as Image; lblMessage = PXFormView1.FindControl("lblMessage") as Label; lblResults = PXFormView1.FindControl("lblResults") as Label; txtSearch = PXFormView1.FindControl("txtSearch") as PXTextEdit; chkSearchReplace = PXFormView1.FindControl("chkSearchReplace") as PXCheckBox; txtReplace = PXFormView1.FindControl("txtReplace") as PXTextEdit; SearchCaption = PXFormView1.FindControl("SearchCaption") as PXDropDown; SearchCaptionCategory = PXFormView1.FindControl("SearchCaptionCategory") as PXDropDown; SearchCaptionProduct = PXFormView1.FindControl("SearchCaptionProduct") as PXDropDown; OrderCaption = PXFormView1.FindControl("OrderCaption") as PXDropDown; Go = PXFormView1.FindControl("btnSearch") as PXButton; mainContentTable = CreateMainTable(); pager = CreatePager(query); PXFormView1.TemplateContainer.Controls.Add(MainContentTable); SetEditBoxAttrributes(); FullText = true; if (this.searchType == SearchType.Wiki) { this.txtSearch.ToolTip = PXMessages.LocalizeNoPrefix(Messages.ttipHelpSearch); } else if (this.searchType == SearchType.Files) { this.txtSearch.ToolTip = PXMessages.LocalizeNoPrefix(Messages.ttipFileSearch); } else if (this.searchType == SearchType.Entity) { this.txtSearch.ToolTip = PXMessages.LocalizeNoPrefix(Messages.ttipEntitySearch); } else if (this.searchType == SearchType.Notes) { this.txtSearch.ToolTip = PXMessages.LocalizeNoPrefix(Messages.ttipNoteSearch); } FormatSearchCaption(); RegisterThisId(); imgMessage.ImageUrl = ResolveUrl("~/App_Themes/Default/Images/Message/information.gif"); if (query == null || string.IsNullOrEmpty(query.Trim())) { imgMessage.Visible = true; lblMessage.Visible = true; lblResults.Visible = false; lblMessage.Text = PXMessages.LocalizeNoPrefix(Messages.SpecifySearchRequest); return; } imgMessage.Visible = false; lblMessage.Visible = false; lblResults.Visible = true; }
private void navigate_CallBack_Files(object sender, PXCallBackEventArgs e) { PXButton btn = (PXButton)sender; if (string.IsNullOrEmpty(btn.CommandName)) { return; } NavHandlerFiles(btn.CommandName); }
protected void tab_DataBound(object sender, EventArgs e) { PXButton button = (PXButton)this.tab.FindControl("btnChangePassword"); if (button != null) { PXSmartPanel panel = (PXSmartPanel)this.tab.FindControl("pnlChangePassword"); PXTextEdit edit = (PXTextEdit)panel.FindControl("edNewPassword"); if (edit != null) { button.Enabled = edit.Enabled; button.Hidden = edit.Hidden; } } int index; if (int.TryParse(Request["tab"], out index) && index < this.tab.Items.Count) { this.tab.SelectedIndex = index; } }
/// <summary> /// The Audit panel load event handler. /// </summary> protected void pnlAudit_LoadContent(object sender, EventArgs e) { PXDataSource datasource = ((PXPage)this.Page).DefaultDataSource; PX.Data.Process.AUAuditPanelInfo info = null; if (datasource != null) { info = PX.Data.Process.PXAuditHelper.CollectInfo(datasource.DataGraph, datasource.PrimaryView); } if (info != null) { foreach (String field in PX.Data.Process.PXAuditHelper.FIELDS) { PXTextEdit edit = (PXTextEdit)frmAudit.FindControl("ed" + field); if (edit != null) { Object result = typeof(PX.Data.Process.AUAuditPanelInfo).InvokeMember(field, System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance, null, info, null); edit.Text = result == null ? null : result.ToString(); } } } else { frmAudit.Visible = false; ((PXLabel)pnlAudit.FindControl("lblWarning")).Visible = true; } PXSiteMapNode node = PXSiteMap.Provider.FindSiteMapNodeByScreenID("SM205510"); if (node != null) { PXButton btnActivate = (PXButton)pnlAuditButtons.FindControl("btnAuditActivate"); btnActivate.Visible = true; btnActivate.NavigateUrl = String.Concat(ResolveUrl(node.Url), "?ScreenId=", this.screenID.Replace(".", "")); } }
private Control GenerateFilesLinkPanel() { PXSmartPanel result = new PXSmartPanel(); result.ID = "filesLinkPanel"; result.Key = "FilesLink"; result.AllowResize = false; result.AutoCallBack.Enabled = true; result.AutoCallBack.Command = "Refresh"; result.AutoCallBack.Target = "form"; result.Style[HtmlTextWriterStyle.Position] = "absolute"; result.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(250).ToString(); result.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(250).ToString(); result.Width = Unit.Pixel(400); result.Height = Unit.Pixel(150); PXFormView form = new PXFormView(); form.ID = "form"; form.Caption = "WebDAV Links for the list of files"; form.AllowCollapse = false; form.DataSourceID = "ds"; form.DataMember = "FilesLink"; form.Style[HtmlTextWriterStyle.Position] = "absolute"; form.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(9).ToString(); form.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(9).ToString(); form.Width = Unit.Pixel(363); form.Height = Unit.Pixel(100); PXLabel extLabel = new PXLabel("External Link"); extLabel.ID = "lblExt"; extLabel.Style[HtmlTextWriterStyle.Position] = "absolute"; extLabel.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(9).ToString(); extLabel.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(9).ToString(); extLabel.ApplyStyleSheetSkin(Page); form.TemplateContainer.Controls.Add(extLabel); PXTextEdit extEdit = new PXTextEdit(); extEdit.ID = "edExt"; extEdit.LabelID = "lblExt"; extEdit.DataField = "InternalPath"; extEdit.ReadOnly = true; extEdit.Style[HtmlTextWriterStyle.Position] = "absolute"; extEdit.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(81).ToString(); extEdit.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(9).ToString(); extEdit.Width = Unit.Pixel(250); extEdit.ApplyStyleSheetSkin(Page); form.TemplateContainer.Controls.Add(extEdit); PXLabel pubLabel = new PXLabel("Public Link"); pubLabel.ID = "lblPub"; pubLabel.Style[HtmlTextWriterStyle.Position] = "absolute"; pubLabel.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(9).ToString(); pubLabel.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(36).ToString(); pubLabel.ApplyStyleSheetSkin(Page); form.TemplateContainer.Controls.Add(pubLabel); PXTextEdit pubEdit = new PXTextEdit(); pubEdit.ID = "edPub"; pubEdit.LabelID = "lblPub"; pubEdit.DataField = "ExternalPath"; pubEdit.ReadOnly = true; pubEdit.Style[HtmlTextWriterStyle.Position] = "absolute"; pubEdit.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(81).ToString(); pubEdit.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(36).ToString(); pubEdit.Width = Unit.Pixel(250); pubEdit.ApplyStyleSheetSkin(Page); form.TemplateContainer.Controls.Add(pubEdit); PXButton closeButton = new PXButton(); closeButton.Text = "Close"; closeButton.DialogResult = WebDialogResult.Cancel; closeButton.Style[HtmlTextWriterStyle.Position] = "absolute"; closeButton.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(247).ToString(); closeButton.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(63).ToString(); closeButton.Width = Unit.Pixel(90); closeButton.ApplyStyleSheetSkin(Page); form.TemplateContainer.Controls.Add(closeButton); form.ApplyStyleSheetSkin(Page); result.Controls.Add(form); return(result); }
protected void Page_Init(object sender, EventArgs e) { RegisterThisId(); #region Init Controls //Since Controls are placed inside the PXForm we need to manually find them and init the referencing them variables: divMessage = PXFormView1.FindControl("divMessage") as Control; lblMessage = PXFormView1.FindControl("lblMessage") as Label; txtSearch = PXFormView1.FindControl("txtSearch") as PXTextEdit; btnSearch = PXFormView1.FindControl("btnSearch") as PXButton; filterrow = PXFormView1.FindControl("filterrow") as HtmlTableRow; var pnlResults = PXFormView1.FindControl("pnlResults") as PXSmartPanel; resultsTable = pnlResults.FindControl("resultsTable") as HtmlTable; lblFullTextWarning = pnlResults.FindControl("lblFullTextWarning") as Label; linkPrev = pnlResults.FindControl("linkPrev") as LinkButton; linkNext = pnlResults.FindControl("linkNext") as LinkButton; divTips = PXFormView1.FindControl("divTips") as HtmlGenericControl; lblSearchTips = PXFormView1.FindControl("lblSearchTips") as Label; liCheckSpelling = PXFormView1.FindControl("liCheckSpelling") as HtmlGenericControl; liSimplifyQuery = PXFormView1.FindControl("liSimplifyQuery") as HtmlGenericControl; liTryOtherWords = PXFormView1.FindControl("liTryOtherWords") as HtmlGenericControl; lblSearchTips.Text = PXMessages.LocalizeNoPrefix(Messages.SearchTips); liCheckSpelling.InnerText = PXMessages.LocalizeNoPrefix(Messages.CheckSpelling); liSimplifyQuery.InnerText = PXMessages.LocalizeNoPrefix(Messages.SimplifyQuery); liTryOtherWords.InnerText = PXMessages.LocalizeNoPrefix(Messages.TryOtherWords); lblActiveModule = PXFormView1.FindControl("lblActiveModule") as PXLabel; btnClearActiveModule = PXFormView1.FindControl("btnClearActiveModule") as PXButton; btnShowList = PXFormView1.FindControl("btnShowList") as PXButton; cellList = PXFormView1.FindControl("cellList") as HtmlTableCell; filtertable = PXFormView1.FindControl("filtertable") as HtmlTable; #endregion lblMessage.Text = PXMessages.LocalizeNoPrefix(Messages.SpecifySearchRequest); activeModule = Request.Params["am"]; Guid am; if (Guid.TryParse(activeModule, out am)) { comboBoxLookupList = SearchService.BuildComboList(am); } else { comboBoxLookupList = SearchService.BuildComboList(null); } searchType = comboBoxLookupList[0].Type; string query = Request.Params["query"]; string st = Request.Params["st"]; if (!string.IsNullOrEmpty(st)) { Enum.TryParse <SearchService.SearchLookupType>(Request.Params["st"], true, out searchType); } if (am == Guid.Empty) { if (searchType == SearchService.SearchLookupType.ActiveModule) { searchType = SearchService.SearchLookupType.AllEntities; } else if (searchType == SearchService.SearchLookupType.ActiveWiki) { searchType = SearchService.SearchLookupType.AllHelp; } } txtSearch.Text = Request.Params["query"]; if (query == null || string.IsNullOrEmpty(query.Trim())) { divMessage.Visible = true; } else { divMessage.Visible = false; } if (searchType == SearchService.SearchLookupType.ActiveModule || searchType == SearchService.SearchLookupType.ActiveWiki || searchType == SearchService.SearchLookupType.Files || searchType == SearchService.SearchLookupType.Screen) { filtertable.Visible = true; lblActiveModule.Text = comboBoxLookupList.Single(a => a.Type.Equals(searchType)).Name; } else { filtertable.Visible = false; } SearchService.SearchLookupType newSt = searchType; if (searchType == SearchService.SearchLookupType.ActiveModule || searchType == SearchService.SearchLookupType.Files || searchType == SearchService.SearchLookupType.Screen) { newSt = SearchService.SearchLookupType.AllEntities; } if (searchType == SearchService.SearchLookupType.ActiveWiki) { newSt = SearchService.SearchLookupType.AllHelp; } UriBuilder urlClear = new UriBuilder(new Uri(HttpContext.Current.Request.GetExternalUrl(), this.ResolveUrl(Request.RawUrl))); btnClearActiveModule.NavigateUrl = urlClear.Path + string.Format("?query={0}&am={1}&st={2}", query, activeModule, newSt); btnClearActiveModule.RenderAsButton = false; btnShowList.RenderAsButton = false; //txtSearch.BorderColor = Color.Transparent; foreach (SearchService.SearchLookupItem item in comboBoxLookupList) { bool addActiveModule = true; bool addActiveWiki = true; bool addAllEntity = true; bool addAllHelp = true; if (searchType == SearchService.SearchLookupType.ActiveModule) { addActiveModule = false; addAllEntity = false; } if (searchType == SearchService.SearchLookupType.ActiveWiki) { addActiveWiki = false; addAllHelp = false; } if (searchType == SearchService.SearchLookupType.AllEntities) { addAllEntity = false; } if (searchType == SearchService.SearchLookupType.AllHelp) { addAllHelp = false; } //bool addItem = true; if (item.Type == SearchService.SearchLookupType.ActiveModule && !addActiveModule) { continue; } if (item.Type == SearchService.SearchLookupType.ActiveWiki && !addActiveWiki) { continue; } if (item.Type == SearchService.SearchLookupType.AllEntities && !addAllEntity) { continue; } if (item.Type == SearchService.SearchLookupType.AllHelp && !addAllHelp) { continue; } UriBuilder url = new UriBuilder(new Uri(HttpContext.Current.Request.GetExternalUrl(), this.ResolveUrl(Request.RawUrl))); string navigateUrl = url.Path + string.Format("?query={0}&am={1}&st={2}", query, activeModule, item.Type); //var link = new HyperLink() { CssClass = "comboItem", NavigateUrl = navigateUrl, Text = item.Name }; //cellList.Controls.Add(link); PXButton button = new PXButton(); button.ApplyStyleSheetSkin(this.Page); button.RenderAsButton = false; button.TextAlign = HorizontalAlign.Left; button.CssClass = "comboItem"; button.Text = item.Name; button.Styles.Hover.Cursor = WebCursor.Hand; button.NavigateUrl = navigateUrl; button.AutoCallBack.Command = "navigate"; button.AutoCallBack.Enabled = true; button.AutoCallBack.Behavior.PostData = PostDataMode.Container; button.AutoCallBack.Behavior.RepaintControls = RepaintMode.All; button.AutoCallBack.Behavior.ContainerID = "PXFormView1"; button.AutoCallBack.Behavior.BlockPage = true; button.ID = "Button_" + item.Type; cellList.Controls.Add(button); } }
private Control GenerateFilesLinkPanel() { PXSmartPanel result = new PXSmartPanel(); result.ID = "filesLinkPanel"; result.Key = "FilesLink"; result.AllowResize = false; result.AutoCallBack.Enabled = true; result.AutoCallBack.Command = "Refresh"; result.AutoCallBack.Target = "form"; result.Style[HtmlTextWriterStyle.Position] = "absolute"; result.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(250).ToString(); result.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(250).ToString(); result.Width = Unit.Pixel(400); result.Height = Unit.Pixel(150); PXFormView form = new PXFormView(); form.ID = "form"; form.Caption = "WebDAV Links for the list of files"; form.AllowCollapse = false; form.DataSourceID = "ds"; form.DataMember = "FilesLink"; form.Style[HtmlTextWriterStyle.Position] = "absolute"; form.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(9).ToString(); form.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(9).ToString(); form.Width = Unit.Pixel(363); form.Height = Unit.Pixel(100); PXLabel extLabel = new PXLabel("External Link"); extLabel.ID = "lblExt"; extLabel.Style[HtmlTextWriterStyle.Position] = "absolute"; extLabel.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(9).ToString(); extLabel.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(9).ToString(); extLabel.ApplyStyleSheetSkin(Page); form.TemplateContainer.Controls.Add(extLabel); PXTextEdit extEdit = new PXTextEdit(); extEdit.ID = "edExt"; extEdit.LabelID = "lblExt"; extEdit.DataField = "InternalPath"; extEdit.ReadOnly = true; extEdit.Style[HtmlTextWriterStyle.Position] = "absolute"; extEdit.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(81).ToString(); extEdit.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(9).ToString(); extEdit.Width = Unit.Pixel(250); extEdit.ApplyStyleSheetSkin(Page); form.TemplateContainer.Controls.Add(extEdit); PXLabel pubLabel = new PXLabel("Public Link"); pubLabel.ID = "lblPub"; pubLabel.Style[HtmlTextWriterStyle.Position] = "absolute"; pubLabel.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(9).ToString(); pubLabel.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(36).ToString(); pubLabel.ApplyStyleSheetSkin(Page); form.TemplateContainer.Controls.Add(pubLabel); PXTextEdit pubEdit = new PXTextEdit(); pubEdit.ID = "edPub"; pubEdit.LabelID = "lblPub"; pubEdit.DataField = "ExternalPath"; pubEdit.ReadOnly = true; pubEdit.Style[HtmlTextWriterStyle.Position] = "absolute"; pubEdit.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(81).ToString(); pubEdit.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(36).ToString(); pubEdit.Width = Unit.Pixel(250); pubEdit.ApplyStyleSheetSkin(Page); form.TemplateContainer.Controls.Add(pubEdit); PXButton closeButton = new PXButton(); closeButton.Text = "Close"; closeButton.DialogResult = WebDialogResult.Cancel; closeButton.Style[HtmlTextWriterStyle.Position] = "absolute"; closeButton.Style[HtmlTextWriterStyle.Left] = Unit.Pixel(247).ToString(); closeButton.Style[HtmlTextWriterStyle.Top] = Unit.Pixel(63).ToString(); closeButton.Width = Unit.Pixel(90); closeButton.ApplyStyleSheetSkin(Page); form.TemplateContainer.Controls.Add(closeButton); form.ApplyStyleSheetSkin(Page); result.Controls.Add(form); return result; }