public void ReleaseLock(YellowstonePathology.Business.Test.AccessionOrder accessionOrder, object writer) { DocumentId documentId = new DocumentId(accessionOrder, writer); Document document = this.Get(documentId); if (document != null) { if (accessionOrder.IsLockAquiredByMe == true) { accessionOrder.ReleaseLock(); document.IsLockAquiredByMe = false; } document.Submit(); } else { throw new Exception("You are trying to release the lock on a document that is not in the stack."); } }