if (request.getParameter("Checkout") != null) {
String idKhachHang = (String) request.getAttribute(
"TaiKhoan", WebRequest.SCOPE_SESSION);
UserDAO khDAO = new UserDAOImpl();
User kh = khDAO.getUserInfo(idKhachHang);
if (hoten.equals("") || diachi.equals("")
|| dienthoai.equals("")) {
model.addAttribute("notice",
"Please enter all information");
} else if (sanphams.size() == 0) {
model.addAttribute("notice",
"Please buys something to checkout");
} else {
Date ngaymua = new Date();
Deliverstatus status = deliverstatusDAO
.getDefaultDeliverstatus();
BillDAO billDAO = new BillDAOImpl();
Bill hd = new Bill(status, kh.getIduser(), tongTien,
hoten, diachi, dienthoai, ngaymua, null);
billDAO.addBill(hd);
Set<Billdetail> billdetails = new HashSet<Billdetail>();
for (int i = 0; i < sanphams.size(); i++) {