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

📄 addclientaction.java

📁 gensou.rar为某渔具厂的一个简单ERP系统。为比较基础的工程
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.gensou.struts.sheji.client.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
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.gensou.dao.sheji.client.Clientdao;
import com.gensou.logic.sheji.client.AddClientService;
import com.gensou.struts.sheji.client.form.AddclientForm;

/** 
 * 作者:宋宇
 * 用于控制添加客户信息的action
 * MyEclipse Struts
 * Creation date: 01-07-2007
 * 
 * XDoclet definition:
 * @struts.action path="/addclient" name="addclientForm" scope="request" validate="true"
 */
public class AddclientAction extends Action {
	/*
	 * Generated Methods
	 */

	/** 
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		AddclientForm addclientForm = (AddclientForm) form;// TODO Auto-generated method stub
		String str;
		AddClientService addClient=new AddClientService();
		addClient.setClientId(addclientForm.getClientId());
		addClient.setClientName(addclientForm.getClientName());
		addClient.setClientAddress(addclientForm.getClientAddress());
		addClient.setClientTel(addclientForm.getClientTel());
		addClient.setClientFax(addclientForm.getClientFax());
		addClient.setClientEmi(addclientForm.getClientEmi());
		addClient.setBeizhu(addclientForm.getBeizhu());
		addClient.setZhuangtai(addclientForm.getZhuangtai());
		Clientdao clientdao=new Clientdao();
		boolean bo=clientdao.addclient(addClient);
		if(bo==true){
			str="客户添加成功";
			request.setAttribute("str",str);
			return mapping.findForward("addclient");
		}else{
		  str="该客户已存在";	
		  request.setAttribute("str",str);
		  return mapping.findForward("addclient");
		}
	}
}

⌨️ 快捷键说明

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