📄 sqdcxaction.java
字号:
package com.t60.oa.web.car;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.t60.oa.service.car.Cllx;
import com.t60.oa.service.car.Sqdcx;
import hong.javanet.dao.HibernateAspect;
import org.apache.struts.action.*;
import org.apache.struts.actions.DispatchAction;
import com.t60.oa.service.car.Sqdzt;
import com.t60.oa.service.car.Xgsqd;
public class SqdcxAction extends DispatchAction {
// private ;
public ActionForward sqdzt(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
SqdcxForm sqdcxForm = (SqdcxForm) form;
Sqdzt sqdzt = new Sqdzt();
sqdzt.setFormcx(sqdcxForm);
try {
request.setAttribute("sqdcx",sqdzt);
new HibernateAspect().bind(sqdzt, "show").execute();
return mapping.getInputForward();
} catch (Exception ex) {
sqdzt.setMessage("起草失败。。。。"+ex.getMessage());
return mapping.getInputForward();
}
}
public ActionForward load(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
SqdcxForm sqdcxForm = (SqdcxForm) form;
this.sqdzt(mapping,sqdcxForm,request,response);
Cllx cllx = new Cllx();
cllx.setFormcx(sqdcxForm);
try {
request.setAttribute("sqdcx",cllx);
new HibernateAspect().bind(cllx, "show").execute();
return mapping.getInputForward();
} catch (Exception ex) {
cllx.setMessage("起草失败。。。。"+ex.getMessage());
return mapping.getInputForward();
}
}
public ActionForward ckxj(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
SqdcxForm sqdcxForm = (SqdcxForm) form;
Sqdcx sqdcx = new Sqdcx();
sqdcx.setForm(sqdcxForm);
try {
new HibernateAspect().bind(sqdcx, "querySqd").execute(); //(类名,“方法”)
request.setAttribute("result", sqdcx);
// return mapping.findForward("select");
return mapping.findForward("ckxj"); //查询成功!
} catch (Exception ex) {
request.setAttribute("faild", "查询出错!");
return mapping.getInputForward(); //失败返回查询页面
}
}
public ActionForward select(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
SqdcxForm sqdcxForm = (SqdcxForm) form;
// if(1=1){
// ;
// }
this.load(mapping,sqdcxForm,request,response);
Sqdcx sqdcx = new Sqdcx();
sqdcx.setForm(sqdcxForm);
try {
new HibernateAspect().bind(sqdcx, "querySqd").execute(); //(类名,“方法”)
request.setAttribute("result", sqdcx);
// return mapping.findForward("select");
return mapping.getInputForward(); //查询成功!
} catch (Exception ex) {
request.setAttribute("faild", "查询出错!");
return mapping.getInputForward(); //失败返回查询页面
}
}
public ActionForward quxiao(ActionMapping mapping, ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
SqdcxForm sqdcxForm = (SqdcxForm) form;
Xgsqd xgsqd = new Xgsqd();
xgsqd.setForm(sqdcxForm);
try {
new HibernateAspect().bind(xgsqd, "quxiao").execute(); //(类名,“方法”)
return mapping.findForward("quxiao"); //查询成功!
} catch (Exception ex) {
request.setAttribute("faild", "查询出错!");
return mapping.getInputForward(); //失败返回查询页面
}
}
}
// try {
// new HibernateAspect().bind(sqdcx, "querySqd").execute();//(类名,“方法”)
// request.setAttribute("result", sqdcx.getResult());
//// return mapping.findForward("select");
// return mapping.getInputForward(); //查询成功!
// } catch (Exception ex) {
// request.setAttribute("faild", "查询出错!");
// return mapping.getInputForward(); //失败返回查询页面
// }
// Sqdcx sqd = null;
// if(request.getParameter("page")==null) {//不是翻页,查第一页
// sqd = new Sqdcx();
// sqd.setForm(sqdcxForm);
// sqd.setPageIndex(1);
// sqd.setPageSize(10);
// sqd.setNeedCount(true);
// String key = String.valueOf(System.currentTimeMillis());
// request.setAttribute("key",key);
// request.getSession(true).setAttribute(key,sqd);
// }
// else {//翻页
// String key = request.getParameter("key");
// request.setAttribute("key",key);
// sqd = (Sqdcx)request.getSession(true)
// .getAttribute(key);
// sqd.setPageIndex(Integer.parseInt(
// request.getParameter("page")));
// sqd.setNeedCount(false);
// }
// try {
// request.setAttribute("selectsqdloyee",sqd);
// new HibernateAspect().bind(sqd, "selectsqdloyee").execute();
// return mapping.findForward("ok");
// } catch (Exception ex) {
// sqd.setMessage("输入格式错误。。。。"+ex.getMessage());
// return mapping.getInputForward();//分发到输入页面
// }
// throw new java.lang.UnsupportedOperationException(
// "Method $execute() not yet implemented.");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -