private void CreateRateMenu(PXDropDown dd) { if (PXSiteMap.IsPortal) { String[] MarkList = new String[5] { PXMessages.LocalizeNoPrefix(Msg.Terrible), PXMessages.LocalizeNoPrefix(Msg.NotHelpful), PXMessages.LocalizeNoPrefix(Msg.Average), PXMessages.LocalizeNoPrefix(Msg.Helpful), PXMessages.LocalizeNoPrefix(Msg.Excellent) }; if (PXSiteMap.IsPortal) { PXListItem liall = new PXListItem("<" + PXMessages.LocalizeNoPrefix(Msg.SelectTip) + ">"); dd.Items.Add(liall); for (Int16 i = 5; i > 0; i--) { PXListItem li = new PXListItem(i.ToString() + " - " + MarkList[i - 1], i.ToString()); dd.Items.Add(li); } } for (int i = 0; i < dd.Items.Count; i++) { if (rateid == dd.Items[i].Value) { dd.SelectedIndex = i; } } } }
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 CreateRateMenu(PXDropDown dd) { if (PXSiteMap.IsPortal) { String Excellent = "Excellent "; String Helpful = "Helpful "; String Average = "Average "; String NotHelpful = "Not Helpful "; String Terrible = "Terrible "; String[] MarkList = new String[5] { Terrible, NotHelpful, Average, Helpful, Excellent }; if (PXSiteMap.IsPortal) { PXListItem liall = new PXListItem("<select>"); dd.Items.Add(liall); for (Int16 i = 5; i > 0; i--) { PXListItem li = new PXListItem(i.ToString() + " - " + MarkList[i - 1], i.ToString()); dd.Items.Add(li); } } for (int i = 0; i < dd.Items.Count; i++) { if (rateid == dd.Items[i].Value) { dd.SelectedIndex = i; } } } }
private void CreateProductMenu(PXGraph graph, PXDropDown dd) { PXListItem liall = new PXListItem(PXMessages.LocalizeNoPrefix(PX.SM.Messages.SearchProduct)); dd.Items.Add(liall); foreach (PXResult result in PXSelect <SPWikiProduct> .Select(graph)) { SPWikiProduct wc = result[typeof(SPWikiProduct)] as SPWikiProduct; PXListItem li = new PXListItem(wc.Description, wc.ProductID); dd.Items.Add(li); } for (int i = 0; i < dd.Items.Count; i++) { if (ProductID == dd.Items[i].Value) { dd.SelectedIndex = i; } } string path = PXUrl.SiteUrlWithPath(); path += path.EndsWith("/") ? "" : "/"; var url = string.Format("{0}Search/{1}?query={2}&adv=1", path, this.ResolveClientUrl("~/Search/Wiki.aspx"), txtSearch.Value); url = url + "&wikiid=" + WikiID + "&wikinumber=" + WikiNumber + "&categoryID=" + CategoryID + "&productID=" + SearchCaptionProduct.Value + "&orderID=" + OrderID + "&isWiki=" + IsWiki + "&globalsearchcaption=" + Globalsearchcaption; }
private void CreateOrderMenu(PXGraph graph, PXDropDown dd) { //public const string SearchCategory = "All category"; PXListItem li1 = new PXListItem("Order by Most Recent", "0"); dd.Items.Add(li1); PXListItem li2 = new PXListItem("Order by Views", "1"); dd.Items.Add(li2); PXListItem li3 = new PXListItem("Order by Rating", "2"); dd.Items.Add(li3); for (int i = 0; i < dd.Items.Count; i++) { if (OrderID == dd.Items[i].Value) { dd.SelectedIndex = i; } } string path = PXUrl.SiteUrlWithPath(); path += path.EndsWith("/") ? "" : "/"; var url = string.Format("{0}Search/{1}?query={2}&adv=1", path, this.ResolveClientUrl("~/Search/Wiki.aspx"), txtSearch.Value); url = url + "&wikiid=" + WikiID + "&wikinumber=" + WikiNumber + "&categoryID=" + CategoryID + "&productID=" + ProductID + "&orderID=" + OrderCaption.Value + "&isWiki=" + IsWiki + "&globalsearchcaption=" + Globalsearchcaption; }
/// <summary> /// Fill the branches drop-down list. /// </summary> private void FillBrachesList() { PXToolBarContainer cont = (PXToolBarContainer)tlbPath.Items["branch"]; PXDropDown dropDown = this.GetBranchCombo(); if (ControlHelper.IsReloadPage(dropDown)) { dropDown.CallbackUpdatable = true; } string currBranchId = null; int? currentBranch = PXAccess.GetBranchID(); List <PXAccess.BranchCollection.Info> items = GetBranches().ToList(); items.Sort((a, b) => string.Compare(a.Cd, b.Cd)); dropDown.Items.Clear(); foreach (PXAccess.BranchCollection.Info item in items) { var current = (currentBranch != null && currentBranch.Equals(item.Id)); dropDown.Items.Add(new PXListItem(item.Name, item.Id.ToString())); if (current) { currBranchId = item.Id.ToString(); } } if (PXAccess.FeatureInstalled("PX.Objects.CS.FeaturesSet+Branch") && dropDown.Items.Count > 0) { if (ControlHelper.IsReloadPage(tlbPath)) { tlbPath.CallbackUpdatable = true; } if (currentBranch != null) { dropDown.Value = currBranchId; } else { dropDown.Items.Insert(0, new PXListItem("Select Branch", null)); } dropDown.ItemChanged += Branch_ItemClick; } else { cont.Visible = false; PXToolBarLabel lbl = tlbPath.Items["branchLabel"] as PXToolBarLabel; if (lbl != null) { lbl.Visible = false; } lbl = tlbPath.Items["branchSep"] as PXToolBarLabel; if (lbl != null) { lbl.Visible = false; } } }
private void FillFontSizes(PXDropDown dd) { int[] size = new int[] { 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72 }; dd.Items.Clear(); foreach (int s in size) { dd.Items.Add(new PXListItem(string.Empty, s.ToString())); } }
private void FillColors(PXDropDown dd) { string[] colors = PXSpecialResources.ColorNames; dd.Items.Clear(); foreach (string n in colors) { string nLocalized = n; PXLocalizerRepository.SpecialLocalizer.LocalizeColorName(ref nLocalized); dd.Items.Add(new PXListItem(nLocalized, n)); } }
private void FillFonts(PXDropDown dd) { dd.Items.Clear(); string[] fonts = PXSpecialResources.FontNames; foreach (string ff in fonts) { string ffLocalized = ff; PXLocalizerRepository.SpecialLocalizer.LocalizeFontName(ref ffLocalized); dd.Items.Add(new PXListItem(ffLocalized, ff)); } }
private void FillFonts(PXDropDown dd) { dd.Items.Clear(); string[] fonts = PXSpecialResources.FontNames; foreach (string ff in fonts) { string ffLocalized = ff; PXLocalizerRepository.SpecialLocalizer.LocalizeFontName(ref ffLocalized); dd.Items.Add(new PXListItem(string.Empty, ffLocalized)); } }
private void FillColors(PXDropDown dd) { string[] colors = PXSpecialResources.ColorNames; dd.Items.Clear(); foreach (string n in colors) { string nLocalized = n; PXLocalizerRepository.SpecialLocalizer.LocalizeColorName(ref nLocalized); dd.Items.Add(new PXListItem(string.Empty, nLocalized)); } }
/// <summary> /// Find the braches drop down control. /// </summary> private PXDropDown GetBranchCombo() { PXToolBarContainer cont = (PXToolBarContainer)tlbPath.Items["branch"]; PXDropDown dropDown = null; foreach (Control c in cont.TemplateContainer.Controls) { if (c.ID == "cmdBranch") { dropDown = c as PXDropDown; break; } } return(dropDown); }
protected void Page_Load(object sender, EventArgs e) { string[] colors = PXSpecialResources.ColorNames; List <string> localizedColors = new List <string>(); PXDropDown dd = (PXDropDown)this.form.DataControls["edStyleColor"]; PXListItemCollection items = dd.Items; items.Clear(); foreach (string n in colors) { string nLocalized = n; PXLocalizerRepository.SpecialLocalizer.LocalizeColorName(ref nLocalized); localizedColors.Add(nLocalized); items.Add(new PXListItem(string.Empty, nLocalized)); } dd = (PXDropDown)this.form.DataControls["edStyleBackColor"]; items = dd.Items; items.Clear(); foreach (string n in localizedColors) { items.Add(new PXListItem(string.Empty, n)); } dd = (PXDropDown)this.form.DataControls["edStyleFontName"]; dd.Items.Clear(); string[] fonts = PXSpecialResources.FontNames; foreach (string ff in fonts) { string ffLocalized = ff; PXLocalizerRepository.SpecialLocalizer.LocalizeFontName(ref ffLocalized); dd.Items.Add(new PXListItem(string.Empty, ffLocalized)); } int[] size = new int[] { 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72 }; dd = (PXDropDown)this.form.DataControls["edStyleFontSize"]; items = dd.Items; items.Clear(); foreach (int s in size) { items.Add(new PXListItem(string.Empty, s.ToString())); } }
/// <summary> /// The branch menu item click event handler. /// </summary> private void Branch_ItemClick(object sender, PXListItemEventArgs e) { var targetBranch = int.Parse(e.Item.Value); if (targetBranch < 1) { return; } PXDropDown dropDown = this.GetBranchCombo(); foreach (PXAccess.BranchCollection.Info item in GetBranches()) { if (targetBranch.Equals(item.Id)) { PXContext.SetBranchID(targetBranch); HttpCookie branchCooky = HttpContext.Current.Response.Cookies["UserBranch"]; if (dropDown != null) { dropDown.Value = item.Id; } //if (this.Page is PXPage) ((PXPage)this.Page).ResetCurrentUser(HttpContext.Current); string branchObj = targetBranch.ToString(); if (branchCooky == null) { HttpContext.Current.Response.Cookies.Add(new HttpCookie("UserBranch", branchObj)); } else { branchCooky.Value = branchObj; } break; } } }
private void CreateWikiMenu(PXGraph graph, PXDropDown dd) { PXListItem liall = new PXListItem("Entire Help"); dd.Items.Add(liall); foreach (PXResult result in PXSelect <WikiDescriptor> .Select(graph)) { WikiDescriptor wiki = result[typeof(WikiDescriptor)] as WikiDescriptor; if (wiki != null && wiki.PageID != null) { var node = PXSiteMap.Provider.FindSiteMapNodeFromKey((Guid)wiki.PageID); if (node != null) { string title = wiki.WikiTitle ?? node.Title; PXListItem li = new PXListItem(title, wiki.PageID.ToString()); dd.Items.Add(li); } } } for (int i = 0; i < dd.Items.Count; i++) { if (WikiID == dd.Items[i].Value) { dd.SelectedIndex = i; } } string path = PXUrl.SiteUrlWithPath(); var url = ""; path = PXUrl.SiteUrlWithPath(); path += path.EndsWith("/") ? "" : "/"; url = string.Format("{0}Search/{1}?query={2}&adv=1", path, this.ResolveClientUrl("~/Search/Wiki.aspx"), txtSearch.Value); url = url + "&wikiid=" + SearchCaption.Value + "&wikinumber=" + SearchCaption.SelectedIndex.ToString() + "&categoryID=" + CategoryID + "&productID=" + ProductID + "&orderID=" + OrderID + "&isWiki=1" + "&globalsearchcaption=" + Globalsearchcaption; }
protected void Page_Init(object sender, EventArgs e) { RMReportMaint graph = (RMReportMaint)ds.DataGraph; PXDataSourceViewSchema schema = ds.GetSchema("Report"); RMReport currentReport = graph.Report.Current; RMRowSet currentRowSet = (RMRowSet)graph.Caches[typeof(RMRowSet)].Current; RMColumnSet currentColumnSet = (RMColumnSet)graph.Caches[typeof(RMColumnSet)].Current; RMUnitSet currentUnitSet = (RMUnitSet)graph.Caches[typeof(RMUnitSet)].Current; string currentTypeReport = currentReport != null ? currentReport.Type : null; RMDataSource currentDataSource = graph.DataSourceByID.Current; if (currentTypeReport == null) { graph.Report.Current = currentReport = new RMReport(); } if (currentRowSet == null) { graph.Caches[typeof(RMRowSet)].Current = new RMRowSet(); } graph.Caches[typeof(RMColumnSet)].Current = null; graph.Caches[typeof(RMUnitSet)].Current = null; Dictionary <string, List <PXFieldSchema> > controls = new Dictionary <string, List <PXFieldSchema> >(); string[] arrTypes = ((PXStringState)graph.Report.Cache.GetStateExt <RMReport.type>(null)).AllowedValues; foreach (string type in arrTypes) { graph.Report.Current.Type = type; ((RMRowSet)graph.Caches[typeof(RMRowSet)].Current).Type = type; graph.Report.Current = currentReport; graph.DataSourceByID.Current = null; List <PXFieldSchema> lControls = new List <PXFieldSchema>(); List <PXFieldSchema> list = RefreshFieldsList(schema, graph); foreach (PXFieldSchema f in list) { if (f.DataType == TypeCode.Object) { continue; } if (!ContainsControlDictionary(f, controls)) { lControls.Add(f); } } controls.Add(type, lControls); } if (currentTypeReport == null) { graph.Report.Cache.Clear(); } else { graph.Report.Current.Type = currentTypeReport; } graph.DataSourceByID.Current = currentDataSource; graph.Caches[typeof(RMRowSet)].Current = currentRowSet; graph.Caches[typeof(RMColumnSet)].Current = currentColumnSet; graph.Caches[typeof(RMUnitSet)].Current = currentUnitSet; _insertIndex = 0; foreach (Control control in this.form.TemplateContainer.Controls) { if (!string.IsNullOrEmpty(control.ID)) { if (!control.ID.Equals("edStartUnitCode", StringComparison.OrdinalIgnoreCase)) { _insertIndex++; } else { break; } } else { _insertIndex++; } } _insertIndex++; PXLayoutRule rule1 = new PXLayoutRule() { ID = "rule1", StartGroup = true, GroupCaption = "Default Data Source Settings" }; (rule1).ApplyStyleSheetSkin(this.Page); this.form.TemplateContainer.Controls.AddAt(_insertIndex, rule1); _insertIndex++; for (int c = arrTypes.Length - 1; c >= 0; c--) { string type = arrTypes[c]; List <PXFieldSchema> lDsControls = new List <PXFieldSchema>(); for (int i = 0; i < controls[type].Count; i++) { if (controls[type][i].DataField.StartsWith("DataSource", StringComparison.OrdinalIgnoreCase) && !controls[type][i].DataField.Equals("datasourceexpand", StringComparison.OrdinalIgnoreCase) && !controls[type][i].DataField.Equals("datasourceamounttype", StringComparison.OrdinalIgnoreCase) && !controls[type][i].DataField.Equals("datasourcestartPeriodOffset", StringComparison.OrdinalIgnoreCase) && !controls[type][i].DataField.Equals("datasourceEndPeriodOffset", StringComparison.OrdinalIgnoreCase) //ContainsControl("Request" + controls[type][i].DataField.Replace("DataSource", string.Empty), controls[type]) ) { lDsControls.Add(controls[type][i]); } } int cntFirstColumn = lDsControls.Count / 2; if ((lDsControls.Count % 2) > 0) { cntFirstColumn++; } for (int i = 0; i < cntFirstColumn; i++) { AddControl(lDsControls[i], controls[type]); if ((lDsControls.Count - 1) >= (i + cntFirstColumn)) { AddControl(lDsControls[i + cntFirstColumn], controls[type]); } } } PXDropDown edDataSourceAmountType = new PXDropDown() { ID = "edDataSourceAmountType", AllowNull = false, DataField = "DataSourceAmountType" }; form.TemplateContainer.Controls.AddAt(_insertIndex, edDataSourceAmountType); (edDataSourceAmountType).ApplyStyleSheetSkin(this.Page); _insertIndex++; PXCheckBox chkApplyRestrictionGroups = new PXCheckBox() { ID = "chkApplyRestrictionGroups", DataField = "ApplyRestrictionGroups" }; form.TemplateContainer.Controls.AddAt(_insertIndex, chkApplyRestrictionGroups); (chkApplyRestrictionGroups).ApplyStyleSheetSkin(this.Page); }
/// <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); }
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(); } }
private void FillFontSizes(PXDropDown dd) { int[] size = new int[] { 8, 9, 10, 11, 12, 14, 16, 18, 20, 22, 24, 26, 28, 36, 48, 72 }; dd.Items.Clear(); foreach (int s in size) dd.Items.Add(new PXListItem(string.Empty, s.ToString())); }
private void CreateGlobalSearchCaption(PXGraph graph, PXDropDown dd) { PXListItem liWikis = new PXListItem("Help"); dd.Items.Add(liWikis); PXListItem liEntities = new PXListItem("Entities"); dd.Items.Add(liEntities); PXListItem liFiles = new PXListItem("Files"); dd.Items.Add(liFiles); PXListItem liNotes = new PXListItem("Notes"); dd.Items.Add(liNotes); PXListItem liScreens = new PXListItem("Form Titles"); dd.Items.Add(liScreens); Int32 select; Int32.TryParse(Globalsearchcaption, out select); dd.SelectedIndex = select; string path = PXUrl.SiteUrlWithPath(); var url = ""; switch (dd.SelectedIndex) { case 0: path = PXUrl.SiteUrlWithPath(); path += path.EndsWith("/") ? "" : "/"; url = string.Format("{0}Search/{1}?query={2}&adv=1", path, this.ResolveClientUrl("~/Search/Wiki.aspx"), txtSearch.Value); url = url + "&wikiid=" + WikiID + "&wikinumber=" + WikiNumber + "&categoryID=" + CategoryID + "&productID=" + ProductID + "&orderID=" + OrderID + "&isWiki=1" + "&globalsearchcaption=" + dd.SelectedIndex.ToString(); break; case 1: path = PXUrl.SiteUrlWithPath(); path += path.EndsWith("/") ? "" : "/"; url = string.Format("{0}Search/{1}?query={2}&adv=1", path, this.ResolveClientUrl("~/Search/Entity.aspx"), txtSearch.Value); url = url + "&wikiid=" + WikiID + "&wikinumber=" + WikiNumber + "&categoryID=" + CategoryID + "&productID=" + ProductID + "&orderID=" + OrderID + "&isWiki=0" + "&globalsearchcaption=" + dd.SelectedIndex.ToString(); break; case 2: path = PXUrl.SiteUrlWithPath(); path += path.EndsWith("/") ? "" : "/"; url = string.Format("{0}Search/{1}?query={2}&adv=1", path, this.ResolveClientUrl("~/Search/File.aspx"), txtSearch.Value); url = url + "&wikiid=" + WikiID + "&wikinumber=" + WikiNumber + "&categoryID=" + CategoryID + "&productID=" + ProductID + "&orderID=" + OrderID + "&isWiki=0" + "&globalsearchcaption=" + dd.SelectedIndex.ToString(); break; case 3: path = PXUrl.SiteUrlWithPath(); path += path.EndsWith("/") ? "" : "/"; url = string.Format("{0}Search/{1}?query={2}&adv=1", path, this.ResolveClientUrl("~/Search/Note.aspx"), txtSearch.Value); url = url + "&wikiid=" + WikiID + "&wikinumber=" + WikiNumber + "&categoryID=" + CategoryID + "&productID=" + ProductID + "&orderID=" + OrderID + "&isWiki=0" + "&globalsearchcaption=" + dd.SelectedIndex.ToString(); break; case 4: path = PXUrl.SiteUrlWithPath(); path += path.EndsWith("/") ? "" : "/"; url = string.Format("{0}Search/{1}?query={2}&adv=1", path, this.ResolveClientUrl("~/Search/FormsTitle.aspx"), txtSearch.Value); url = url + "&wikiid=" + WikiID + "&wikinumber=" + WikiNumber + "&categoryID=" + CategoryID + "&productID=" + ProductID + "&orderID=" + OrderID + "&isWiki=0" + "&globalsearchcaption=" + dd.SelectedIndex.ToString(); break; } }
private void CreateWikiMenu(PXGraph graph, PXDropDown dd) { PXListItem liall = new PXListItem("Entire Help"); dd.Items.Add(liall); foreach (PXResult result in PXSelect<WikiDescriptor>.Select(graph)) { WikiDescriptor wiki = result[typeof(WikiDescriptor)] as WikiDescriptor; if (wiki != null && wiki.PageID != null) { var node = PXSiteMap.Provider.FindSiteMapNodeFromKey((Guid)wiki.PageID); if (node != null) { string title = wiki.WikiTitle ?? node.Title; PXListItem li = new PXListItem(title, wiki.PageID.ToString()); dd.Items.Add(li); } } } for (int i = 0; i < dd.Items.Count; i++) { if (WikiID == dd.Items[i].Value) { dd.SelectedIndex = i; } } string path = PXUrl.SiteUrlWithPath(); path += path.EndsWith("/") ? "" : "/"; var url = string.Format("{0}Search/{1}?query={2}&adv=1", path, this.ResolveClientUrl("~/Search/WikiSP.aspx"), txtSearch.Value); url = url + "&wikiid=" + SearchCaption.Value + "&wikinumber=" + SearchCaption.SelectedIndex.ToString() + "&categoryID=" + CategoryID + "&productID=" + ProductID + "&orderID=" + OrderID; }
private void CreateProductMenu(PXGraph graph, PXDropDown dd) { PXListItem liall = new PXListItem(PXMessages.LocalizeNoPrefix(PX.SM.Messages.SearchProduct)); dd.Items.Add(liall); foreach (PXResult result in PXSelect<SPWikiProduct>.Select(graph)) { SPWikiProduct wc = result[typeof(SPWikiProduct)] as SPWikiProduct; PXListItem li = new PXListItem(wc.Description, wc.ProductID); dd.Items.Add(li); } for (int i = 0; i < dd.Items.Count; i++) { if (ProductID == dd.Items[i].Value) { dd.SelectedIndex = i; } } string path = PXUrl.SiteUrlWithPath(); path += path.EndsWith("/") ? "" : "/"; var url = string.Format("{0}Search/{1}?query={2}&adv=1", path, this.ResolveClientUrl("~/Search/WikiSP.aspx"), txtSearch.Value); url = url + "&wikiid=" + WikiID + "&wikinumber=" + WikiNumber + "&categoryID=" + CategoryID + "&productID=" + SearchCaptionProduct.Value + "&orderID=" + OrderID; }
protected void Page_Init(object sender, EventArgs e) { RMReportMaint graph = (RMReportMaint)ds.DataGraph; PXDataSourceViewSchema schema = ds.GetSchema("Report"); RMReport currentReport = graph.Report.Current; RMRowSet currentRowSet = (RMRowSet)graph.Caches[typeof(RMRowSet)].Current; RMColumnSet currentColumnSet = (RMColumnSet)graph.Caches[typeof(RMColumnSet)].Current; RMUnitSet currentUnitSet = (RMUnitSet)graph.Caches[typeof(RMUnitSet)].Current; string currentTypeReport = currentReport != null ? currentReport.Type : null; RMDataSource currentDataSource = graph.DataSourceByID.Current; if (currentTypeReport == null) { graph.Report.Current = currentReport = new RMReport(); } if (currentRowSet == null) { graph.Caches[typeof(RMRowSet)].Current = new RMRowSet(); } graph.Caches[typeof(RMColumnSet)].Current = null; graph.Caches[typeof(RMUnitSet)].Current = null; Dictionary<string, List<PXFieldSchema>> controls = new Dictionary<string, List<PXFieldSchema>>(); string[] arrTypes = ((PXStringState)graph.Report.Cache.GetStateExt<RMReport.type>(null)).AllowedValues; foreach (string type in arrTypes) { graph.Report.Current.Type = type; ((RMRowSet)graph.Caches[typeof(RMRowSet)].Current).Type = type; graph.Report.Current = currentReport; graph.DataSourceByID.Current = null; List<PXFieldSchema> lControls = new List<PXFieldSchema>(); List<PXFieldSchema> list = RefreshFieldsList(schema, graph); foreach (PXFieldSchema f in list) { if (f.DataType == TypeCode.Object) continue; if (!ContainsControlDictionary(f, controls)) { lControls.Add(f); } } controls.Add(type, lControls); } if (currentTypeReport == null) { graph.Report.Cache.Clear(); } else { graph.Report.Current.Type = currentTypeReport; } graph.DataSourceByID.Current = currentDataSource; graph.Caches[typeof(RMRowSet)].Current = currentRowSet; graph.Caches[typeof(RMColumnSet)].Current = currentColumnSet; graph.Caches[typeof(RMUnitSet)].Current = currentUnitSet; _insertIndex = 0; foreach (Control control in this.form.TemplateContainer.Controls) { if (!string.IsNullOrEmpty(control.ID)) { if (!control.ID.Equals("edStartUnitCode", StringComparison.OrdinalIgnoreCase)) _insertIndex++; else break; } else _insertIndex++; } _insertIndex++; PXLayoutRule rule1 = new PXLayoutRule() { ID = "rule1", StartGroup = true, GroupCaption = "Default Data Source Settings" }; (rule1).ApplyStyleSheetSkin(this.Page); this.form.TemplateContainer.Controls.AddAt(_insertIndex, rule1); _insertIndex++; for (int c = arrTypes.Length - 1; c >= 0; c--) { string type = arrTypes[c]; List<PXFieldSchema> lDsControls = new List<PXFieldSchema>(); for (int i = 0; i < controls[type].Count; i++) { if (controls[type][i].DataField.StartsWith("DataSource", StringComparison.OrdinalIgnoreCase) && !controls[type][i].DataField.Equals("datasourceexpand", StringComparison.OrdinalIgnoreCase) && !controls[type][i].DataField.Equals("datasourceamounttype", StringComparison.OrdinalIgnoreCase) && !controls[type][i].DataField.Equals("datasourcestartPeriodOffset", StringComparison.OrdinalIgnoreCase) && !controls[type][i].DataField.Equals("datasourceEndPeriodOffset", StringComparison.OrdinalIgnoreCase) //ContainsControl("Request" + controls[type][i].DataField.Replace("DataSource", string.Empty), controls[type]) ) { lDsControls.Add(controls[type][i]); } } int cntFirstColumn = lDsControls.Count / 2; if ((lDsControls.Count % 2) > 0) cntFirstColumn++; for (int i = 0; i < cntFirstColumn; i++) { AddControl(lDsControls[i], controls[type]); if ((lDsControls.Count - 1) >= (i + cntFirstColumn)) AddControl(lDsControls[i + cntFirstColumn], controls[type]); } } PXDropDown edDataSourceAmountType = new PXDropDown() { ID = "edDataSourceAmountType", AllowNull = false, DataField = "DataSourceAmountType" }; form.TemplateContainer.Controls.AddAt(_insertIndex, edDataSourceAmountType); (edDataSourceAmountType).ApplyStyleSheetSkin(this.Page); _insertIndex++; PXCheckBox chkApplyRestrictionGroups = new PXCheckBox() { ID = "chkApplyRestrictionGroups", DataField = "ApplyRestrictionGroups" }; form.TemplateContainer.Controls.AddAt(_insertIndex, chkApplyRestrictionGroups); (chkApplyRestrictionGroups).ApplyStyleSheetSkin(this.Page); }
private void CreateOrderMenu(PXGraph graph, PXDropDown dd) { PXListItem li1 = new PXListItem("Order by Most Recent", "0"); dd.Items.Add(li1); PXListItem li2 = new PXListItem("Order by Views", "1"); dd.Items.Add(li2); PXListItem li3 = new PXListItem("Order by Rating", "2"); dd.Items.Add(li3); for (int i = 0; i < dd.Items.Count; i++) { if (OrderID == dd.Items[i].Value) { dd.SelectedIndex = i; } } string path = PXUrl.SiteUrlWithPath(); path += path.EndsWith("/") ? "" : "/"; var url = string.Format("{0}Search/{1}?query={2}&adv=1", path, this.ResolveClientUrl("~/Search/WikiSP.aspx"), txtSearch.Value); url = url + "&wikiid=" + WikiID + "&wikinumber=" + WikiNumber + "&categoryID=" + CategoryID + "&productID=" +ProductID + "&orderID=" + OrderCaption.Value; }
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(); } }
/// <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; }