Beispiel #1
0
        public int LockedUserLog(LockUnlockUser lockUnlockUser)
        {
            string query = @"insert into [LockedLog] (LockedDate, UserId) values (@LockedDate, @UserId)";

            using IDbConnection db = _connectionFactory.GetConnection;
            return(db.Execute(query, new { LockedDate = DateTime.Now, UserId = lockUnlockUser.Id }));
        }
 public bool LockUnlockUser(SessionContext sessionContext, LockUnlockUser lockUnlockUser)
 {
     try
     {
         int userOrganizationId = _userRepository.GetUserOrganization(lockUnlockUser.Id);
         if (!Helpers.IsInOrganizationContext(sessionContext, userOrganizationId))
         {
             return(false);
         }
         var isSuccess = _authenticationRepository.LockUnlockUser(lockUnlockUser);
         _logger.LockedUserLog(lockUnlockUser);
         return(isSuccess);
     }
     catch (Exception ex)
     {
         _logger.LogException(new ExceptionLog
         {
             ExceptionDate   = DateTime.Now,
             ExceptionMsg    = ex.Message,
             ExceptionSource = ex.Source,
             ExceptionType   = "UserService",
             FullException   = ex.StackTrace
         });
         return(false);
     }
 }
Beispiel #3
0
        public bool LockUnlockUser(LockUnlockUser lockUnlockUser)
        {
            string query = @"update [User] Set
                                Locked = @Locked
                            Where Id = @Id";

            using IDbConnection db = _connectionFactory.GetConnection;
            db.Execute(query, lockUnlockUser);
            return(true);
        }
Beispiel #4
0
 public async Task <int> LockedUserLog(LockUnlockUser lockUnlockUser)
 {
     return(await Task.Run(() => _loggerRepository.LockedUserLog(lockUnlockUser)));
 }