⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 u05c000action.java

📁 持久层hibernate技术使用的一个例子
💻 JAVA
字号:
package cn.hope.front.action;

import java.sql.Date;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import cn.hope.front.bo.U05TInfoBO;
import cn.hope.front.form.U05TInfoForm;
import cn.hope.front.pojo.CDept;
import cn.hope.front.pojo.MGroup;
import cn.hope.front.pojo.TInfo;

public class U05C000Action extends DispatchAction {

	public ActionForward modify(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		try{
			U05TInfoForm u05form =(U05TInfoForm)form;
	    	String idcard = u05form.getTIdcard();
			String tguan = u05form.getTGuan();
			String temail = u05form.getTEmail();
			String tbirth = u05form.getTBirth();
			String tmarry = u05form.getTMarry();
			String tmobile = u05form.getTMobile();
			String tname = u05form.getTName();
			String tsex = u05form.getTSex();
			String twork = u05form.getTWork();
			String txueli = u05form.getTXueli();
		
			TInfo tInfo = new TInfo();
			tInfo.setTId("wudibo");
			tInfo.setTPassword("123");
			tInfo.setTIdcard(idcard);
			tInfo.setTGuan(tguan);
			tInfo.setTEmail(temail);
			tInfo.setTBirth(Date.valueOf(tbirth));
			tInfo.setTMarry(tmarry);
			tInfo.setTMobile(tmobile);
			tInfo.setTName(tname);
			tInfo.setTSex(tsex);
			tInfo.setTWork(twork);
			tInfo.setTXueli(txueli);
			tInfo.setFlag("0");
			CDept dept = new CDept();
			dept.setDId(new Integer(1));
			
			MGroup group = new MGroup();
			group.setGId(new Integer(1));
			tInfo.setDId(dept.getDId());
			tInfo.setGId(group.getGId());
			U05TInfoBO u05TInfoBO = new U05TInfoBO();
			u05TInfoBO.modify(tInfo);
		}
		catch (Exception e) {
			e.printStackTrace();
		}
		
		return mapping.findForward("succ");
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -