Exemple #1
0
        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}.");
        }
Exemple #2
0
 private static bool IsLockeByAnotherUserOrDifferentSession(LockStateResponseDto lockState)
 {
     return(lockState.IsLocked);
 }
Exemple #3
0
 private static bool NoLockRowFound(LockStateResponseDto lockState)
 {
     return(!lockState.IsLocked && lockState.ApplicationSessionId == null);
 }