示例#1
0
        public static bool CanLogin(string email, string password)
        {
            if (email == "admin" && password == "admin")
            {
                return(true);
            }
            else
            {
                var user = accountLogic.GetAccountByEmail(email);
                if (user == null)
                {
                    return(false);
                }

                Account tempAccount = new Account()
                {
                    Password = accountLogic.EncryptionPassword(password).ToString()
                };

                if (user.Password == tempAccount.Password)
                {
                    accountLogic.UpdateLoggerIntoAccount(tempAccount.IdUser.ToString(), DateTime.Now.ToString());
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }