public override IList <VersionItem> GetAllVersions(string groupId) { using (var transaction = new TransactionScope(_configuration)) { var vDTS = new VersionItemDataStore(transaction); return(vDTS.FindAllByGroupId(groupId)); } }
/// <summary> /// Accepts groupId and Returns username of the person who has the item checked out. /// </summary> /// <param name="groupId"></param> /// <returns></returns> public override string GetCheckedOutUser(string groupId) { using (var transaction = new TransactionScope(_configuration)) { string userName = string.Empty; var vDTS = new VersionItemDataStore(transaction); IList <VersionItem> versions = vDTS.FindAllByGroupId(groupId); foreach (VersionItem version in versions) { if (!string.IsNullOrEmpty(version.UserName)) { userName = version.UserName; break; } } return(userName); } }
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(); } }