首页>代码>基于SSH的Web家庭理财管理系统>/基于SSH的Web理财管理系统/licai/src/com/action/adminAction.java
package com.action;

import java.util.List;
import java.util.Map;

import org.apache.struts2.ServletActionContext;

import com.dao.TAdminDAO;
import com.model.TAdmin;
import com.opensymphony.xwork2.ActionSupport;

public class adminAction extends ActionSupport
{
	private int userId;
	private String userName;
	private String userPw;
	 
	private String message;
	private String path;
	
	private int index=1;

	private TAdminDAO adminDAO;
	
	
	public String adminAdd()
	{
		TAdmin admin=new TAdmin();
		admin.setUserName(userName);
		admin.setUserPw(userPw);
		adminDAO.save(admin);
		this.setMessage("²Ù×÷³É¹¦");
		this.setPath("adminManage.action");
		return "succeed";
	}
	
	
	
	public String adminManage()
	{
		List adminList=adminDAO.findAll();
		Map request=(Map)ServletActionContext.getContext().get("request");
		request.put("adminList", adminList);
		return ActionSupport.SUCCESS;
	}
	
	
	public String adminDel()
	{
		adminDAO.delete(adminDAO.findById(userId));
		this.setMessage("ɾ³ý³É¹¦");
		this.setPath("adminManage.action");
		return "succeed";
	}
	
	

	public TAdminDAO getAdminDAO()
	{
		return adminDAO;
	}

	public void setAdminDAO(TAdminDAO adminDAO)
	{
		this.adminDAO = adminDAO;
	}

	public String getMessage()
	{
		return message;
	}

	public int getIndex()
	{
		return index;
	}



	public void setIndex(int index)
	{
		this.index = index;
	}



	public void setMessage(String message)
	{
		this.message = message;
	}

	public String getPath()
	{
		return path;
	}

	public void setPath(String path)
	{
		this.path = path;
	}

	public int getUserId()
	{
		return userId;
	}

	public void setUserId(int userId)
	{
		this.userId = userId;
	}

	public String getUserName()
	{
		return userName;
	}

	public void setUserName(String userName)
	{
		this.userName = userName;
	}

	public String getUserPw()
	{
		return userPw;
	}

	public void setUserPw(String userPw)
	{
		this.userPw = userPw;
	}
	 
}
最近下载更多
微信网友_6508798513811456  LV5 2023年6月17日
zzw123zzw  LV6 2022年10月28日
zhaoyangwfd  LV17 2022年10月11日
srl2881552  LV10 2022年9月6日
地上有草  LV12 2022年5月11日
wanglinddad  LV54 2022年3月8日
encoun  LV3 2022年1月5日
形水灯  LV4 2021年11月8日
lsc860911  LV11 2021年6月2日
凌云struggle  LV8 2021年5月23日
最近浏览更多
huott1993  LV1 4月6日
WBelong  LV7 3月5日
263648  LV7 2023年12月28日
Henew168  LV2 2023年11月19日
Jjjj1111  LV5 2023年11月12日
1588584 2023年11月7日
暂无贡献等级
帅涵123456  LV2 2023年11月6日
mhymhy123  LV1 2023年11月2日
fhjdisa 2023年10月29日
暂无贡献等级
fesfefe  LV13 2023年9月26日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友