public void generalMethod() { try { String userName = (String) session.get("uName"); List empData = new HelpdeskUniversalAction() .getEmpDataByUserName(Cryptography.encrypt(userName, DES_ENCRYPTION_KEY), "2"); if (empData != null && empData.size() > 0) { for (Iterator iterator = empData.iterator(); iterator.hasNext(); ) { Object[] object = (Object[]) iterator.next(); empName = object[0].toString(); dept_id = object[3].toString(); dept = object[4].toString(); loginType = object[7].toString(); /* if(loginType.equalsIgnoreCase("H")) { hodFlag=true; headerValue=dept; } else if (loginType.equalsIgnoreCase("M")) { mgmtFlag=true; headerValue="All Department"; } else if (loginType.equalsIgnoreCase("N")) { headerValue=DateUtil.makeTitle(empName); normalFlag=true; }*/ } } } catch (Exception e) { e.printStackTrace(); } }
@SuppressWarnings("rawtypes") public String getFeedbackDetail() { String returnResult = ERROR; boolean sessionFlag = ValidateSession.checkSession(); if (sessionFlag) { try { String userName = (String) session.get("uName"); SessionFactory connectionSpace = (SessionFactory) session.get("connectionSpace"); ComplaintLodgeHelper CLH = new ComplaintLodgeHelper(); feedbackList = new ArrayList<FeedbackPojo>(); List data = null; String dept_subdept_id = ""; String contactLoggedId = null; String[] empData = CLH.getEmpDetailsByUserName( "DREAM_HDM", Cryptography.encrypt(userName, DES_ENCRYPTION_KEY), connectionSpace); if (empData != null && empData.length > 0) { dept_subdept_id = empData[4]; contactLoggedId = empData[0]; } if (dept_subdept_id != null && !dept_subdept_id.equals("")) { if (dataFlag != null && dataFlag.equals("M")) { toDate = DateUtil.convertDateToUSFormat(toDate); fromDate = DateUtil.convertDateToUSFormat(fromDate); } else { toDate = toDate; fromDate = fromDate; } data = CLH.getFeedbackDetail( "complaint_status", getFeedStatus(), fromDate, toDate, dept_subdept_id, contactLoggedId, "feedback.id", "ASC", "DREAM_HDM", searchField, searchString, searchOper, connectionSpace); } if (data != null && data.size() > 0) { setRecords(data.size()); int to = (getRows() * getPage()); @SuppressWarnings("unused") int from = to - getRows(); if (to > getRecords()) to = getRecords(); feedbackList = CLH.setFeedbackValues(data, getFeedStatus(), connectionSpace); setTotal((int) Math.ceil((double) getRecords() / (double) getRows())); } returnResult = SUCCESS; } catch (Exception e) { addActionError("Ooops!!! There is some problem in getting Feedback Data"); e.printStackTrace(); } } else { returnResult = LOGIN; } return returnResult; }