Пример #1
0
 public override void UpdateVersionItem(VersionItem item)
 {
     using (var transaction = new TransactionScope(_configuration))
     {
         var vDTS = new VersionItemDataStore(transaction);
         vDTS.Update(item);
         transaction.Commit();
     }
 }
Пример #2
0
        public static void DeleteVersionItem(VersionItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            Provider.DeleteVersionItem(item);
        }
Пример #3
0
 public override void CheckOutVersion(string versionId, string userName)
 {
     using (var transaction = new TransactionScope(_configuration))
     {
         var         vDTS    = new VersionItemDataStore(transaction);
         VersionItem version = vDTS.FindGroupIdByVersionId(versionId);
         version.UserName = userName;
         vDTS.Update(version);
         transaction.Commit();
     }
 }
Пример #4
0
        public string GetNextVersionNumber(VersionType versionType, string itemId)
        {
            string versionNumber = string.Empty;

            //find the version item with the id
            // pass in the versionnumber

            using (var transaction = new TransactionScope(_configuration))
            {
                var vDTS = new VersionItemDataStore(transaction);

                //VersionItem item = vDTS.FindAll().First<VersionItem>(x => x.ItemId.Equals(ItemId));
                VersionItem item          = vDTS.FindGroupIdByItemId(itemId);
                VersionItem latestVersion = vDTS.FindVersionByGroupId(item.GroupId);
                return(GenerateVersionNumber(versionType, latestVersion.VersionNumber));
            }
        }
Пример #5
0
        public override bool IsLatestVersion(string versionId)
        {
            VersionItem item = GetVersionItemById(versionId);

            if (item != null)
            {
                VersionItem latestVersion = GetAllVersions(item.GroupId).First <VersionItem>();
                if (latestVersion.Id.Equals(item.Id))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            return(true);
        }
Пример #6
0
        public override void CheckInVersion(string versionId)
        {
            if (string.IsNullOrEmpty(versionId))
            {
                throw new ArgumentNullException("versionId");
            }

            using (var transaction = new TransactionScope(_configuration))
            {
                var                 vDTS     = new VersionItemDataStore(transaction);
                VersionItem         version  = vDTS.FindGroupIdByVersionId(versionId);
                IList <VersionItem> versions = vDTS.FindAllByGroupId(version.GroupId);
                foreach (VersionItem vers in versions)
                {
                    vers.UserName = null;
                    vDTS.Update(vers);
                }
                transaction.Commit();
            }
        }
Пример #7
0
 public abstract void DeleteVersionItem(VersionItem Item);
Пример #8
0
 public abstract void UpdateVersionItem(VersionItem Item);
Пример #9
0
 public abstract void CreateVersionItem(VersionItem Item);