protected void Page_Load(object sender, EventArgs e) { PXLabel label = frmInstall.FindControl("lblDisclamer") as PXLabel; label.Text = PX.Data.PXMessages.LocalizeNoPrefix(PX.Data.ActionsMessages.LicenseDisclamer).Replace(Environment.NewLine, "<BR>"); label.AlreadyLocalized = true; PXLabel warning = frmWarning.FindControl("edWarningText") as PXLabel; warning.Text = PX.Data.PXMessages.LocalizeNoPrefix(PX.SM.Messages.LSWarningMessage).Replace(Environment.NewLine, "<BR>"); warning.AlreadyLocalized = true; PXLabel agreement = frmAgreement.FindControl("edAgreementText") as PXLabel; agreement.Text = PX.Data.PXMessages.LocalizeNoPrefix(PX.SM.Messages.LicenseEulaConfirmation).Replace(Environment.NewLine, "<BR>"); agreement.AlreadyLocalized = true; HyperLink agreementLink = frmAgreement.FindControl("eulaLink") as HyperLink; agreementLink.Text = PX.Data.PXMessages.LocalizeNoPrefix(PX.SM.Messages.LicenseEulaAgreementLink); string licenseType = (string)HttpContext.Current.Session["LicenseType"]; if (!string.IsNullOrEmpty(licenseType)) { var link = frmAgreement.FindControl("eulaLink") as HyperLink; link.Target = "_blank"; link.NavigateUrl = string.Format("~/EULA/{0}.pdf", licenseType.ToLower()); } }
//--------------------------------------------------------------------------- /// <summary> /// The About panel load event handler. /// </summary> protected void pnlAbout_LoadContent(object sender, EventArgs e) { PXLabel lbl = (PXLabel)pnlAbout.FindControl("lblVersion"); lbl.Text = this.GetVersion(false); if (PX.SM.UpdateMaint.CheckForUpdates()) { lbl = (PXLabel)pnlAbout.FindControl("lblUpdates"); lbl.Text = PXMessages.LocalizeFormatNoPrefix(PX.AscxControlsMessages.PageTitle.Updates, PXVersionInfo.Version); lbl.Style["display"] = ""; } lbl = (PXLabel)pnlAbout.FindControl("lblCopyright2"); lbl.Text = PXMessages.LocalizeFormatNoPrefix(PX.AscxControlsMessages.PageTitle.Copyright2); lbl = (PXLabel)pnlAbout.FindControl("lblInstallationID"); // hiding InstallationID if it is empty if (String.IsNullOrEmpty(PXVersionInfo.InstallationID)) { lbl.Visible = false; } lbl.Text = PXMessages.LocalizeFormatNoPrefix(PX.AscxControlsMessages.PageTitle.InstallationID, PXLicenseHelper.InstallationID); string copyR = PXVersionInfo.Copyright; lbl = (PXLabel)pnlAbout.FindControl("lblCopyright1"); if (!string.IsNullOrEmpty(copyR)) { lbl.Text = copyR; } }
//Fill controls with user friendly error info private void SetUserFriendlyInfo(string url, string navigateTo, string exceptionNumber, string exeptionMessage) { ((HyperLink)this.frmBottom.FindControl("lnkTrace")).Visible = false; ((Image)this.frmBottom.FindControl("imgMessage")).ImageUrl = "~/App_Themes/Default/Images/Wiki/Warn.png"; ((PXLabel)this.frmBottom.FindControl("lblErrCode")).Text = string.Format(ErrorMessages.GetLocal(ErrorMessages.ErrorNumber), exceptionNumber); ((PXLabel)this.frmBottom.FindControl("lblMessage")).Text = string.Format("{0} {1}", ErrorMessages.GetLocal(ErrorMessages.SetupNotEnteredPrefix), exeptionMessage); HyperLink hlNavTo = this.frmBottom.FindControl("hlNavTo") as HyperLink; PXLabel lblNxStep = this.frmBottom.FindControl("lblNxStep") as PXLabel; PXLabel lblNavTo = this.frmBottom.FindControl("lblNavTo") as PXLabel; PXLabel lblNavToEnding = this.frmBottom.FindControl("lblNavToEnding") as PXLabel; if (url != null) { hlNavTo.Text = navigateTo; hlNavTo.NavigateUrl = url; lblNxStep.Text = ErrorMessages.GetLocal(ErrorMessages.NextStep); lblNavTo.Text = ErrorMessages.GetLocal(ErrorMessages.NavTo); lblNavToEnding.Text = ErrorMessages.GetLocal(ErrorMessages.NavToSuffix); } else { lblNxStep.Visible = false; lblNavTo.Visible = false; lblNavToEnding.Visible = false; hlNavTo.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { this.lblUserAgent.Text = "User Agent: " + this.Request.UserAgent; PXLabel lbl = (PXLabel)form1.FindControl("lblMessage"); lbl.Text = PXMessages.LocalizeFormatNoPrefix(PX.Data.ErrorMessages.SupportetBrowsers); }
private string GetArticle(Guid pageID, int id, PXLabel label, PXPanel statPanel) { DateTime date = DateTime.MinValue; string article = GetArticle(pageID, id, ref date); label.Text = date.ToString("g", System.Threading.Thread.CurrentThread.CurrentCulture); statPanel.Caption = label.Text; return(article); }
protected void Page_Load(object sender, EventArgs e) { PXLabel label = frmInstall.FindControl("lblDisclamer") as PXLabel; label.Text = PX.Data.PXMessages.LocalizeNoPrefix(PX.Data.ActionsMessages.LicenseDisclamer).Replace(Environment.NewLine, "<BR>"); PXLabel warning = frmWarning.FindControl("edWarningText") as PXLabel; warning.Text = PX.Data.PXMessages.LocalizeNoPrefix(PX.SM.Messages.LSWarningMessage).Replace(Environment.NewLine, "<BR>"); }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsCallback) { PXLabel lbl = this.formSettings.FindControl("lblPeriodsNumberAfter") as PXLabel; if (lbl != null) { lbl.Text = PXMessages.LocalizeNoPrefix(Messages.Periods); } } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsCallback) { PXLabel lbl = this.form.FindControl("lblNote1") as PXLabel; if (lbl != null) { lbl.Text = PXMessages.LocalizeNoPrefix(Messages.EstimatedCosts); } } }
protected void Page_Load(object sender, EventArgs e) { this.Master.PopupWidth = 650; this.Master.PopupHeight = 350; this.Master.FindControl("usrCaption").Visible = false; PXLabel label = this.formview.FindControl("PXLabel") as PXLabel; if (label != null) { label.Text = PXSiteMap.IsPortal ? "Any comments and suggestions you would like to submit:" : "Other user comments and suggestions:"; } }
protected void Page_Load(object sender, EventArgs e) { this.usrCaption.CustomizationAvailable = false; ver1 = PXFormView1.FindControl("ver1") as PXLabel; ver2 = PXFormView1.FindControl("ver2") as PXLabel; content1 = PXFormView1.FindControl("content1") as HtmlContainerControl; content2 = PXFormView1.FindControl("content2") as HtmlContainerControl; this.usrCaption.ScreenID = "WI.00.00.50"; ver1.Text = Request.QueryString["id1"]; ver2.Text = Request.QueryString["id2"]; Guid pageID = PX.Common.GUID.CreateGuid(Request.QueryString["pageID"]) ?? Guid.Empty; int id1 = 0; int id2 = 0; if (!string.IsNullOrEmpty(ver1.Text) && !Int32.TryParse(ver1.Text, out id1)) { id1 = 0; } if (!string.IsNullOrEmpty(ver2.Text) && !Int32.TryParse(ver2.Text, out id2)) { id2 = 0; } string art1, art2; bool docompare = true; art1 = GetArticle(pageID, id1, ver1, this.pnlStatLeft); CollectLeftStats(art1); art2 = GetArticle(pageID, id2, ver2, this.pnlStatRight); CollectRightStats(art2); if (string.IsNullOrEmpty(art1)) { art1 = PX.Data.PXMessages.LocalizeNoPrefix(PX.SM.Messages.SourceArticle); docompare = false; } if (string.IsNullOrEmpty(art2)) { art2 = PX.Data.PXMessages.LocalizeNoPrefix(PX.SM.Messages.DestinationArticle); docompare = false; } if (docompare) { CompareArticles(art1, art2, ref art1, ref art2); } this.content1.InnerHtml = art1; this.content2.InnerHtml = art2; }
//--------------------------------------------------------------------------- /// <summary> /// The About panel load event handler. /// </summary> protected void pnlAbout_LoadContent(object sender, EventArgs e) { PXLabel lbl = (PXLabel)pnlAbout.FindControl("lblVersion"); lbl.Text = this.GetVersion(false); lbl = (PXLabel)pnlAbout.FindControl("lblAcumatica"); lbl.Text = "Acumatica " + PXVersionInfo.ProductVersion; if (PX.SM.UpdateMaint.CheckForUpdates()) { lbl = (PXLabel)pnlAbout.FindControl("lblUpdates"); lbl.Text = PXMessages.LocalizeFormatNoPrefix(PX.AscxControlsMessages.PageTitle.Updates, PXVersionInfo.Version); lbl.Style["display"] = ""; } var lastRestoredSnapshot = CompanyMaint.GetLastRestoredSnapshot(); if (lastRestoredSnapshot != null && lastRestoredSnapshot.IsSafe != null && !lastRestoredSnapshot.IsSafe.Value && lastRestoredSnapshot.Dismissed != null && !lastRestoredSnapshot.Dismissed.Value) { lbl = (PXLabel)pnlAbout.FindControl("lblRestoredSnapshotIsUnsafe"); lbl.Text = PXMessages.LocalizeFormatNoPrefixNLA(PX.Data.Update.Messages.UnsafeSnapshotRestoredShort, lastRestoredSnapshot.CreatedDateTime != null ? lastRestoredSnapshot.CreatedDateTime.ToString() : "uknown date"); lbl.ForeColor = System.Drawing.Color.Red; lbl.Style["display"] = ""; } lbl = (PXLabel)pnlAbout.FindControl("lblCopyright2"); lbl.Text = PXMessages.LocalizeFormatNoPrefix(PX.AscxControlsMessages.PageTitle.Copyright2); lbl = (PXLabel)pnlAbout.FindControl("lblInstallationID"); // hiding InstallationID if it is empty if (String.IsNullOrEmpty(PXVersionInfo.InstallationID)) { lbl.Visible = false; } lbl.Text = PXMessages.LocalizeFormatNoPrefix(PX.AscxControlsMessages.PageTitle.InstallationID, PXLicenseHelper.InstallationID); string copyR = PXVersionInfo.Copyright; lbl = (PXLabel)pnlAbout.FindControl("lblCopyright1"); if (!string.IsNullOrEmpty(copyR)) { lbl.Text = copyR; } }
private void DrawItem(IParserAccessor pa, String caption, String value) { PXLabel lblTitle = new PXLabel(caption); lblTitle.Font.Bold = true; lblTitle.Font.Size = FontUnit.Small; pa.AddParsedSubObject(lblTitle); if (!String.IsNullOrWhiteSpace(value)) { PXLabel lblValue = new PXLabel(value.ToString()); lblValue.Font.Size = FontUnit.Small; pa.AddParsedSubObject(lblValue); } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsCallback) { PXGroupBox box = this.form.FindControl("gbPeriodically") as PXGroupBox; if (box != null) { PXLabel lbl = box.FindControl("PXLabel1") as PXLabel; if (lbl != null) { lbl.Text = Messages.DocumentDateSelection; } } } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsCallback) { PXLabel lbl1 = this.form.FindControl("lblNote1") as PXLabel; PXLabel lbl2 = this.form.FindControl("lblNote2") as PXLabel; if (lbl1 != null) { lbl1.Text = PXMessages.LocalizeNoPrefix(Messages.ExceptLocationNotAvailable); } if (lbl2 != null) { lbl2.Text = PXMessages.LocalizeNoPrefix(Messages.ExceptExpiredNotAvailable); } } }
private void HideUnpaidTimeControls() { PXLabel unpaidTimeLabel = (PXLabel)tab.FindControl("PXUnpaidTimeLabel"); if (unpaidTimeLabel != null) { unpaidTimeLabel.Visible = false; } PXLayoutRule layoutRule = (PXLayoutRule)tab.FindControl("PXUnpaidTimeLayoutRule"); if (layoutRule != null) { layoutRule.StartColumn = false; } }
protected void Page_Load(object sender, EventArgs e) { Control grid = this.tab.FindControl("gridRevisions"); if (!this.Page.IsCallback) { this.Page.ClientScript.RegisterClientScriptBlock(GetType(), "gridID", "var gridRevisionsID=\"" + grid.ClientID + "\";", true); this.Page.ClientScript.RegisterClientScriptBlock(GetType(), "pnlNewRevID", "var pnlNewRevID=\"" + this.pnlNewRev.ClientID + "\";", true); this.Page.ClientScript.RegisterClientScriptBlock(GetType(), "dsID", "var dsID=\"" + this.ds.ClientID + "\";", true); } PXLabel lbl = this.tab.FindControl("lblAccessRights") as PXLabel; if (lbl != null) { lbl.Text = ActionsMessages.AccessRights; } }
protected void Page_Load(object sender, EventArgs e) { this.usrCaption.CustomizationAvailable = false; ver1 = PXFormView1.FindControl("ver1") as PXLabel; ver2 = PXFormView1.FindControl("ver2") as PXLabel; content1 = PXFormView1.FindControl("content1") as HtmlContainerControl; content2 = PXFormView1.FindControl("content2") as HtmlContainerControl; this.usrCaption.ScreenID = "WI.00.00.50"; ver1.Text = Request.QueryString["id1"]; ver2.Text = Request.QueryString["id2"]; Guid pageID = PX.Common.GUID.CreateGuid(Request.QueryString["pageID"])?? Guid.Empty; int id1 = 0; int id2 = 0; if (!string.IsNullOrEmpty(ver1.Text) && !Int32.TryParse(ver1.Text, out id1)) id1 = 0; if (!string.IsNullOrEmpty(ver2.Text) && !Int32.TryParse(ver2.Text, out id2)) id2 = 0; string art1, art2; bool docompare = true; art1 = GetArticle(pageID, id1, ver1, this.pnlStatLeft); CollectLeftStats(art1); art2 = GetArticle(pageID, id2, ver2, this.pnlStatRight); CollectRightStats(art2); if (string.IsNullOrEmpty(art1)) { art1 = PX.Data.PXMessages.LocalizeNoPrefix(PX.SM.Messages.SourceArticle); docompare = false; } if (string.IsNullOrEmpty(art2)) { art2 = PX.Data.PXMessages.LocalizeNoPrefix(PX.SM.Messages.DestinationArticle); docompare = false; } if(docompare) CompareArticles(art1, art2, ref art1, ref art2); this.content1.InnerHtml = art1; this.content2.InnerHtml = art2; }
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) { string query = Request.QueryString["query"]; IsWiki = Request.QueryString["isWiki"]; WikiID = Request.QueryString["wikiid"]; WikiNumber = Request.QueryString["wikinumber"]; CategoryID = Request.QueryString["categoryID"]; ProductID = Request.QueryString["productID"]; OrderID = Request.QueryString["orderID"]; Globalsearchcaption = Request.QueryString["globalsearchcaption"]; imgMessage = PXFormView1.FindControl("imgMessage") as Image; lblMessage = PXFormView1.FindControl("lblMessage") as Label; lblResults = PXFormView1.FindControl("lblResults") as Label; lblFilter = PXFormView1.FindControl("lblFilter") as PXLabel; txtSearch = PXFormView1.FindControl("txtSearch") as PXTextEdit; chkSearchReplace = PXFormView1.FindControl("chkSearchReplace") as PXCheckBox; txtReplace = PXFormView1.FindControl("txtReplace") as PXTextEdit; SearchCaption = PXFormView1.FindControl("SearchCaption") as PXDropDown; GlobalSearchCaption = PXFormView1.FindControl("GlobalSearchCaption") 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; filterrow = PXFormView1.FindControl("filterrow") as HtmlTableRow; mainContentTable = CreateMainTable(); pager = CreatePager(query); PXFormView1.TemplateContainer.Controls.Add(MainContentTable); SetEditBoxAttrributes(); 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 (IsWiki == "0") { SearchCaption.Visible = false; SearchCaptionCategory.Visible = false; SearchCaptionProduct.Visible = false; OrderCaption.Visible = false; lblFilter.Visible = false; filterrow.Visible = false; } 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 string GetArticle(Guid pageID, int id, PXLabel label, PXPanel statPanel) { DateTime date = DateTime.MinValue; string article = GetArticle(pageID, id, ref date); label.Text = date.ToString("g", System.Threading.Thread.CurrentThread.CurrentCulture); statPanel.Caption = label.Text; return article; }
protected override void Page_Init(object sender, EventArgs e) { base.Page_Init(sender, e); Rate = PXFormView2.FindControl("Rate") as PXDropDown; LblRate = PXFormView2.FindControl("lblRate") as PXLabel; PXKB = PXFormView1.FindControl("PXKB") as PXLabel; PXCategori = PXFormView1.FindControl("PXCategori") as PXLabel; PXProduct = PXFormView1.FindControl("PXProduct") as PXLabel; PXKBName = PXFormView1.FindControl("PXKBName") as PXLabel; PXCreateDate = PXFormView1.FindControl("PXCreateDate") as PXLabel; PXLastPublished = PXFormView1.FindControl("PXLastPublished") as PXLabel; PXLastModified = PXFormView1.FindControl("PXLastModified") as PXLabel; PXViews = PXFormView1.FindControl("PXViews") as PXLabel; PXRating = PXFormView1.FindControl("PXRating") as PXLabel; PXImage1 = PXFormView1.FindControl("PXImage1") as PXImage; PXImage2 = PXFormView1.FindControl("PXImage2") as PXImage; PXImage3 = PXFormView1.FindControl("PXImage3") as PXImage; PXImage4 = PXFormView1.FindControl("PXImage4") as PXImage; PXImage5 = PXFormView1.FindControl("PXImage5") as PXImage; PXdAvRate = PXFormView1.FindControl("PXdAvRate") as PXLabel; UserMessage = PXFormView3.FindControl("UserMessage") as PXLabel; rateid = Request["rateid"]; feedbackid = Request["feedbackid"]; pageid = Request["pageid"]; if (pageid != null) { Guid currentwikipage = new Guid(pageid); if (!String.IsNullOrEmpty(pageid)) { InitHeader(currentwikipage); } var wiki = (PXResult <WikiPage, WikiDescriptor, WikiRevision>) PXSelectJoin <WikiPage, InnerJoin <WikiDescriptor, On <WikiDescriptor.pageID, Equal <WikiPage.wikiID> >, InnerJoin <WikiRevision, On <WikiRevision.pageID, Equal <WikiPage.pageID> > > >, Where <WikiPage.pageID, Equal <Required <WikiPage.pageID> > > > .Select( new PXGraph(), currentwikipage); if (wiki == null) { HideRateMenu(); } else { var currentwiki = wiki[typeof(WikiDescriptor)] as WikiDescriptor; if (!PXSiteMap.IsPortal || currentwiki == null || currentwiki.SPWikiArticleType != WikiArticleType.KBArticle) { HideRateMenu(); } else { CreateRateMenu(Rate); } } } else { HideRateMenu(); } }
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; }
protected override void Page_Init(object sender, EventArgs e) { base.Page_Init(sender, e); Rate = PXFormView2.FindControl("Rate") as PXDropDown; LblRate = PXFormView2.FindControl("lblRate") as PXLabel; PXKB = PXFormView1.FindControl("PXKB") as PXLabel; PXCategori = PXFormView1.FindControl("PXCategori") as PXLabel; PXProduct = PXFormView1.FindControl("PXProduct") as PXLabel; PXKBName = PXFormView1.FindControl("PXKBName") as PXLabel; PXLastPublished = PXFormView1.FindControl("PXLastPublished") as PXLabel; PXLastModified = PXFormView1.FindControl("PXLastModified") as PXLabel; PXViews = PXFormView1.FindControl("PXViews") as PXLabel; PXRating = PXFormView1.FindControl("PXRating") as PXLabel; PXImage1 = PXFormView1.FindControl("PXImage1") as PXImage; PXImage2 = PXFormView1.FindControl("PXImage2") as PXImage; PXImage3 = PXFormView1.FindControl("PXImage3") as PXImage; PXImage4 = PXFormView1.FindControl("PXImage4") as PXImage; PXImage5 = PXFormView1.FindControl("PXImage5") as PXImage; PXdAvRate = PXFormView1.FindControl("PXdAvRate") as PXLabel; UserMessage = PXFormView3.FindControl("UserMessage") as PXLabel; rateid = Request["rateid"]; feedbackid = Request["feedbackid"]; pageid = Request["pageid"]; if (pageid != null) { Guid currentwikipage = new Guid(pageid); if (!String.IsNullOrEmpty(pageid)) { InitHeader(currentwikipage); } var wiki = (PXResult<WikiPage, WikiDescriptor, WikiRevision>)PXSelectJoin<WikiPage, InnerJoin <WikiDescriptor, On<WikiDescriptor.pageID, Equal<WikiPage.wikiID>>, InnerJoin <WikiRevision, On<WikiRevision.pageID, Equal<WikiPage.pageID>>>>, Where<WikiPage.pageID, Equal<Required<WikiPage.pageID>>>>.Select( new PXGraph(), currentwikipage); if (wiki == null) HideRateMenu(); else { var currentwiki = wiki[typeof (WikiDescriptor)] as WikiDescriptor; if (!PXSiteMap.IsPortal || currentwiki == null || currentwiki.SPWikiArticleType != WikiArticleType.KBArticle) { HideRateMenu(); } else { CreateRateMenu(Rate); } } } else { HideRateMenu(); } }