src/com/action/ShengyuantypeAction.java

(开头部分) 3KB

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

package com.action;

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

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;
import com.model.Shengyuantype;
import com.dao.ShengyuantypeDAO;

public class ShengyuantypeAction extends ActionSupport {

	private Integer id; //
	private String typename; // 生源分类名称
	private String bezhu; // 生源分类描述

	private String message;
	private String path;

	private Shengyuantype shengyuantype;

	private ShengyuantypeDAO shengyuantypeDao;

	public String addShengyuantype() throws Exception {
		shengyuantype = new Shengyuantype();
		shengyuantype.setId(id);
		shengyuantype.setTypename(typename);
		shengyuantype.setBezhu(bezhu);
		shengyuantypeDao.save(shengyuantype);
		this.setMessage("操作成功");
		this.setPath("listShengyuantype.action");
		return "succeed";
	}

	public String listShengyuantype() throws Exception {
		List ShengyuantypeList = shengyuantypeDao.findAll();
		Map request = (Map) ServletActionContext.getContext().get("request");
		request.put("ShengyuantypeList", ShengyuantypeList);
		return ActionSupport.SUCCESS;
	}

	public String toEditShengyuantype() throws Exception {
		Shengyuantype entity = shengyuantypeDao.findById(id);
		Map request = (Map) ServletActionContext.getContext().get("request");
		request.put("Shengyuantype", entity);
		return ActionSupport.SUCCESS;
	}

	public String editShengyuantype() throws Exception {
		shengyuantype = shengyuantypeDao.findById(id);
		shengyuantype.setId(id);
		shengyuantype.setTypename(typename);
		shengyuantype.setBezhu(bezhu);
		shengyuantypeDao.merge(shengyuantype);
		this.setMessage("操作成功");
		this.setPath("listShengyuantype.action");
		return "succeed";
	}

后面还有 71 行代码,购买后查看完整代码

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

AI 解读 AI

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

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