OrderHeader orderHeader = (OrderHeader) em.find(OrderHeader.class, Format.getLong(form.getOrderHeaderId()));
String orderTrackingMessage = form.getOrderTrackingMessage();
if (!Format.isNullOrEmpty(orderTrackingMessage)) {
AdminBean adminBean = getAdminBean(request);
User user = adminBean.getUser();
OrderTracking orderTracking = new OrderTracking();
orderTracking.setOrderTrackingCode("");
orderTracking.setOrderTrackingMessage(orderTrackingMessage);
if (form.isOrderTrackingInternal()) {
orderTracking.setOrderTrackingInternal(String.valueOf(Constants.VALUE_YES));
}
else {
orderTracking.setOrderTrackingInternal(String.valueOf(Constants.VALUE_NO));
}
orderTracking.setRecUpdateBy(user.getUserId());
orderTracking.setRecUpdateDatetime(new Date());
orderTracking.setRecCreateBy(user.getUserId());
orderTracking.setRecCreateDatetime(new Date());
orderTracking.setOrderHeader(orderHeader);
em.persist(orderTracking);
orderHeader.getOrderTrackings().add(orderTracking);
/*
Vector<OrderTracking> temp = new Vector<OrderTracking>();