⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 weeklymodifysaveaction.java

📁 一个oa系统
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.oa.personaloffice.action;

import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.text.ParseException;
import java.util.List;

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 com.oa.db.Weeklyinput;
import com.oa.db.WeeklyinputDAO;

/** 
 * MyEclipse Struts
 * Creation date: 08-28-2007
 * 
 * XDoclet definition:
 * @struts.action validate="true"
 */
public class WeeklymodifysaveAction extends Action {
	/*
	 * Generated Methods
	 */
	WeeklyinputDAO wdao;
	/** 
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		// TODO Auto-generated method stub
		response.setCharacterEncoding("gbk");
		Weeklyinput info=new Weeklyinput();
		Weeklyinput wo = new Weeklyinput();
		int id=Integer.parseInt(request.getParameter("id"));
		List list = wdao.ByIdQuery(id);
		if(list!=null&&list.size()!=0){
			wo = (Weeklyinput)list.get(0);
		}
		String mainjob = "";
		try {
			mainjob = request.getParameter("mainjob");
		} catch (Exception e1) {
			// TODO 自动生成 catch 块
			e1.printStackTrace();
		}
		String filename = "";
		try {
			filename = request.getParameter("filename");
		} catch (Exception e1) {
			// TODO 自动生成 catch 块
			e1.printStackTrace();
		}
		String problem = "";
		try {
			problem = request.getParameter("problem");
		} catch (Exception e1) {
			// TODO 自动生成 catch 块
			e1.printStackTrace();
		}
		String plan = "";
		try {
			plan =request.getParameter("plan");
		} catch (Exception e1) {
			// TODO 自动生成 catch 块
			e1.printStackTrace();
		}
		info.setId(id);
		info.setRealname(wo.getRealname());
		info.setDepartmentid(wo.getDepartmentid());
		info.setUserid(wo.getUserid());
		info.setPostid(wo.getPostid());
		info.setPeriod(wo.getPeriod());
		info.setMainjob(mainjob);
		info.setFilename(filename);
		info.setProblem(problem);
		info.setPlan(plan);
		info.setWhethercheck(wo.getWhethercheck());
		info.setDate(wo.getDate());
		info.setDepartmentsuggest(wo.getDepartmentsuggest());
		info.setDirectorsuggest(wo.getDirectorsuggest());
		
		HttpSession session = request.getSession();
		String username=(String)session.getAttribute("username");
		PrintWriter out = null;
		try {
			out = response.getWriter();
		} catch (IOException e) {
			// TODO 自动生成 catch 块
			e.printStackTrace();
		}
		if(username!=null){	
			wdao.UpdateInputinfo(info);	
			out.print("<script>");
			out.print("alert('恭喜你,修改成功!');");
			out.print("document.location.href='weeklymodifylist.do';");
//			out.print("window.history.go(-1);");
			out.print("window.close();");
			out.print("</script>");
			out.close(); 
			//return mapping.findForward("weeklymodifylist.do");
		}else{ 
		    out.print("<script>alert('您的操作超时,请重新登录!');");
		    out.print("window.open('login.jsp','_self');");
		    out.print("</script>");
		    out.flush();
	}
		return null;
	}
	public WeeklyinputDAO getWdao() {
		return wdao;
	}
	public void setWdao(WeeklyinputDAO wdao) {
		this.wdao = wdao;
	}
}

⌨️ 快捷键说明

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