public static string GenerateLockMessage(LockStateResponseDto lockState) { if (lockState.FunctionalContext == null) { if (string.IsNullOrEmpty(lockState.ResourceCode)) { return(string.Empty); } else { return($"You have lost the lock of the {lockState.ResourceType} {lockState.ResourceCode}."); } } else if (messages.ContainsKey(lockState.FunctionalContext.Value)) { return(messages[lockState.FunctionalContext.Value].Invoke(lockState)); } return($"The {lockState.ResourceType} {lockState.ResourceCode} is already locked by {lockState.LockOwner}."); }
private static bool IsLockeByAnotherUserOrDifferentSession(LockStateResponseDto lockState) { return(lockState.IsLocked); }
private static bool NoLockRowFound(LockStateResponseDto lockState) { return(!lockState.IsLocked && lockState.ApplicationSessionId == null); }