public PurchasingGRManager() { SecurityUser securityUser = (SecurityUser) FacesUtils.getSessionObject(Constants.USER_KEY, SecurityUser.class); try { warehouseCode = warehouseController.getWareHouseCode(securityUser); } catch (ControllerException e) { FacesUtils.reportError(FacesContext.getCurrentInstance(), e.getMessage(), e.getMessage(), e); e.printStackTrace(); } // ËÒ»Õ§º»ÃÐÁÒ³ Calendar currentCal = CalendarUtils.getDateInstance(CalendarUtils.LOCALE_TH); budgetYear = CalendarUtils.toFinancialYear( CalendarUtils.LOCALE_TH, CalendarUtils.LOCALE_TH, currentCal.getTime()); try { budget = budController.getBudget(budgetYear); } catch (ControllerException e) { FacesUtils.reportError(FacesContext.getCurrentInstance(), e.getMessage(), e.getMessage(), e); e.printStackTrace(); } welcomeMsg = securityUser.getFullName(); createPOSelectItemList(); createStorageLocationSelectItemList(); createGRTypeSelectItemList(); createMaterialGroupSelectItemList(); createBudgetItemSelectItemList(); getSuggestionList(); listGR(); newGR(); }
public User getUserFromSession() { User user = new User(); try { SecurityUser securityUser = (SecurityUser) FacesUtils.getSessionObject(Constants.USER_KEY, SecurityUser.class); user = secController.getUser( securityUser.getUsername(), securityUser.getSystemName(), securityUser.getSubSystemName()); } catch (ControllerException e) { e.printStackTrace(); } return user; }