资源简介

于Java EE的农产品网络营销管理系统的设计与实现 毕业设计 源码开放,完美运行

资源截图

代码片段和文件信息

package com.wlyx.action;

import java.util.List;

import javax.servlet.http.HttpSession;

import org.apache.struts2.ServletActionContext;

import com.wlyx.pojo.Admin;

public class AdminAction extends baseAction{
private Admin admin;
private boolean result;
private int addResult;
private int id;
private String oldPwd;
private String newPwd;
private String adminname;
private String msg;


private List adminList; 

public String execute(){
HttpSession session=ServletActionContext.getRequest().getSession();
Admin u=adminDao.login(admin);
if(u!=null){
result=true;
session.setAttribute(“LoginAdmin“u);
}
return “result“;
}

public String addAdmin(){
if(adminDao.checkAdminName(admin.getUserName())){
result=adminDao.addAdmin(admin);
if(!result){
msg=“注册失败请检查数据库连接!“;
}
return result?“success“:“fail“;
}else{
msg=“该管理员已存在!“;
return “fail“;
}
}

public String addUser(){
if(adminDao.checkUserName(admin.getUserName())){
result=adminDao.addUser(admin);
if(!result){
msg=“注册失败请检查数据库连接!“;
}
return result?“success“:“fail“;
}else{
msg=“该管理员已存在!“;
return “fail“;
}
}

public String changeAdminPwd(){
HttpSession session=ServletActionContext.getRequest().getSession();
if(adminDao.checkAdminPwd((Admin)session.getAttribute(“LoginAdmin“)oldPwd)){
Admin a=(Admin)session.getAttribute(“LoginAdmin“);
a.setPwd(newPwd);
adminDao.changeAdminPwd(a);
return “success“;
}else{
msg=“原始密码错误!“;
return “fail“;
}

}

public String delAdmin(){
addResult=adminDao.delAdmin(id);
return “success“;
}

public String logout(){
HttpSession session=ServletActionContext.getRequest().getSession();
session.removeAttribute(“LoginAdmin“);
return “success“;
}

public String getAllAdmins(){
if(admin!=null && !admin.getUserName().equals(““)){
adminList=adminDao.getUsersByName(admin.getUserName());
}else{
adminList=adminDao.getAllUsers();
}
return “success“;
}

public String getAllUsers(){
if(admin!=null && !admin.getName().equals(““)){
adminList=adminDao.getUsersByName(admin.getName());
}else{
adminList=adminDao.getAllUsers();
}
return “success“;
}


public String checkAdminName(){
result=adminDao.checkAdminName(adminname);
return “success“;
}

public String showAdminInfo(){
HttpSession session=ServletActionContext.getRequest().getSession();
Admin u=(Admin)session.getAttribute(“LoginAdmin“);
admin=adminDao.findByAdminId(u.getId());
return “success“;
}

public String editAdminInfo(){
HttpSession session=ServletActionContext.getRequest().getSession();
Admin u=(Admin)session.getAttribute(“LoginAdmin“);
admin=adminDao.findByAdminId(u.getId());
return “success“;
}

public String editUserInfo(){
admin=adminDao.findByAdminId(id);
return “success“;
}

public String upda

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       2918  2013-04-01 13:46  wlyx\.classpath

     文件        285  2013-05-18 11:30  wlyx\.mymetadata

     文件       1277  2013-04-01 15:40  wlyx\.project

     文件        495  2013-05-14 21:17  wlyx\.settings\org.eclipse.core.resources.prefs

     文件        330  2013-04-01 13:33  wlyx\.settings\org.eclipse.jdt.core.prefs

     文件    3145728  2013-05-20 12:19  wlyx\db\wlyx.mdf

     文件    1048576  2013-05-20 12:19  wlyx\db\wlyx_log.ldf

     文件       2927  2013-05-06 10:51  wlyx\src\.struts.mex

     文件       2996  2013-05-14 19:11  wlyx\src\applicationContext.xml

     文件       4568  2013-05-06 19:35  wlyx\src\com\wlyx\action\AdminAction.java

     文件       3820  2013-05-14 20:36  wlyx\src\com\wlyx\action\baseAction.java

     文件       3081  2013-05-06 18:57  wlyx\src\com\wlyx\action\BBSAction.java

     文件       2674  2013-05-06 22:33  wlyx\src\com\wlyx\action\BwAction.java

     文件       3045  2013-05-06 20:27  wlyx\src\com\wlyx\action\CustomerAction.java

     文件       2898  2013-05-14 19:23  wlyx\src\com\wlyx\action\GoodsAction.java

     文件       3460  2013-05-14 21:26  wlyx\src\com\wlyx\action\GoodsRsAction.java

     文件       4110  2013-05-06 23:12  wlyx\src\com\wlyx\action\ProjectAction.java

     文件       2678  2013-05-06 22:10  wlyx\src\com\wlyx\action\TxAction.java

     文件       1136  2013-04-01 14:10  wlyx\src\com\wlyx\config\spring-admin.xml

     文件       1124  2013-05-06 11:27  wlyx\src\com\wlyx\config\spring-bbs.xml

     文件       1118  2013-05-06 21:45  wlyx\src\com\wlyx\config\spring-bw.xml

     文件       1154  2013-05-06 20:18  wlyx\src\com\wlyx\config\spring-customer.xml

     文件       1136  2013-05-14 19:20  wlyx\src\com\wlyx\config\spring-goods.xml

     文件       1206  2013-05-14 21:30  wlyx\src\com\wlyx\config\spring-goodsRs.xml

     文件       1148  2013-05-05 14:08  wlyx\src\com\wlyx\config\spring-project.xml

     文件       1118  2013-05-06 22:30  wlyx\src\com\wlyx\config\spring-tx.xml

     文件       3261  2013-05-06 19:33  wlyx\src\com\wlyx\dao\AdminDao.java

     文件       1187  2013-05-06 11:22  wlyx\src\com\wlyx\dao\BBSDao.java

     文件       1398  2013-05-06 22:29  wlyx\src\com\wlyx\dao\BwDao.java

     文件       1639  2013-05-06 20:16  wlyx\src\com\wlyx\dao\CustomerDao.java

............此处省略324个文件信息

评论

共有 条评论