コード例 #1
0
ファイル: ShowPage.cs プロジェクト: blanks88/AcumaticaT100
    protected void show_SectionUpdated(object sender, PXWikiSectionEventArgs e)
    {
        WikiPage current  = this.CurrentRec;
        PXGraph  graph    = null;
        WikiPage art      = null;
        Type     wikiType = Wiki.GraphType(current.ArticleType);

        graph = (PXGraph)PXGraph.CreateInstance(wikiType);
        graph.Views["Filter"].Cache.SetValue(graph.Views["Filter"].Cache.Current, "PageID", current.PageID);
        graph.Views["Filter"].Cache.SetValue(graph.Views["Filter"].Cache.Current, "PageRevisionID", 0);
        art = (WikiPage)graph.Views["Pages"].SelectSingle();

        if (art != null)
        {
            art.Content = e.Content;
            art         = graph.Views["Pages"].Cache.Update(art) as WikiPage;
            graph.Persist();
        }

        graph.Views["Pages"].Clear();
        graph.Views["Pages"].Cache.Clear();
        graph.Views["Revisions"].Clear();
        graph.Views["Revisions"].Cache.Clear();
        this.DS.DataGraph.Views["Pages"].Clear();
        this.DS.DataGraph.Views["Pages"].Cache.Clear();
        this.DS.DataGraph.Views["Revisions"].Clear();
        this.DS.DataGraph.Views["Revisions"].Cache.Clear();
        this.DS.DataGraph.TypedViews.Clear();
        this.DS.DataGraph.Caches[typeof(WikiPageLanguage)].Clear();
    }
コード例 #2
0
 private static Type GetCorrectGraphType(int?type)
 {
     if (type == WikiArticleTypeAttribute._KB_ARTICLE_TYPE)
     {
         return(typeof(KBArticleMaint));
     }
     return(Wiki.GraphType(type));
 }