private void PersistAM()
            {
                var cached = _graph.Caches[_activityMessage.GetType()].Locate(_activityMessage);

                _graph.Persist();
                _graph.SelectTimeStamp();
                var cache = _graph.Caches[_activityMessage.GetType()];

                _activityMessage = (CRSMEmail)cache.CreateCopy(cached);
            }
예제 #2
0
    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();
    }
            private void PersistMessage()
            {
                var cached = _graph.Caches[_message.GetType()].Locate(_message);

                _graph.Persist();
                _graph.SelectTimeStamp();
                var cache = _graph.Caches[_message.GetType()];

                _message = (EPActivity)cache.CreateCopy(cached);
            }
예제 #4
0
            private void UpdateMessage(SMEmail message)
            {
                var emailType = message.GetType();
                var cache     = _graph.Caches[emailType];

                message = (SMEmail)cache.Update(message);
                _graph.EnsureCachePersistence(emailType);
                var cached = _graph.Caches[message.GetType()].Locate(message);

                _graph.Persist();
                _graph.SelectTimeStamp();
                message = (SMEmail)cache.CreateCopy(cached);
            }
        /// <summary>
        /// AttachDataAsFile
        /// </summary>
        /// <remarks>Invoke before persisting of DAC</remarks>
        public static void AttachDataAsFile(string fileName, string data, IDACWithNote dac, PXGraph graph)
        {
            var file = new FileInfo(Guid.NewGuid(), fileName, null, SerializationHelper.GetBytes(data));

            var uploadFileMaintGraph = PXGraph.CreateInstance <UploadFileMaintenance>();

            if (uploadFileMaintGraph.SaveFile(file) || file.UID == null)
            {
                var fileNote = new NoteDoc {
                    NoteID = dac.NoteID, FileID = file.UID
                };

                graph.Caches[typeof(NoteDoc)].Insert(fileNote);

                graph.Persist(typeof(NoteDoc), PXDBOperation.Insert);
            }
        }