📄 deleteallergyhistory.java
字号:
package com.bjjd.web;
import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.bjjd.datamodel.Allergyhistory;
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.bjjd.DAO.AllergyhistoryDAO;
/*
* 删除过敏史记录动作
*
*/
public class Deleteallergyhistory extends Action{
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception {
try
{
//获取ID
int id=Integer.parseInt(request.getParameter("ahid"));
//设置实体类
Allergyhistory ah=new Allergyhistory();
ah.setId(id);
//删除记录
AllergyhistoryDAO m=new AllergyhistoryDAO();
m.deleteallergyhistory(ah);
//更新结果集
HttpSession s=request.getSession();
String str=String.valueOf(s.getAttribute("personid"));
ArrayList ar=m.searchallergyhistory(str);
s.setAttribute("ahlist", ar);
}
catch(Exception e)
{
request.setAttribute("error", e.toString()+"bbbb");
return (mapping.findForward("failed"));
}
return (mapping.findForward("success"));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -