public List <string> LoginAccess(string username, string password) { StudentRepo repo = new StudentRepo(); if ((username != "giaovu" && password.Length < 8) || password.Length > 16) { return(new List <string>()); } return(repo.CheckAccount(username, password)); }
public string ChangePassword(string username, string password, string newPassword) { StudentRepo repo = new StudentRepo(); List <string> user = repo.CheckAccount(username, password); if (user.Count == 0) { return("Current password is not correct."); } if (repo.PasswordChanged(username, newPassword)) { return("Password has been changed successfully."); } else { return("Cannot change the password."); } }