private void SetValue(TableCell cell, Object value, String format) { String str = null; if (value != null) { if (value.GetType() == typeof(DateTime)) { str = ((DateTime)value).ToString(format ?? "g"); } else { str = value.ToString(); } } if (String.IsNullOrWhiteSpace(str)) { str = "<br>"; } cell.Height = 15; cell.HorizontalAlign = HorizontalAlign.Right; cell.BackColor = System.Drawing.Color.GhostWhite; if (value != null && value.GetType() == typeof(Boolean)) { PXImage img = new PXImage(); img.ImageUrl = ((Boolean)value) ? "control@GridCheck" : "control@GridUncheck"; cell.HorizontalAlign = HorizontalAlign.Center; cell.Controls.Add(img); } else if (value != null && value.GetType() == typeof(String)) { cell.Text = str; cell.HorizontalAlign = HorizontalAlign.Left; } else { cell.Text = str; } }
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(); } }
private void SetValue(TableCell cell, Object value, String format) { String str = null; if (value != null) { if(value.GetType() == typeof(DateTime)) { str = ((DateTime)value).ToString(format ?? "g"); } else str = value.ToString(); } if (String.IsNullOrWhiteSpace(str)) str = "<br>"; cell.Height = 15; cell.HorizontalAlign = HorizontalAlign.Right; cell.BackColor = System.Drawing.Color.GhostWhite; if (value != null && value.GetType() == typeof(Boolean)) { PXImage img = new PXImage(); img.ImageUrl = ((Boolean)value) ? "control@GridCheck" : "control@GridUncheck"; cell.HorizontalAlign = HorizontalAlign.Center; cell.Controls.Add(img); } else if (value != null && value.GetType() == typeof(String)) { cell.Text = str; cell.HorizontalAlign = HorizontalAlign.Left; } else cell.Text = str; }
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(); } }