public static SetLockResult SetLock(Lock lockInfo, bool forceLock) { ExceptionHelper.TrueThrow <ArgumentNullException>(lockInfo == null, "lockInfo"); using (TransactionScope ts = TransactionScopeFactory.Create(TransactionScopeOption.Required)) { DataTable table = DbHelper.RunSPReturnDS("WF.SetLock", lockInfo.LockID, lockInfo.ResourceID, lockInfo.PersonID, lockInfo.EffectiveTime.TotalSeconds, lockInfo.LockType, TenantContext.Current.TenantCode, forceLock ? "y" : "n").Tables[0]; ts.Complete(); return(new SetLockResult(lockInfo.PersonID, table)); } }