📄 admincreateforum.java
字号:
/* * 作者: 胡李青 * qq: 31703299 * Copyright (c) 2007 huliqing * 主页 http://www.tbuy.biz/ * 你可以免费使用该软件,未经许可请勿作用于任何商业目的,如有技术问题请与本人联系! */package biz.tbuy.bbs.bean;import biz.tbuy.bbs.ForumAction;import biz.tbuy.bbs.ForumModel;import biz.tbuy.bbs.ZoneModel;import biz.tbuy.common.Utils;import biz.tbuy.common.Constants;/** * @author huliqing * <p><b>qq:</b>31703299 * <p><b>E-mail:</b> * <a href="mailto:huliqing.cn@gmail.com">huliqing.cn@gmail.com</a> * <p><b>Homepage:</b> * <a href="http://www.tbuy.biz/">http://www.tbuy.biz/</a> */public class AdminCreateForum extends BaseBean{ // 该ZoneModel主要标识当前所要创建的forum的所属专区 private ZoneModel zone = new ZoneModel(); private String name; private String comment; private boolean beLock; /** Creates a new instance of CreateForumBean */ public AdminCreateForum() { } public void setZone(ZoneModel zone) { this.zone = zone; } public ZoneModel getZone() { return zone; } //** set and get *******************/ public void setName(String name) { this.name = name; } public String getName() { return name; } public void setComment(String comment) { this.comment = comment; } public String getComment() { return comment; } public void setBeLock(boolean beLock) { this.beLock = beLock; } public boolean getBeLock() { return beLock; } /** method ****************************************************************/ /** * 创建讨论区 * @return String */ public String create() { if (!getVisitor().isLogin()) { Utils.addErrorMessage(getBundle(), "你需要先登录,才能进行操作!"); return Constants.OUT_FAILURE; } if (addForum()) { Utils.addInfoMessage(getBundle(), "创建讨论区成功!"); getBBSApplication().reloadZonsAndForums(); // 创建讨论区后的相关操作 return Constants.OUT_SUCCESS; } else { Utils.addErrorMessage(getBundle(), "创建讨论区失败!"); return Constants.OUT_FAILURE; } } /** * 添加Zone进数据库 * @return boolean - true if success else false */ private boolean addForum() { ForumModel fModel = new ForumModel(); fModel.setName(name); fModel.setComment(comment); fModel.setBeLock(beLock); fModel.setBeRevoke(false); fModel.setByZone(zone.getNum()); fModel.setByUser(getVisitor().getUser().getId()); return ForumAction.addForum(fModel); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -