public bool CancelSessionKeys(UserSystem userSystem, AuthorizationStatus oldStatus, DateTime dateBlock, AuthorizationStatus newStatus)
        {
            if (!userSystem.IdEntity.HasValue)
            {
                throw new ArgumentException($"Parameter {nameof(userSystem.IdEntity)} must be not empty", nameof(userSystem.IdEntity));
            }

            var idParam = new SqlParameter
            {
                ParameterName = "@IdEntity",
                Value         = userSystem.IdEntity.Value
            };
            var oldStatusParam = new SqlParameter
            {
                ParameterName = "@OldStatus",
                Value         = oldStatus.GetStatusName()
            };
            var finishKeyParam = new SqlParameter
            {
                ParameterName = "@FinishSession",
                Value         = dateBlock
            };
            var newStatusParam = new SqlParameter
            {
                ParameterName = "@NewStatus",
                Value         = newStatus.GetStatusName()
            };

            ExecuteCommand(SpCancelSessionKey, idParam, oldStatusParam, finishKeyParam, newStatusParam);

            return(true);
        }
        public bool CancelSessionKeys(int idUser, AuthorizationStatus oldStatus, DateTime dateBlock, AuthorizationStatus newStatus)
        {
            var idParam = new SqlParameter
            {
                ParameterName = "@IdEntity",
                Value         = idUser
            };
            var oldStatusParam = new SqlParameter
            {
                ParameterName = "@OldStatus",
                Value         = oldStatus.GetStatusName()
            };
            var finishKeyParam = new SqlParameter
            {
                ParameterName = "@FinishSession",
                Value         = dateBlock
            };
            var newStatusParam = new SqlParameter
            {
                ParameterName = "@NewStatus",
                Value         = newStatus.GetStatusName()
            };

            ExecuteCommand(SpCancelSessionKey, idParam, oldStatusParam, finishKeyParam, newStatusParam);

            return(true);
        }