三、具体页面的构建
根据需求分析确定该系统划分为以下几个管理功能:
1. 登录模块
public String login(String userName,String userPw, int userType)
{
System.out.println("userType"+userType);
try
{
{
}
String result="no";
if(userType==0)//系统管理员登陆
{
String sql="select * from t_admin where userName=? and userPw=?";
Object[] params={userName,userPw};
DB mydb=new DB();
mydb.doPstm(sql, params);
try
{
ResultSet rs=mydb.getRs();
boolean mark=(rs==null||!rs.next()?false:true);
if(mark==false)
{
}
else
{
result="yes";
TAdmin admin=new TAdmin();
admin.setUserId(rs.getInt("userId"));
admin.setUserName(rs.getString("userName"));
admin.setUserPw(rs.getString("userPw"));
WebContext ctx = WebContextFactory.get();
HttpSession session=ctx.getSession();
Thread.sleep(700);
} catch (InterruptedException e)
// TODO Auto-generated catch block
e.printStackTrace();
result="no";
评论0
最新资源