public LoginValidationResult ValidateUserLogIn(string userName, string password)
        {
            if (this.DbContext.Logins.Count() == 0)
                return new LoginValidationResult
                {
                    IsSuccess = false,
                    Message = "No logins found."
                };

            var login = this.DbContext.Logins.FirstOrDefault(lg =>
                lg.User.UserName == userName && lg.Password == password && lg.IsActive);

            if (login == null)
                return new LoginValidationResult
                {
                    IsSuccess = false,
                    Message = "Login failed. Check user name and password and try again."
                };

            var userInfo = new UserService(DbContext).GetUserInfo(login.UserSeq);

            if (userInfo.IsActive == false)
                return new LoginValidationResult
                {
                    IsSuccess = false,
                    Message = "Account De-activated. Please contact system administrator."
                };

            return new LoginValidationResult
            {
                UserInfo = userInfo,
                IsSuccess = true,
            };
        }
 public LoginController(SecurityService securityService, UserService userService)
 {
     this.securityService = securityService;
     this.userService = userService;
 }