src/com/oa/actions/UserAction.java

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

package com.oa.actions;
import org.apache.struts2.ServletActionContext;

import com.oa.models.TSupplier;
import com.oa.models.TUser;
import com.oa.services.SupplierServices;
import com.oa.services.UserServices;
import com.oa.utils.PageInfo;

/**
 * 
 * 
 * 用户
 *
 */
public class UserAction extends BaseAction{
	private UserServices userServices;
	private Integer id;
	private String username;
	private String password;
	private String realname;
	private String power;
	private String searchname;
	
	public String queryUser() throws Exception{
		if (getSessionAttribute("querypageunit") == null) {
			setSessionAttribute("querypageunit",this.pageunit);
		}
		StringBuffer cond = new StringBuffer();
		if(null!=searchname&&""!=searchname.trim()){
			cond.append(" and a.username like '%"+searchname.trim()+"%' ");
		}
		//cond.append(" and a.power =1 ");
		int curpage = Integer.parseInt(this.getCurrentpage(ServletActionContext.getRequest()));
		int pageunit = Integer.parseInt(this.getPageunit(ServletActionContext.getRequest(), "querypageunit"));

		String url = "user_queryUser?a=a";
		
		PageInfo pageInfo = this.userServices.queryUser(curpage,
				pageunit, ServletActionContext.getRequest(), url, cond.toString());
		setRequestAttribute("pageinfo", pageInfo);
		setRequestAttribute("searchname", this.searchname);
		return "queryUser";
	}
	/**
	 * 
	 *
	 * 添加
	 *
	 */
	public String addUser() throws Exception{
		TUser user = new TUser();
		user.setPassword(password);
		user.setPower(power);
		user.setRealname(realname);
		user.setUsername(username);
		userServices.addUser(user);
		return "addUser";
	}
	
后面还有 73 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读 AI

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。