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

📄 updateclientaction.java

📁 这是本人以前在学校时
💻 JAVA
字号:
/*
 * Created on 2006-6-27
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.funddeal.view.action.client;

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

import net.sf.hibernate.HibernateException;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.funddeal.model.bean.client.ClieatBean;
import com.funddeal.model.pojo.custom_entity.LoginUserInfoEntity;
import com.funddeal.model.pojo.custom_entity.OperLogParamEntity;
import com.funddeal.view.actionform.client.UpdateClieatForm;


/**
 * @author Administrator
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class UpdateClientAction extends Action {

	public ActionForward execute(
			ActionMapping actionMapping,
			ActionForm actionForm,
			HttpServletRequest servletRequest,
			HttpServletResponse servletResponse){
		
		UpdateClieatForm uca=(UpdateClieatForm)actionForm;
		String no=uca.getClient_no();
		String name=uca.getClient_name();
		String id=uca.getId_card_no();
		String sex=uca.getSex();
		String phone=uca.getPhone();
		String addess=uca.getAddess();
		String email=uca.getEmail();
		String hobby=uca.getHobby();
		
		
		/*
		 * 给添加日志做相应的设置
		 */
////////////////////////////////////////////////////////////////////////////////////////////////////		//
//		获得操作人员登录后的信息实体																		//
		HttpSession  session = servletRequest.getSession(true);
		LoginUserInfoEntity luife=(LoginUserInfoEntity)session.getAttribute("LoginUserInfoEntity");	//
//		将取得的值设置到日志参数实体中																	//
		OperLogParamEntity olpe=new OperLogParamEntity();
		if(luife!=null){														//
			olpe.setMachineAddress(luife.getOperMachineAddress());									//
			olpe.setSalesNo(luife.getSalesNo());													//
		}
////////////////////////////////////////////////////////////////////////////////////////////////////////	//

		
		ClieatBean cb=new ClieatBean();
		try {
			if(cb.update("1",no,name,id,sex,phone,addess,email,hobby,olpe)){
				return actionMapping.findForward("update");
			}
			else
				return actionMapping.findForward("updateerror");
		} catch (HibernateException e) {
			e.printStackTrace();
			return actionMapping.findForward("error");
		}
	}

}

⌨️ 快捷键说明

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