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

📄 intergralruleaction.java

📁 自己制作的联通CRM,支持客户分类,管理,升级,积分管理等等..
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.jn0801.intergral.rule;

import java.io.IOException;
import java.io.PrintWriter;

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

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;

import com.jn0801.datadictionary.DataDictionaryDao;

/**
 * MyEclipse Struts Creation date: 08-20-2008
 * 
 * XDoclet definition:
 * 
 * @struts.action path="/intergralRule" name="intergralRuleForm"
 *                parameter="task" scope="request" validate="true"
 */
public class IntergralRuleAction extends DispatchAction {

	private IntergralRuleDao intergralRuleDao;

	private DataDictionaryDao dataDictionaryDao;

	/**
	 * 此方法返回积分规则列表
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 */
	public ActionForward listIntergralRule(ActionMapping mapping,
			ActionForm form, HttpServletRequest request,
			HttpServletResponse response) {
		IntergralRuleForm intergralRuleForm = (IntergralRuleForm) form;
		String location = intergralRuleForm.getLocation();
		String servertype = intergralRuleForm.getServertype();
		request.setAttribute("intergralRuleList", this.intergralRuleDao
				.listIntergralRule(location, servertype, request));
		request.setAttribute("locationList", this.dataDictionaryDao
				.listData("地区"));
		request.setAttribute("servertypeList", this.dataDictionaryDao
				.listData("品牌类型"));
		return mapping.findForward("intergralRule");
	}

	/**
	 * 此方法修改积分规则
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 */
	public ActionForward modifyIntergralRule(ActionMapping mapping,
			ActionForm form, HttpServletRequest request,
			HttpServletResponse response) {
		IntergralRuleForm intergralRuleForm = (IntergralRuleForm) form;
		this.intergralRuleDao.modifyIntergralRule(intergralRuleForm);
		try {
			PrintWriter printWriter = response.getWriter();
			printWriter
					.print("<script>location.href='intergralRule.do?task=listIntergralRule';alert('修改成功');</script>");
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

	/**
	 * 此方法删除积分规则
	 * 
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return
	 */
	public ActionForward deleteIntergralRule(ActionMapping mapping,
			ActionForm form, HttpServletRequest request,
			HttpServletResponse response) {
		IntergralRuleForm intergralRuleForm = (IntergralRuleForm) form;
		this.intergralRuleDao
				.deleteIntergralRule(intergralRuleForm.getRuleid());
		try {
			PrintWriter printWriter = response.getWriter();
			printWriter
					.print("<script>location.href='intergralRule.do?task=listIntergralRule';alert('删除成功');</script>");
		} catch (IOException e) {
			e.printStackTrace();
		}
		return null;
	}

	/**
	 * @return the dataDictionaryDao
	 */
	public DataDictionaryDao getDataDictionaryDao() {
		return dataDictionaryDao;
	}

	/**
	 * @param dataDictionaryDao
	 *            the dataDictionaryDao to set
	 */
	public void setDataDictionaryDao(DataDictionaryDao dataDictionaryDao) {
		this.dataDictionaryDao = dataDictionaryDao;
	}

	/**
	 * @return the intergralRuleDao
	 */
	public IntergralRuleDao getIntergralRuleDao() {
		return intergralRuleDao;
	}

	/**
	 * @param intergralRuleDao
	 *            the intergralRuleDao to set
	 */
	public void setIntergralRuleDao(IntergralRuleDao intergralRuleDao) {
		this.intergralRuleDao = intergralRuleDao;
	}

}

⌨️ 快捷键说明

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