package com.office.action;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Date;
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.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 com.office.actionform.LogonForm;
import com.office.actionform.SearchForm;
import com.office.actionform.UserForm;
import com.office.dao.Content;
import com.office.dao.DB;
import com.office.officemenu.Searchtypelist;
import com.office.tools.Change;
import com.office.tools.CheckUserAble;
public class UserAction extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) {
HttpSession session=request.getSession();
LogonForm logonuser=(LogonForm)session.getAttribute("logonuser");
if(logonuser==null){
ActionErrors errors=new ActionErrors();
errors.add(ActionErrors.GLOBAL_ERROR,new ActionError("office.logon.notallow"));
saveErrors(request,errors);
return mapping.findForward("notallowlogon");
}
String mark = mapping.getParameter();
ActionForward forward = new ActionForward();
if (mark.equals("person_look"))
forward = executePersonLook(mapping, form, request, response);
if (mark.equals("person_sigle_look"))
forward = executePersonSigleLook(mapping, form, request, response);
if (mark.equals("person_myself_look"))
forward = executePersonMyselfLook(mapping, form, request, response);
if (mark.equals("person_add"))
forward = executePersonAdd(mapping, form, request, response);
if (mark.equals("person_update"))
forward = executePersonUpdate(mapping, form, request, response);
if (mark.equals("person_myself_update"))
forward = executeMyUpdate(mapping, form, request, response);
if (mark.equals("person_del"))
forward = executePersonDel(mapping, form, request, response);
if (mark.equals("person_good"))
forward = executePersonGood(mapping, form, request, response);
return forward;
}
public ActionForward executePersonLook(ActionMapping mapping,ActionForm form, HttpServletRequest request,HttpServletResponse response) {
ActionErrors errors = new ActionErrors();
HttpSession session = request.getSession();
LogonForm logonuser=(LogonForm)session.getAttribute("logonuser");
if(!CheckUserAble.check(logonuser)){
session.setAttribute("selectmenu2", "");
errors.add(ActionErrors.GLOBAL_ERROR,new ActionError("office.user.noallow"));
saveErrors(request,errors);
return mapping.findForward("notallow");
}
session.setAttribute("selectmenu2", "person_look");
SearchForm searchform = (SearchForm) form;
String sql = "";
String subsql = searchform.getSubsql();
String subsqlvalue = searchform.getSubsqlvalue();
if (subsql == null || subsql.equals(""))
subsql = "all";
if (subsql.equals("all")){
subsqlvalue="";
sql = "select * from " + Content.TB_USER;
}
else if (subsql.equals("user_good")) {
session.setAttribute("selectmenu2", "person_good");
searchform.setSubsql(subsql);
if (subsqlvalue == null || subsqlvalue.equals("")) {
sql = "select * from " + Content.TB_USER + " where user_good='1'";
} else {
sql = "select * from " + Content.TB_USER + " where "+ Content.USERNAME + "='" + subsqlvalue + "' and user_good='1'";
}
}
else if(subsql.equals("user_able")){
if (subsqlvalue == null || subsqlvalue.equals("")) {
errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("office.search.notiaojian.error"));
saveErrors(request, errors);
return mapping.findForward("false");
}
int subsqlvalue1=-1;
if(subsqlvalue.equals("游客"))subsqlvalue1=0;
else if(subsqlvalue.equals("普通管理员"))subsqlvalue1=1;
else if(subsqlvalue.equals("系统管理员"))subsqlvalue1=2;
sql = "select * from " + Content.TB_USER + " where user_able=" + subsqlvalue1;
}
else {
if (subsqlvalue == null || subsqlvalue.equals("")) {
errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("office.search.notiaojian.error"));
saveErrors(request, errors);
return mapping.findForward("false");
}
sql = "select * from " + Content.TB_USER + " where " + subsql+ "='" + subsqlvalue + "'";
}
String str_currentpage=request.getParameter("page");
if(str_currentpage==null||str_currentpage.equals(""))
str_currentpage="0";
int currentpage=Change.strtoint(str_currentpage);
if(currentpage<=0)
currentpage=1;
DB db = new DB();
ArrayList personlist = db.getallpersonlist(sql,currentpage);
session.setAttribute("numrs",Integer.toString(db.getNumrs()));
session.setAttribute("numper", Integer.toString(db.getNumper()));
session.setAttribute("currentpage",Integer.toString(db.getCurrentPage()));
session.setAttribute("numpages", Integer.toString(db.getNumPages()));
session.setAttribute("personlist", personlist);
searchform.setSubsqlvalue(subsqlvalue);
return mapping.findForward("success");
}
public ActionForward executePersonGood(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
ActionErrors errors=new ActionErrors();
HttpSession session=request.getSession();
LogonForm logonuser=(LogonForm)session.getAttribute("logonuser");
if(!CheckUserAble.check(logonuser)){
session.setAttribute("selectmenu2", "");
errors.add(ActionErrors.GLOBAL_ERROR,new ActionError("office.user.noallow"));
saveErrors(request,errors);
return mapping.findForward("notallow");
}
SearchForm searchform=(SearchForm)form;
searchform.setSubsql(Content.USERGOOD);
executePersonLook(mapping, form, request, response);
return mapping.findForward("success");
}
public ActionForward executePersonSigleLook(ActionMapping mapping,
ActionForm form, HttpServletRequest request,
HttpServletResponse response) {
ActionErrors errors=new ActionErrors();
HttpSession session=request.getSession();
LogonForm logonuser=(LogonForm)session.getAttribute("logonuser");
if(!CheckUserAble.check(logonuser)){
session.setAttribute("selectmenu2", "");
errors.add(ActionErrors.GLOBAL_ERROR,new ActionError("office.user.noallow"));
saveErrors(request,errors);
return mapping.findForward("notallow");
}
UserForm userform=(UserForm)form;
String lookid1=request.getParameter("id");
if(lookid1==null||lookid1.equals(""))lookid1="0";
int lookid=Change.strtoint(lookid1);
ArrayList personlist=(ArrayList)session.getAttribute("personlist");
boolean flag=false;
for(int i=0;i<personlist.size();i++){
UserForm personsigleform=(UserForm)personlist.get(i);
if(lookid==personsigleform.getUserid()){
flag=true;
userform.setUsername(personsigleform.getUsername());
userform.setUsertruename(personsigleform.getUsertruename());
userform.setUserable(personsigleform.getUserable());
userform.setUsergood(personsigleform.getUsergood());
userform.setUserbranch(personsigleform.getUserbranch());
userform.setUserjob(personsigleform.getUserjob());
userform.setUsersex(personsigleform.getUsersex());
userform.setUseremail(personsigleform.getUseremail());
userform.setUsertel(personsigleform.getUsertel());
userform.setUseraddress(personsigleform.getUseraddress());
userform.setUseraccesstimes(personsigleform.getUseraccesstimes());
userform.setUserfoundtime(personsigleform.getUserfoundtime());
break;
}
}
if(!flag){
errors.add(ActionErrors.GLOBAL_ERRO
没有合适的资源?快使用搜索试试~ 我知道了~
明日科技OA系统,简单的系统
共525个文件
java:128个
prefs:98个
jsp:84个
4星 · 超过85%的资源 需积分: 15 75 下载量 140 浏览量
2008-11-27
22:39:13
上传
评论 1
收藏 4.22MB RAR 举报
温馨提示
明日科技OA系统明日科技OA系统明日科技OA系统明日科技OA系统
资源推荐
资源详情
资源评论
收起资源包目录
明日科技OA系统,简单的系统 (525个子文件)
MoneyAction.class 15KB
MoneyAction.class 15KB
UserAction.class 15KB
UserAction.class 15KB
DB.class 12KB
DB.class 12KB
FileAction.class 9KB
FileAction.class 9KB
MailAction.class 8KB
MailAction.class 8KB
TextAction.class 8KB
TextAction.class 8KB
PcardAction.class 8KB
PcardAction.class 8KB
AdviceAction.class 7KB
AdviceAction.class 7KB
MeetAction.class 7KB
MeetAction.class 7KB
OfficeMenu.class 6KB
OfficeMenu.class 6KB
LogonAction.class 6KB
LogonAction.class 6KB
Searchtypelist.class 5KB
Searchtypelist.class 5KB
Content.class 5KB
Content.class 5KB
LogonForm.class 4KB
LogonForm.class 4KB
UserForm.class 4KB
UserForm.class 4KB
MoneyCarForm.class 3KB
MoneyCarForm.class 3KB
Change.class 3KB
Change.class 3KB
ManagerTrace.class 2KB
ManagerTrace.class 2KB
MoneyThingForm.class 2KB
MoneyThingForm.class 2KB
MailForm.class 2KB
MailForm.class 2KB
FileForm.class 2KB
FileForm.class 2KB
Page.class 2KB
Page.class 2KB
LogoffAction.class 2KB
LogoffAction.class 2KB
MeetForm.class 2KB
MeetForm.class 2KB
TextForm.class 2KB
TextForm.class 2KB
MenuSigle.class 2KB
MenuSigle.class 2KB
AdviceForm.class 2KB
AdviceForm.class 2KB
PcardForm.class 1KB
PcardForm.class 1KB
CheckUser.class 1KB
CheckUser.class 1KB
FormToChinese.class 889B
FormToChinese.class 889B
SearchForm.class 868B
SearchForm.class 868B
CheckUserAble.class 789B
CheckUserAble.class 789B
.classpath 1KB
.classpath 1KB
style.css 2KB
style.css 2KB
variablesAndContainers.dat 603B
variablesAndContainers.dat 603B
程序使用说明.doc 325KB
properties.index 57B
properties.index 57B
version.ini 26B
version.ini 26B
struts.jar 486KB
struts.jar 486KB
jtds-0.8.1.jar 250KB
jtds-0.8.1.jar 250KB
commons-collections.jar 161KB
commons-collections.jar 161KB
commons-beanutils.jar 116KB
commons-beanutils.jar 116KB
commons-digester.jar 107KB
commons-digester.jar 107KB
jakarta-oro.jar 64KB
jakarta-oro.jar 64KB
commons-lang.jar 62KB
commons-lang.jar 62KB
commons-validator.jar 46KB
commons-validator.jar 46KB
commons-logging.jar 31KB
commons-logging.jar 31KB
commons-fileupload.jar 22KB
commons-fileupload.jar 22KB
struts-legacy.jar 10KB
struts-legacy.jar 10KB
UserAction.java 24KB
UserAction.java 24KB
UserAction.java 24KB
共 525 条
- 1
- 2
- 3
- 4
- 5
- 6
xiaopaopao
- 粉丝: 54
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于CarNet实现裂缝检测python源码+文档说明+数据+图片(课程设计)
- 课程设计-基于耐火材料裂缝剥落检测python源码+课件
- 基于OpenCV的视频道路车道检测python源码+文档说明+实验演示+图片+使用方法(高分毕业设计)
- 基于OpenCV的案例:图像边缘、角点和轮廓检测,图像分割,图像增强;图片拼接;运动目标检测,颜色直方图比较,三帧帧差法,抠图
- SmartPlug-html大一笔记
- SmartPlug-proteusdemo
- Preliminary Findings on Handmade Rattan Baby Crib andBassinet Designs Regarding.zip
- aveebfq_v1.2.83_downyi.com.apk
- 基于有机发光二极管(OLED)的建模优化算法的matlab仿真源码+数据+文档说明+项目说明(高分课程设计)
- hash01-test.c 本人哈希表(一)的示例代码,仅供参考!
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页