doctormsgaction.java

来自「这是一个针对医院管理的一个系统」· Java 代码 · 共 78 行

JAVA
78
字号
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.nitpro.action;

import java.util.List;

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

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
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 com.nitpro.dao.DAOFactory;
import com.nitpro.form.DoctorMsgForm;

/** 
 * MyEclipse Struts
 * Creation date: 12-26-2007
 * 
 * XDoclet definition:
 * @struts.action parameter="method" validate="true"
 */
public class DoctorMsgAction extends DispatchAction {
	/*
	 * Generated Methods
	 */

	/** 
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward doctorMsgSelect(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		String selectoption = request.getParameter("selectoption");
		DAOFactory dao = DAOFactory.getDAOFactory(DAOFactory.MYSQL);
		List dmlist = dao.getAllMethodDAO().getDoctorMsg(selectoption);
		request.setAttribute("dmlist", dmlist);
		return mapping.findForward("selectOK");
	}
	
	public ActionForward doctorInput(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		DoctorMsgForm dmf = (DoctorMsgForm)form;
		HttpSession session = request.getSession();
		DAOFactory dao = DAOFactory.getDAOFactory(DAOFactory.MYSQL);
		int rst = dao.getAllMethodDAO().checkDoctorID(dmf.getDoctor_id());
		if(rst == 2){
			dao.getAllMethodDAO().doctorMsgInput(dmf);
			List d_l = dao.getAllMethodDAO().getDoctorSpecalMsg(dmf.getDoctor_id());
			session.setAttribute("d_l", d_l);
			return mapping.findForward("inputOK");
		}else{
			ActionErrors errors = new ActionErrors();
			errors.add("doctor_id", new ActionError("doctorIDError"));
			this.saveErrors(request, errors);
			return mapping.findForward("inputfail");
		}
	}
	
	public ActionForward doctorDelete(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		String doctor_id = request.getParameter("doctor_id");
		DAOFactory dao = DAOFactory.getDAOFactory(DAOFactory.MYSQL);
		dao.getAllMethodDAO().doctorMsgDelect(doctor_id);
		return mapping.findForward("deleteOK");
	}
}

⌨️ 快捷键说明

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