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

📄 testrfcaction.java

📁 建立于Eclipse平台的WEB应用系统-物流管理系统变更模块
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package org.mychange.struts.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.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.mychange.obj.Rfc;
import org.mychange.obj.Testreport;
import org.mychange.service.IRfcListService;
import org.mychange.service.impl.CmFactory;
import org.mychange.service.impl.RfcService;
import org.mychange.service.impl.TestreportService;
import org.mychange.struts.form.TestRFCForm;
import org.mychange.toChinese.ChineseEncoding;

/** 
 * MyEclipse Struts
 * Creation date: 07-15-2008
 * 
 * XDoclet definition:
 * @struts.action path="/testRFC" name="testRFCForm" input="/TestRFC.jsp" scope="request" validate="true"
 */
public class TestRFCAction extends Action {
	/*
	 * Generated Methods
	 */
	private int id;
	
	private TestreportService testreportService;

	public TestreportService getTestreportService() {
		return testreportService;
	}

	public void setTestreportService(TestreportService testreportService) {
		this.testreportService = testreportService;
	}
	
	private RfcService rfcService;


	

	public RfcService getRfcService() {
		return rfcService;
	}

	public void setRfcService(RfcService rfcService) {
		this.rfcService = rfcService;
	}

	/** 
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		
		HttpSession session = request.getSession();//取得一个session
		
		int id=Integer.parseInt(request.getSession().getAttribute("RfcID").toString());
		TestRFCForm testRFCForm = (TestRFCForm)form;
	
		Rfc rfc=rfcService.getRfcById(id);
		Testreport testReport=new Testreport();
		
		testReport.setTestReportName(ChineseEncoding.toChinese(testRFCForm.getTestName()));

		testReport.setBeginTime(testRFCForm.getBeginTime());
		testReport.setEndTime(testRFCForm.getEndTime());
		testReport.setRfc(rfc);
		testReport.setPrincipal(ChineseEncoding.toChinese(testRFCForm.getPrincipal()));
		testReport.setBrief(ChineseEncoding.toChinese(testRFCForm.getBrief()));
		testReport.setScore(ChineseEncoding.toChinese(testRFCForm.getScore()));
		rfc.setState("已测试");
		testreportService.addTestreport(testReport);
//		rfcService.updateRfc(rfc);
		return mapping.findForward("testOK");
	}

}

⌨️ 快捷键说明

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