首页>代码>Struts2开发用户管理后台系统源代码下载>/UserManagerSystem/src/com/usermanagersystem/actions/AdminDeleteUserAction.java
package com.usermanagersystem.actions;

import java.util.List;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.usermanagersystem.ImplDao.ImplUser;
import com.usermanagersystem.InterDao.InterUser;

public class AdminDeleteUserAction extends ActionSupport
{
	private int id;
	private String tip;//提示用户信息
	
	InterUser interUser=new ImplUser();
	List alluserList=interUser.findAllUsers();
	public String execute()
	{
		InterUser interUser=new ImplUser();
		int count=interUser.deleteUser(id);//根据id删除指定用户
		if(count!=0){
			this.setTip("删除普通用户成功");
		if(ActionContext.getContext().getSession().containsKey("alluserList"))
		{
			ActionContext.getContext().getSession().remove("alluserList");	//从session中删除alluserList
		}		
		ActionContext.getContext().getSession().put("alluserList",alluserList);//将新数据放到session中
	
		}else{
		this.setTip("删除普通用户失败");
		}
		return "success";
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	public String getTip() {
		return tip;
	}

	public void setTip(String tip) {
		this.tip = tip;
	}


}
最近下载更多
没朋友的键盘侠  LV8 2022年5月26日
200011  LV4 2022年4月28日
and123456  LV11 2021年10月22日
javassh  LV1 2021年1月11日
ssig1977  LV3 2021年1月4日
yewentao  LV5 2020年12月9日
1254460660  LV6 2020年10月27日
15281682932  LV9 2020年9月29日
judy0971  LV12 2020年9月8日
你为我着迷丶  LV18 2020年8月6日
最近浏览更多
dsadasdwf  LV12 2023年10月23日
菲尼萨颗粒  LV1 2023年6月4日
泓鼎168  LV19 2023年3月25日
jiyun2021  LV9 2023年2月1日
ducking  LV2 2022年12月28日
wzh200808 2022年11月7日
暂无贡献等级
小瑞子来了 2022年10月21日
暂无贡献等级
Yaolinchen 2022年9月26日
暂无贡献等级
子书0319 2022年7月23日
暂无贡献等级
2468867327  LV10 2022年6月17日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友