void btn_actionPerformed(ActionEvent e) {
	  try{

		  if(resrvID==0)//create res
		  {
			  //create new customer if code = 0
			  
			  if(custID == 0){
				  Customer cus = new Customer(0, txtCustomerName.getText(), txtAddress.getText(), txtPhone.getText(), "", txtIDCardNumber.getText());
				  custID = cus.addNewCustomer();
			  }
			//add reservation -> code
			  //public Reservation(int resID, int customerID, Date resDate, Date resLeaveDate, double preTotalCost, int numberOfAdult, int numberOfChild, int resStatus)
			  
			  DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
			 
		      String checkin = dateFormat.format(dateCheckin.getDate());
			  String checkout = dateFormat.format(dateCheckout.getDate());
  
			  resrvID =  Reservation.addReservationStat(custID,  checkin, checkout, Double.parseDouble(txtTotalCost.getText()), Integer.parseInt(spNumOfAdult.getValue().toString()), Integer.parseInt(spNumOfChild.getValue().toString()), 1, isReservation?0:1);//0:reservation, 1 checkin
			

			  //add reservation detail-> code
			  //public ReservationDetail(int resID, int roomID)
			  ReservationDetail resDet = new ReservationDetail(resrvID, roomID);
			  resDetailID = resDet.addReservationDetail();
			  //add resevation detail service
			  int rowCount = tblExtraService.getModel().getRowCount();
			  for(int i=1; i<rowCount; i++){
				  
				  ReservationDetailService reDetSer = new ReservationDetailService(resDetailID, Integer.parseInt(tblExtraService.getModel().getValueAt(i, 0).toString()), 1);
				  reDetSer.addReservationServiceDetail();
			  }
			  
			  //update room status
			  Room.updateStatus(roomID, isReservation?2:3);//2: reserv. 3. checked in
			  Room.updateReservationOcc(roomID, resrvID);
			  System.out.println("ok las");
			  if(isReservation)
				  JOptionPane.showMessageDialog(null,"New Reservation added");
			  else
				  JOptionPane.showMessageDialog(null,"New checkin made");
		  }else//update thanh check in.
		  {
			  Reservation.makeCheckin(resrvID);
			  Room.updateStatus(roomID, 3);//2: reserv. 3. checked in
			  JOptionPane.showMessageDialog(null,"Checkin made from reservation");
		  }
			  
	  }
	  catch(Exception ex){
		  System.out.println(ex.getMessage());
	  }
  }