addoutpatientaction.java

来自「一个小型的医疗管理系统」· Java 代码 · 共 65 行

JAVA
65
字号
//Created by MyEclipse Struts// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.1.1/xslt/JavaClass.xslpackage com.yourcompany.struts.action;import java.sql.SQLException;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import javax.servlet.http.HttpSession;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 bean.NurseAdmin;import bean.OutPatient;import com.yourcompany.struts.form.AddOutPatientForm;/**  * MyEclipse Struts * Creation date: 10-18-2005 *  * XDoclet definition: * @struts.action path="/addOutPatient" name="addOutPatientForm" input="/form/addOutPatient.jsp" scope="request" validate="true" */public class AddOutPatientAction extends Action {	// --------------------------------------------------------- Instance Variables	// --------------------------------------------------------- Methods	/** 	 * Method execute	 * @param mapping	 * @param form	 * @param request	 * @param response	 * @return ActionForward	 * @throws SQLException 	 */	public ActionForward execute(		ActionMapping mapping,		ActionForm form,		HttpServletRequest request,		HttpServletResponse response) throws SQLException {		AddOutPatientForm addOutPatientForm = (AddOutPatientForm) form;		// TODO Auto-generated method stub		HttpSession session = (HttpSession)request.getSession();		NurseAdmin nurseAdmin = (NurseAdmin)session.getAttribute("nurseAdmin");		OutPatient outpatient = new OutPatient(addOutPatientForm.getF_name(),addOutPatientForm.getL_name(),addOutPatientForm.getAddress()				,addOutPatientForm.getTele(),addOutPatientForm.getBirthday(),addOutPatientForm.getRegister_date(),addOutPatientForm.getClinicNum()				,addOutPatientForm.getMarital_status(),addOutPatientForm.getSeeDate());		String patientId = nurseAdmin.createOutPatient(outpatient);		if(patientId == null)return mapping.findForward("error");		outpatient.setPatientId(patientId);		session.setAttribute("patient",outpatient);		return mapping.findForward("addPatientSucess");	}}

⌨️ 快捷键说明

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