www.pudn.com > liberSystem.rar > BookTypeAction.java, change:2012-06-06,size:968b


package com.ccl.action; 
 
import com.ccl.domin.BookType; 
import com.ccl.service.BookTypeService; 
import com.opensymphony.xwork2.ActionSupport; 
 
public class BookTypeAction extends ActionSupport { 
	private static BookTypeService bookTypeService=new BookTypeService(); 
	private String name; 
	private int id; 
	public int getId() { 
		return id; 
	} 
	public void setId(int id) { 
		this.id = id; 
	} 
	public String booktype_add(){ 
		BookType bookType=new BookType(); 
		bookType.setName(name); 
		bookTypeService.booktype_add(bookType); 
		return SUCCESS; 
	} 
	public String booktype_del(){ 
		bookTypeService.booktype_del(id); 
		return SUCCESS; 
	} 
	public String booktype_update(){ 
		BookType bookType=new BookType(); 
		bookType.setId(id); 
		bookType.setName(name); 
		bookTypeService.booktype_update(bookType); 
		return SUCCESS; 
	} 
	public String getName() { 
		return name; 
	} 
	public void setName(String name) { 
		this.name = name; 
	} 
	 
}