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

📄 modefypaymentdocumentaction.java

📁 这是本人曾经在公司里用的,内部开发框架,基于struts+hibernate今天分享给大家
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package cn.bway.foreigntrade.finance.buy.document.action;

import java.sql.Connection;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

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 org.hibernate.Session;
import org.hibernate.Transaction;

import cn.bway.common.LoginConstants;
import cn.bway.common.WebConstant;
import cn.bway.common.action.BaseAction;
import cn.bway.common.code.codeDao;
import cn.bway.common.dao.HibernateSessionFactory;
import cn.bway.common.vo.PageListVO;
import cn.bway.common.vo.QueryVO;
import cn.bway.foreigntrade.finance.buy.document.form.PaymentdocumentForm;
import cn.bway.foreigntrade.finance.buy.document.impl.PaymentdocumentManagerFactory;
import cn.bway.foreigntrade.finance.buy.document.model.Paymentdocument;
import cn.bway.foreigntrade.operation.guestmanage.logs.impl.LogsManagerFactory;
import cn.bway.foreigntrade.operation.guestmanage.logs.model.Logs;
import cn.bway.foreigntrade.repertory.buydocument.impl.BuydocumentManagerFactory;
import cn.bway.foreigntrade.repertory.buydocument.model.Buydocument;

/** 
 * MyEclipse Struts
 * Creation date: 03-25-2008
 * 
 * XDoclet definition:
 * @struts.action validate="true"
 */
public class ModefyPaymentdocumentAction extends BaseAction {
	/*
	 * Generated Methods
	 */

	/** 
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		PaymentdocumentForm paymentdocumentForm = (PaymentdocumentForm) form;// TODO Auto-generated method stub
		String id=request.getParameter("id");
		System.out.println(id+"============================");
		ActionErrors errors = new ActionErrors();
		PageListVO rvo = null;
		QueryVO qvo = new QueryVO();
		Session sess =null;
		Transaction tx =null;
		String returnStr = null;
		Connection conn = null;
		try {
			request.setCharacterEncoding("utf-8");
			//更新付款单
			Paymentdocument document=new Paymentdocument();
				Paymentdocument exp=(Paymentdocument) PaymentdocumentManagerFactory.getPaymentdocumentManager().getPaymentdocument(id);
				document.setOrderid(exp.getOrderid() );
				document.setCodes(exp.getCodes() );
				document.setProvidername(exp.getProvidername() );
				document.setAddress(exp.getAddress() );
				document.setLinkman(exp.getLinkman() );
				document.setTel(exp.getTel() );
				document.setTimes(exp.getTimes() );
				document.setFax(exp.getFax() );
				document.setEmails(exp.getEmails() );
				document.setId(exp.getId() );
				document.setPay("1");		
				PaymentdocumentManagerFactory.getPaymentdocumentManager().modfilyPaymentdocument(document);
				
				returnStr = WebConstant.FORWARD_INITPAGE;		
			
		} catch (Exception e) {
			errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("edu.system.excption", e.getMessage()));
			this.saveErrors(request, errors);
			tx.rollback();
			e.printStackTrace();
		} finally {
			try {
				if (null != conn) {
					conn.close();
				}
			} catch (Exception ex) {
				ex.printStackTrace();
			}
			HibernateSessionFactory.closeSession();
		}
		return mapping.findForward(returnStr);
	}
}

⌨️ 快捷键说明

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