package com.oa.action;
import java.util.List;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import com.oa.base.BaseAction;
import com.oa.domain.Forum;
import com.opensymphony.xwork2.ActionContext;
@Controller
@Scope("prototype")
public class ForumManageAction extends BaseAction<Forum> {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* 列表功能
*
* @return
* @throws Exception
*/
public String list() throws Exception {
List<Forum> forumList = forumService.findAll();
ActionContext.getContext().put("forumList", forumList);
return "list";
}
/**
* 删除功能
*
* @return
* @throws Exception
*/
public String delete() throws Exception {
forumService.remove(model.getId());
return "toList";
}
/**
* 添加页面功能
*
* @return
* @throws Exception
*/
public String addUI() throws Exception {
return "saveUI";
}
/**
* 添加功能
*
* @return
* @throws Exception
*/
public String add() throws Exception {
forumService.save(model);
return "toList";
}
/**
* 修改页面功能
*
* @return
* @throws Exception
*/
public String updateUI() throws Exception {
//准备回显的数据
Forum forum = forumService.findById(model.getId());
ActionContext.getContext().getValueStack().push(forum);
return "saveUI";
}
/**
* 修改功能
*
* @return
* @throws Exception
*/
public String update() throws Exception {
//从数据库中获取原来的对象
Forum forum = forumService.findById(model.getId());
//设置要修改的属性
forum.setName(model.getName());
forum.setDescription(model.getDescription());
//保存到数据库
forumService.modify(forum);
return "toList";
}
/**
* 上移功能
*
* @return
* @throws Exception
*/
public String moveUp() throws Exception {
forumService.moveUp(model.getId());
return "toList";
}
/**
* 下移功能
*
* @return
* @throws Exception
*/
public String moveDown() throws Exception {
forumService.moveDown(model.getId());
return "toList";
}
}
最近下载更多
xiaohuaidan455 LV2
2月21日
朱俪的邮件及存储 LV8
2023年4月28日
泓鼎168 LV20
2023年3月30日
wanglinddad LV55
2022年5月26日
529948627 LV6
2022年3月14日
蛇蛇皮怪 LV14
2022年3月8日
微信网友_5845420553359360 LV4
2022年2月25日
juanito8396 LV6
2021年12月20日
and123456 LV11
2021年5月11日
shiyujir LV7
2021年4月8日

最近浏览