public void OpenSprint(Sprint sprint, string userId) { sprint.state = AppConstants.SPRINT_STATUS_OPEN; TransactionOptions _transcOptions = new TransactionOptions(); _transcOptions.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted; using (TransactionScope sc = new TransactionScope(TransactionScopeOption.Required, _transcOptions, EnterpriseServicesInteropOption.Full)) { try { uRepository.UpdateStateAndVersion(sprint); #region unlock diagrams DiagramService dService = (DiagramService) new ServiceLocator <Attachment>().locate(); var diagrams = dService.FindBySprint(sprint.Id); dService.UnLockDiagrams(diagrams, userId); #endregion sc.Complete(); } catch (Exception ex) { throw new Exception(ex.Message); } finally { sc.Dispose(); } } }
public void OpenStory(UserStory story, string userId) { TransactionOptions _transcOptions = new TransactionOptions(); _transcOptions.IsolationLevel = System.Transactions.IsolationLevel.ReadCommitted; using (TransactionScope sc = new TransactionScope(TransactionScopeOption.Required, _transcOptions, EnterpriseServicesInteropOption.Full)) { try { story.state = AppConstants.USERSTORY_STATUS_OPEN; uRepository.UpdateState(story); #region Save to history uRepository.SaveToHistory(story, userId); #endregion #region lock diagrams DiagramService dService = (DiagramService) new ServiceLocator <Attachment>().locate(); var diagrams = dService.FindByUserStory(story.Id); dService.UnLockDiagrams(diagrams, userId); #endregion sc.Complete(); } catch (Exception ex) { throw new Exception(AppConstants.EXCEPTION_GLOBAL); } finally { sc.Dispose(); } } }