public boolean UserLogin(User u) {
userDAO userDao = new userDAO();
ArrayList<User> list = userDao.getUser();
int i= 0;
if (list != null && list.size() > 0) {
for (User c : list) {
if (c.getUsername().equals(u.getUsername())
&& c.getPassword().equals(u.getPassword())) {
i=1;break;
}else i=0;
}
}
if(i==1){
return true;
}else if(i==0){
return false;
}
}
qq___524
相关分类