示例#1
0
        public static void PublishAdvancedArticle(int nodeID, string lang, int rank)
        {
            AdvancedArticle publicArticle;
            int             c = SFGlobal.ObjectManagerPublic.GetObjectCount(typeof(AdvancedArticle), "nodeID=" + nodeID + " AND lang = '" + lang + "' AND rank=" + rank);

            if (c > 0)
            {
                publicArticle = (AdvancedArticle)SFGlobal.ObjectManagerPublic.GetObject(new OPathQuery(typeof(AdvancedArticle), "NodeID=" + nodeID + " && Lang='" + lang + "' && Rank=" + rank));
            }
            else
            {
                publicArticle = (AdvancedArticle)SFGlobal.ObjectManagerPublic.GetObject(typeof(AdvancedArticle));
            }

            AdvancedArticle currentArticle = (AdvancedArticle)SFGlobal.ObjectManager.GetObject(new OPathQuery(typeof(AdvancedArticle), "NodeID=" + nodeID + " && Lang='" + lang + "' && Rank=" + rank));

            publicArticle.Rank         = currentArticle.Rank;
            publicArticle.Title        = currentArticle.Title;
            publicArticle.Body         = currentArticle.Body;
            publicArticle.Keyword      = currentArticle.Keyword;
            publicArticle.Lang         = currentArticle.Lang;
            publicArticle.NodeID       = currentArticle.NodeID;
            publicArticle.Summary      = currentArticle.Summary;
            publicArticle.TemplateID   = currentArticle.TemplateID;
            publicArticle.UserID       = currentArticle.UserID;
            publicArticle.DateCreated  = currentArticle.DateCreated;
            publicArticle.DateModified = currentArticle.DateModified;

            SFGlobal.ObjectManagerPublic.PersistChanges(publicArticle);
            SFGlobal.ObjectManager.PersistChanges(currentArticle);
        }
示例#2
0
 public void Add(AdvancedArticle a)
 {
     this.List.Add(a);
 }