public RevisionInformation Clone()
        {
            RevisionInformation copy = new RevisionInformation();

            copy.revisionID       = revisionID;
            copy.revisionSourceID = revisionSourceID;
            copy.revisionDate     = revisionDate;
            copy.userID           = userID;
            copy.notes            = notes;
            copy.hidden           = hidden;
            copy.draft            = draft;
            copy.deleted          = deleted;
            return(copy);
        }
Exemplo n.º 2
0
 public Result SaveRevision(string notes, bool draft, bool hidden, bool deleted)
 {
     if (notes == null)
     {
         notes = "";
     }
     try
     {
         using (TransactionScope scope = new TransactionScope())
         {
             DatabaseManager.DatabaseEngine.GetConnection();
             RevisionInformation rev = new RevisionInformation(0, 0, DateTime.UtcNow, SecurityProvider.CurrentUser.UserID, notes, hidden, draft, deleted);
             rev.RevisionID = DatabaseManager.GetUniqueID();
             if (pageID == 0)
             {
                 pageID = DatabaseManager.GetUniqueID();
             }
             rev.RevisionSourceID = pageID;
             revisionID           = rev.RevisionID;
             Result r = ContentManager.Instance.DataProvider.Store(rev);
             if (r.Succeeded)
             {
                 r = ContentManager.Instance.DataProvider.Store(this);
             }
             if (r.Succeeded && categorySelections != null)
             {
                 r = ContentManager.Instance.DataProvider.StorePageCategories(revisionID, categorySelections);
             }
             if (!r.Succeeded)
             {
                 return(r);
             }
             scope.Complete();
             revisionInformation = rev;
         }
     }
     finally
     {
         DatabaseManager.DatabaseEngine.ReleaseConnection();
     }
     return(new Result());
 }
 public RevisionInformation Clone()
 {
     RevisionInformation copy = new RevisionInformation();
     copy.revisionID = revisionID;
     copy.revisionSourceID = revisionSourceID;
     copy.revisionDate = revisionDate;
     copy.userID = userID;
     copy.notes = notes;
     copy.hidden = hidden;
     copy.draft = draft;
     copy.deleted = deleted;
     return copy;
 }
Exemplo n.º 4
0
 public Result SaveRevision(string notes, bool draft, bool hidden, bool deleted)
 {
     if (notes == null) notes = "";
     try
     {
         using (TransactionScope scope = new TransactionScope())
         {
             DatabaseManager.DatabaseEngine.GetConnection();
             RevisionInformation rev = new RevisionInformation(0, 0, DateTime.UtcNow, SecurityProvider.CurrentUser.UserID, notes, hidden, draft, deleted);
             rev.RevisionID = DatabaseManager.GetUniqueID();
             if (pageID == 0) pageID = DatabaseManager.GetUniqueID();
             rev.RevisionSourceID = pageID;
             revisionID = rev.RevisionID;
             Result r = ContentManager.Instance.DataProvider.Store(rev);
             if (r.Succeeded)
                 r = ContentManager.Instance.DataProvider.Store(this);
             if (r.Succeeded && categorySelections != null)
                 r = ContentManager.Instance.DataProvider.StorePageCategories(revisionID, categorySelections);
             if (!r.Succeeded)
                 return r;
             scope.Complete();
             revisionInformation = rev;
         }
     }
     finally
     {
         DatabaseManager.DatabaseEngine.ReleaseConnection();
     }
     return new Result();
 }