日期:2014-05-17 浏览次数:20714 次
package db; import java.io.Serializable; public class BookBean implements Serializable { private static final long serialVersionUID = 1L; private int id; private String title; private String author; private String bookconcern; private String publish_date; private float price; private int amount; private String remark; public BookBean() { } public BookBean(int id, String title, String author, String bookconcern, String publish_date, float price, int amount, String remark) { this.id=id; this.title=title; this.author=author; this.bookconcern=bookconcern; this.publish_date=publish_date; this.price=price; this.amount=amount; this.remark=remark; } public int getId() { return id; } public void setTitle(String title) { this.title = title; } public void setAuthor(String author) { this.author = author; } public void setBookconcern(String bookconcern) { this.bookconcern = bookconcern; } public void setPublish_date(String publish_date) { this.publish_date = publish_date; } public void setPrice(float price) { this.price = price; } public void setAmount(int amount) { this.amount = amount; } public void setRemark(String remark) { this.remark = remark; } public String getTitle() { return title; } public String getAuthor() { return author; } public String getBookconcern() { return bookconcern; } public String getPublish_date() { return publish_date; } public float getPrice() { return price; } public int getAmount() { return amount; } public String getRemark() { return remark; } }
package db; import java.io.Serializable; public class CartItemBean implements Serializable { private BookBean book=null; private int quantity=0; public CartItemBean() { } public CartItemBean(BookBean book) { this.book=book; this.quantity=1; } public void setBook(BookBean book) { this.book = book; } public BookBean getBook() { return book; } public void setQuantity(int quantity) { this.quantity = quantity; } public int getQuantity() { return quantity; } public float getItemPrice() { float price=book.getPrice()*quantity; long val=Math.round(price*100); return val/100.0f; } }