noticenewsdetailaction.java.svn-base

来自「学习dwr+struts2+spring进行开发的好例子」· SVN-BASE 代码 · 共 73 行

SVN-BASE
73
字号
package com.szhelper.lotteryWeb.webapp.action;

import java.util.Collection;
import java.util.Date;
import java.util.List;

import org.extremecomponents.table.limit.Limit;

import com.szhelper.lotteryWeb.Constants;
import com.szhelper.lotteryWeb.model.NoticeNewsDetail;
import com.szhelper.lotteryWeb.service.INoticeNewsDetailService;
import com.szhelper.lotteryWeb.util.DateUtil;
import com.szhelper.lotteryWeb.util.ExtremeTablePage;
import com.szhelper.lotteryWeb.util.PageBean;

public class NoticeNewsDetailAction extends LotteryUploadAction {
	private NoticeNewsDetail noticeNewsDetail;
	private Collection<NoticeNewsDetail> noticeNewsDetails;
	private INoticeNewsDetailService noticeNewsDetailService;

	private Integer parameter_categoryId;
	private String parameter_author, parameter_title;
	private Date parameter_fromPostDate, parameter_toPostDate;

	public String save() throws Exception {
		freshUpdateDate();
		noticeNewsDetail.setUpdateDate(updateDate);

		//copyToDst();

		if (getNoticeNewsDetailService().saveNoticeNewsDetail(noticeNewsDetail)) {
			return SUCCESS;
		}
		return ERROR;
	}

	public String update() throws Exception {
		freshUpdateDate();
		noticeNewsDetail.setUpdateDate(updateDate);
		
		//copyToDst();
		
		if (getNoticeNewsDetailService().updateNoticeNewsDetail(
				noticeNewsDetail)) {
			return SUCCESS;
		}
		return ERROR;
	}

	public String delete() throws Exception {
		if (null != id) {
			if (getNoticeNewsDetailService().deleteNoticeNewsDetail(
					id.intValue()))
				return SUCCESS;
		} /*
			 * else { if
			 * (getNoticeNewsDetailService().deleteNoticeNewsDetail(id.intValue()))
			 * return SUCCESS; }
			 */
		return ERROR;
	}

	public String load() {
		noticeNewsDetail = getNoticeNewsDetailService()
				.getNoticeNewsDetailByKey(id);
		return SUCCESS;
	}

	public String list() {
		try {
			Limit limit = ExtremeTablePage.getLimit(request, defaultPageSize);
			PageBean page = new PageBean();
			page.setPageSize(limit.getCurrentRowsDisplayed()); // ecͨ��limit���

⌨️ 快捷键说明

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