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

📄 adminmodifybusinessaction.java

📁 上网计费系统,适用网吧或者自己学习用用JAVA写成
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.briup.web.action;

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

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.briup.dao.bean.Product;
import com.briup.dao.bean.Radcheck;
import com.briup.service.IService;
import com.briup.util.BeanFactory;
import com.briup.web.form.BusinessForm;

/**
 * MyEclipse Struts Creation date: 03-25-2007
 * 
 * XDoclet definition:
 * 
 * @struts.action
 * @struts.action-forward name="failed" path="/customers/info/info.jsp"
 * @struts.action-forward name="success" path="/customers/info/info.jsp"
 */
public class AdminModifyBusinessAction extends Action {

	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) {
		BusinessForm businessForm = (BusinessForm) form;
		String businessName = businessForm.getBusinessName();
		String businessPassword = businessForm.getBusinessPassword();
		Long productId = businessForm.getProductId();

		try {
			IService iService = BeanFactory.getService();
			Radcheck radcheck = iService.getBusinesByName(businessName);
			radcheck.setValue(businessPassword);
			if (radcheck.getProduct().getId() != productId) {
				Product product = iService.getProductById(productId);
				radcheck.setProduct(product);
				iService.updateRadcheck(radcheck,true);
			} else {
				iService.updateRadcheck(radcheck,false);
			}
			request.setAttribute("radcheck", radcheck);
		} catch (Exception e) {
			e.printStackTrace();
			request.setAttribute("message", e.getMessage());
		}
		request.setAttribute("message", "修改业务帐号信息成功");
		return mapping.findForward("success");
	}
}

⌨️ 快捷键说明

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