📄 findinpatientaction.java
字号:
//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 java.util.ArrayList;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.*;import com.yourcompany.struts.form.FindInPatientForm;/** * MyEclipse Struts Creation date: 10-19-2005 * * XDoclet definition: * * @struts.action path="/findInPatient" name="findInPatientForm" * input="/form/findInPatient.jsp" scope="request" * validate="true" */public class FindInPatientAction 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 { FindInPatientForm findInPatientForm = (FindInPatientForm) form; // TODO Auto-generated method stub HttpSession session = request.getSession(); NurseAdmin nurseAdmin = (NurseAdmin) session.getAttribute("nurseAdmin"); ArrayList al = nurseAdmin.getRelatives(findInPatientForm.getPatientId()); request.setAttribute("relatives",al); if (nurseAdmin.getWardType().equals("ward")) { InPatient inpatient = nurseAdmin.findInPatient(findInPatientForm .getPatientId()); Clinic clinic = nurseAdmin.getClinic(inpatient.getClinicNum()); request.setAttribute("clinic",clinic); if (inpatient == null) { session.setAttribute("message", "there is not a person using this id in this ward"); return mapping.findForward("error"); } request.setAttribute("patient", inpatient); return mapping.findForward("patientInformation"); } else if (nurseAdmin.getWardType().equals("clinic")) { OutPatient outpatient = nurseAdmin.findOutPatient(findInPatientForm .getPatientId()); Clinic clinic = nurseAdmin.getClinic(outpatient.getClinicNum()); request.setAttribute("clinic",clinic); if (outpatient == null) { session.setAttribute("message", "there is not a person using this id in this ward"); return mapping.findForward("error"); } request.setAttribute("patient", outpatient); return mapping.findForward("patientInformation"); } else { return null; } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -