package cn.itcast.dao.impl;
import java.util.ArrayList;
import cn.itcast.dao.UserDao;
import cn.itcast.pojo.User;
public class UserDaoImpl implements UserDao {
private static ArrayList<User> array = new ArrayList<User>();
public boolean isLogin(String username, String password) {
boolean flag = false;
for (User u : array) {
if (u.getUsername().equals(username)
&& u.getPassword().equals(password)) {
flag = true;
break;
}
}
return flag;
}
}
|
|