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; }
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; }
public c_firstselect_formactions(string locator, string name) : base(locator, name) { Key = new PXTextEdit("ctl00_usrCaption_CustomizationDialogs_PXSmartPanel1_FormActions_edKey", "Key", locator, null); KeyLabel = new Label(Key); Key.DataField = "Key"; DataMemberName = "FirstSelect"; }
public c_filterworkingproject_formnewproject(string locator, string name) : base(locator, name) { NewProject = new PXTextEdit("ctl00_usrCaption_CustomizationDialogs_DlgNewProject_FormNewProject_edNewProject", "Project Name", locator, null); NewProjectLabel = new Label(NewProject); NewProject.DataField = "NewProject"; DataMemberName = "FilterWorkingProject"; Buttons = new PxButtonCollection(); }
public c_grid_row(c_batchlist_grid grid) : base(grid) { Files = new FileColumnButton(null, "Files", grid.Locator, "Files"); Notes = new NoteColumnButton(null, "Notes", grid.Locator, "Notes"); Selected = new CheckBox("ctl00_phL_grid_ef", "Selected", grid.Locator, "Selected"); Selected.DataField = "Selected"; AUScheduleHistory__ScheduleID = new PXTextEdit("ctl00_phL_grid_ei", "Schedule ID", grid.Locator, "AUScheduleHistory__ScheduleID"); AUScheduleHistory__ScheduleID.DataField = "AUScheduleHistory__ScheduleID"; AUScheduleHistory__ExecutionDate = new DateSelector("_ctl00_phL_grid_lv0_ed4", "Execution Date", grid.Locator, "AUScheduleHistory__ExecutionDate"); AUScheduleHistory__ExecutionDate.DataField = "AUScheduleHistory__ExecutionDate"; AUScheduleHistory__ExecutionResult = new PXTextEdit("ctl00_phL_grid_ei", "Execution Result", grid.Locator, "AUScheduleHistory__ExecutionResult"); AUScheduleHistory__ExecutionResult.DataField = "AUScheduleHistory__ExecutionResult"; AUScheduleHistory__Ticks = new PXNumberEdit("ctl00_phL_grid_en", "Ticks", grid.Locator, "AUScheduleHistory__Ticks"); AUScheduleHistory__Ticks.DataField = "AUScheduleHistory__Ticks"; AUScheduleHistory__ScheduleID_Description = new PXTextEdit("ctl00_phL_grid_ei", "Description", grid.Locator, "AUScheduleHistory__ScheduleID_Description"); AUScheduleHistory__ScheduleID_Description.DataField = "AUScheduleHistory__ScheduleID_Description"; Module = new DropDown("_ctl00_phL_grid_lv0_ec", "Module", grid.Locator, "Module"); Module.DataField = "Module"; Module.Items.Add("GL", "GL"); Module.Items.Add("AP", "AP"); Module.Items.Add("AR", "AR"); Module.Items.Add("CM", "CM"); Module.Items.Add("CA", "CA"); Module.Items.Add("IN", "IN"); Module.Items.Add("DR", "DR"); Module.Items.Add("FA", "FA"); Module.Items.Add("PM", "PM"); Module.Items.Add("PR", "PR"); BatchNbr = new Selector("_ctl00_phL_grid_lv0_es", "Batch Number", grid.Locator, "BatchNbr"); BatchNbr.DataField = "BatchNbr"; LedgerID = new Selector("_ctl00_phL_grid_lv0_es", "Ledger", grid.Locator, "LedgerID"); LedgerID.DataField = "LedgerID"; DateEntered = new DateSelector("_ctl00_phL_grid_lv0_ed11", "Transaction Date", grid.Locator, "DateEntered"); DateEntered.DataField = "DateEntered"; LastModifiedByID_Modifier_Username = new PXTextEdit("ctl00_phL_grid_ei", "Last Modified By", grid.Locator, "LastModifiedByID_Modifier_Username"); LastModifiedByID_Modifier_Username.DataField = "LastModifiedByID_Modifier_Username"; FinPeriodID = new Selector("_ctl00_phL_grid_lv0_es", "Post Period", grid.Locator, "FinPeriodID"); FinPeriodID.DataField = "FinPeriodID"; ControlTotal = new PXNumberEdit("ctl00_phL_grid_en", "Control Total", grid.Locator, "ControlTotal"); ControlTotal.DataField = "ControlTotal"; Description = new PXTextEdit("ctl00_phL_grid_ei", "Description", grid.Locator, "Description"); Description.DataField = "Description"; }
public c_vieweleminfo_formeleminfo(string locator, string name) : base(locator, name) { AspxControl = new PXTextEdit("ctl00_usrCaption_CustomizationDialogs_PanelElemInfo_FormElemInfo_edAspxControl", "Control Type", locator, null); AspxControlLabel = new Label(AspxControl); AspxControl.DataField = "AspxControl"; CacheType = new PXTextEdit("ctl00_usrCaption_CustomizationDialogs_PanelElemInfo_FormElemInfo_CacheType", "Data Class", locator, null); CacheTypeLabel = new Label(CacheType); CacheType.DataField = "CacheType"; FieldName = new PXTextEdit("ctl00_usrCaption_CustomizationDialogs_PanelElemInfo_FormElemInfo_FieldName", "Data Field", locator, null); FieldNameLabel = new Label(FieldName); FieldName.DataField = "FieldName"; ViewName = new PXTextEdit("ctl00_usrCaption_CustomizationDialogs_PanelElemInfo_FormElemInfo_ViewName", "View Name", locator, null); ViewNameLabel = new Label(ViewName); ViewName.DataField = "ViewName"; GraphName = new PXTextEdit("ctl00_usrCaption_CustomizationDialogs_PanelElemInfo_FormElemInfo_GraphName", "Business Logic", locator, null); GraphNameLabel = new Label(GraphName); GraphName.DataField = "GraphName"; DataMemberName = "ViewElemInfo"; Buttons = new PxButtonCollection(); }
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(".", "")); } }
/// <summary> /// Create web control for specified field. /// </summary> private WebControl CreateControlForField(PXFieldSchema f) { System.Web.UI.WebControls.WebControl ctrl = null; switch (f.ControlType) { case PXSchemaControl.NumberEdit: ctrl = new PXNumberEdit(); ((PXNumberEdit)ctrl).DataField = f.DataField; ((PXNumberEdit)ctrl).ValueType = f.DataType; ((PXNumberEdit)ctrl).AllowNull = true; break; case PXSchemaControl.TextEdit: ctrl = new PXTextEdit(); ((PXTextEdit)ctrl).DataField = f.DataField; break; case PXSchemaControl.CheckBox: ctrl = new PXCheckBox(); ((PXCheckBox)ctrl).DataField = f.DataField; break; case PXSchemaControl.ComboBox: ctrl = new PXDropDown(); ((PXDropDown)ctrl).DataField = f.DataField; ((PXDropDown)ctrl).AllowNull = false; break; case PXSchemaControl.Selector: ctrl = new PXSelector(); ((PXSelector)ctrl).DataSourceID = ds.ID; ((PXSelector)ctrl).DataField = f.DataField; PXFieldState fs = ((RMReportMaint)ds.DataGraph).Report.Cache.GetStateExt(((RMReportMaint)ds.DataGraph).Report.Current, f.DataField) as PXFieldState; if (fs != null && !String.IsNullOrWhiteSpace(fs.DescriptionName)) { ((PXSelector)ctrl).TextMode = TextModeTypes.Search; ((PXSelector)ctrl).DisplayMode = ValueDisplayMode.Text; } else if (fs.ValueField != null && fs.ValueField.ToLower() == "compositekey") { ((PXSelector)ctrl).CommitChanges = true; } break; case PXSchemaControl.SegmentMask: ctrl = new PXSegmentMask(); ((PXSegmentMask)ctrl).DataMember = f.ViewName; break; case PXSchemaControl.DateTimeEdit: ctrl = new PXDateTimeEdit(); ((PXDateTimeEdit)ctrl).DataField = f.DataField; break; } if (ctrl != null) { ctrl.ID = f.DataField; ((IFieldEditor)ctrl).DataField = f.DataField; } return(ctrl); }
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_Load(object sender, EventArgs e) { bool allowCustomItems = GetAllowCustomItems(); FillEmailSelector((PXMultiSelector)this.message.FindControl("edMailTo"), allowCustomItems); FillEmailSelector((PXMultiSelector)this.message.FindControl("edMailCc"), allowCustomItems); FillEmailSelector((PXMultiSelector)this.message.FindControl("edMailBcc"), allowCustomItems); /*Control edProject = tab.FindControl("edProject"); * if (edProject != null && ((PX.Web.UI.IFieldEditor)edProject).Hidden) * { * string top = Unit.Pixel(144).ToString(); * WebControl lblRefEntity = (WebControl)tab.FindControl("lblRefNoteID"); * if (lblRefEntity != null) lblRefEntity.Style[HtmlTextWriterStyle.Top] = top; * WebControl edRefEntity = (WebControl)tab.FindControl("edRefNoteID"); * if (edRefEntity != null) edRefEntity.Style[HtmlTextWriterStyle.Top] = top; * }*/ bool isIncoming = GetIncoming(); PXMultiSelector MailToSelector = (PXMultiSelector)message.FindControl("edMailTo"); PXTextEdit MailToTextEdit = (PXTextEdit)message.FindControl("edMailToTe"); PXMultiSelector MailCcSelector = (PXMultiSelector)message.FindControl("edMailCc"); PXTextEdit MailCcTextEdit = (PXTextEdit)message.FindControl("edMailCcTe"); PXMultiSelector MailBccSelector = (PXMultiSelector)message.FindControl("edMailBcc"); PXTextEdit MailBccTextEdit = (PXTextEdit)message.FindControl("edMailBccTe"); if (isIncoming) { if (MailToSelector != null) { MailToSelector.DataField = "MailFake"; } if (MailCcSelector != null) { MailCcSelector.DataField = "MailFake"; } if (MailBccSelector != null) { MailBccSelector.DataField = "MailFake"; } if (MailToTextEdit != null) { MailToTextEdit.DataField = "MailTo"; } if (MailCcTextEdit != null) { MailCcTextEdit.DataField = "MailCc"; } if (MailBccTextEdit != null) { MailBccTextEdit.DataField = "MailBcc"; } } else { if (MailToTextEdit != null) { MailToTextEdit.DataField = "MailFake"; } if (MailCcTextEdit != null) { MailCcTextEdit.DataField = "MailFake"; } if (MailBccTextEdit != null) { MailBccTextEdit.DataField = "MailFake"; } if (MailToSelector != null) { MailToSelector.DataField = "MailTo"; } if (MailCcSelector != null) { MailCcSelector.DataField = "MailCc"; } if (MailBccSelector != null) { MailBccSelector.DataField = "MailBcc"; } } }
protected void on_data_bound(object sender, EventArgs e) { bool isIncoming = GetIncoming(); PXSelector MailFromSelector = (PXSelector)message.FindControl("edMailFrom"); PXTextEdit MailFromTextEdit = (PXTextEdit)message.FindControl("edMailFromTe"); PXMultiSelector MailToSelector = (PXMultiSelector)message.FindControl("edMailTo"); PXTextEdit MailToTextEdit = (PXTextEdit)message.FindControl("edMailToTe"); PXMultiSelector MailCcSelector = (PXMultiSelector)message.FindControl("edMailCc"); PXTextEdit MailCcTextEdit = (PXTextEdit)message.FindControl("edMailCcTe"); PXMultiSelector MailBccSelector = (PXMultiSelector)message.FindControl("edMailBcc"); PXTextEdit MailBccTextEdit = (PXTextEdit)message.FindControl("edMailBccTe"); if (isIncoming) { if (MailFromSelector != null) { MailFromSelector.Hidden = true; } if (MailToSelector != null) { MailToSelector.Hidden = true; } if (MailCcSelector != null) { MailCcSelector.Hidden = true; } if (MailBccSelector != null) { MailBccSelector.Hidden = true; } if (MailFromTextEdit != null) { MailFromTextEdit.Hidden = false; } if (MailToTextEdit != null) { MailToTextEdit.Hidden = false; } if (MailCcTextEdit != null) { MailCcTextEdit.Hidden = false; } if (MailBccTextEdit != null) { MailBccTextEdit.Hidden = false; } } else { if (MailFromTextEdit != null) { MailFromTextEdit.Hidden = true; } if (MailToTextEdit != null) { MailToTextEdit.Hidden = true; } if (MailCcTextEdit != null) { MailCcTextEdit.Hidden = true; } if (MailBccTextEdit != null) { MailBccTextEdit.Hidden = true; } if (MailFromSelector != null) { MailFromSelector.Hidden = false; } if (MailToSelector != null) { MailToSelector.Hidden = false; } if (MailCcSelector != null) { MailCcSelector.Hidden = false; } if (MailBccSelector != null) { MailBccSelector.Hidden = false; } } }
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); } }
/// <summary> /// Create web control for specified field. /// </summary> private WebControl CreateControlForField(PXFieldSchema f) { System.Web.UI.WebControls.WebControl ctrl = null; switch (f.ControlType) { case PXSchemaControl.NumberEdit: ctrl = new PXNumberEdit(); ((PXNumberEdit)ctrl).DataField = f.DataField; ((PXNumberEdit)ctrl).ValueType = f.DataType; ((PXNumberEdit)ctrl).AllowNull = true; break; case PXSchemaControl.TextEdit: ctrl = new PXTextEdit(); ((PXTextEdit)ctrl).DataField = f.DataField; break; case PXSchemaControl.CheckBox: ctrl = new PXCheckBox(); ((PXCheckBox)ctrl).DataField = f.DataField; break; case PXSchemaControl.ComboBox: ctrl = new PXDropDown(); ((PXDropDown)ctrl).DataField = f.DataField; ((PXDropDown)ctrl).AllowNull = false; break; case PXSchemaControl.Selector: ctrl = new PXSelector(); ((PXSelector)ctrl).DataSourceID = ds.ID; ((PXSelector)ctrl).DataField = f.DataField; PXFieldState fs = ((RMReportMaint)ds.DataGraph).Report.Cache.GetStateExt(((RMReportMaint)ds.DataGraph).Report.Current, f.DataField) as PXFieldState; if (fs != null && !String.IsNullOrWhiteSpace(fs.DescriptionName)) { ((PXSelector)ctrl).TextMode = TextModeTypes.Search; ((PXSelector)ctrl).DisplayMode = ValueDisplayMode.Text; } else if (fs.ValueField != null && fs.ValueField.ToLower() == "compositekey") { ((PXSelector)ctrl).CommitChanges = true; } break; case PXSchemaControl.SegmentMask: ctrl = new PXSegmentMask(); ((PXSegmentMask)ctrl).DataMember = f.ViewName; break; case PXSchemaControl.DateTimeEdit: ctrl = new PXDateTimeEdit(); ((PXDateTimeEdit)ctrl).DataField = f.DataField; break; } if (ctrl != null) { ctrl.ID = f.DataField; ((IFieldEditor)ctrl).DataField = f.DataField; } return ctrl; }
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; }