首页>代码>java web开发简单BBS论坛系统>/forum/src/com/chen/action/AnnounceAction.java
/**
 * 
 */
package com.chen.action;

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

import com.chen.bean.Announces;
import com.chen.bean.Pages;
import com.chen.service.AnnounceService;

/**
 * @author chenguoji
 * @email chenguo_ji@163.com
 * 
 * 论坛公告
 * 
 */
public class AnnounceAction {

	private Announces announce;
	private AnnounceService announceService;
	private List<Announces> listAnno;
	private Pages pageBean;
	private int annoId = 1;
	private int annoSize;
	private int nowPage = 0;

	public String getIndexAnno() throws Exception {
		this.listAnno = this.announceService.getIndexAnno(6);
		this.announce = this.announceService.find(annoId);
		if(announce==null){
			return "error";
		}
		return "anno_getIndex_ok";
	}

	public String getAll() throws Exception {
		this.listAnno = this.announceService.getAll();
		this.announce = this.announceService.find(annoId);
		if(announce==null){
			return "error";
		}
		this.annoSize = this.listAnno.size();
		return "anno_getAll_ok";
	}

	public String ManageAll() throws Exception {
		this.pageBean = this.announceService.ManageAllForPages(10, nowPage);
		this.listAnno = pageBean.getListAnno();
		return "anno_mangeAll_ok";
	}

	public String ManageGoUpdate() throws Exception {
		this.announce = this.announceService.find(this.announce.getId());
		if(announce==null){
			return "error";
		}
		return "anno_manageGoUpdate_ok";
	}
	
	public String ManageAdd() throws Exception{
		Date ttime = new Date();
		this.announce.setThetime(ttime);
		this.announceService.ManageAdd(announce);
		return "anno_ManageAdd_ok";
	}

	public String ManageUpdate() throws Exception {
		Date ttime = new Date();
		announce.setThetime(ttime);
		this.announceService.ManageUpdate(announce);	
		return "anno_manageUpdate_ok";
	}

	public AnnounceService getAnnounceService() {
		return announceService;
	}

	public void setAnnounceService(AnnounceService announceService) {
		this.announceService = announceService;
	}

	public List<Announces> getListAnno() {
		return listAnno;
	}

	public void setListAnno(List<Announces> listAnno) {
		this.listAnno = listAnno;
	}

	public int getAnnoId() {
		return annoId;
	}

	public void setAnnoId(int annoId) {
		this.annoId = annoId;
	}

	public int getAnnoSize() {
		return annoSize;
	}

	public void setAnnoSize(int annoSize) {
		this.annoSize = annoSize;
	}

	public Pages getPageBean() {
		return pageBean;
	}

	public void setPageBean(Pages pageBean) {
		this.pageBean = pageBean;
	}

	public int getNowPage() {
		return nowPage;
	}

	public void setNowPage(int nowPage) {
		this.nowPage = nowPage;
	}

	public Announces getAnnounce() {
		return announce;
	}

	public void setAnnounce(Announces announce) {
		this.announce = announce;
	}

}
最近下载更多
123ggf  LV8 2023年6月14日
limin123  LV6 2023年6月11日
0011100  LV12 2023年5月31日
微信网友_6495054193971200  LV2 2023年5月29日
1796527961  LV1 2023年3月23日
wouldbb  LV6 2023年3月21日
tyyeng  LV18 2023年1月1日
long123_356  LV5 2022年12月10日
akbar2020  LV9 2022年9月4日
yazhiyjs  LV4 2022年8月30日
最近浏览更多
Rinkia 3月28日
暂无贡献等级
xiaopengzep  LV1 3月24日
lvhongquan  LV11 2023年12月31日
没有的没有 2023年12月27日
暂无贡献等级
wutongzui11 2023年12月13日
暂无贡献等级
云着殇  LV8 2023年12月13日
空中飞尘  LV13 2023年12月13日
唐唐丶  LV33 2023年12月3日
hongdongdong  LV12 2023年12月2日
微信网友_6465435620184064  LV6 2023年10月24日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友