public String actionOnFeedback() {
   String returnResult = ERROR;
   boolean sessionFlag = ValidateSession.checkSession();
   if (sessionFlag) {
     try {
       if (dashFor != null && getDeptId() == null && feedStatus.equals("Pending")) {
         headingTitle = "Pending Feedback >> View";
         returnResult = SUCCESS;
       } else if ((dashFor != null && getDeptId() == null) && feedStatus.equals("Snooze")) {
         headingTitle = "Snooze Feedback >> View";
         returnResult = SUCCESS;
       } else if ((dashFor != null && getDeptId() == null) && feedStatus.equals("High Priority")) {
         headingTitle = "High Priority Feedback >> View";
         returnResult = SUCCESS;
       } else if ((dashFor != null && getDeptId() == null) && feedStatus.equals("Resolved")) {
         fromDate = DateUtil.getNewDate("month", -1, DateUtil.getCurrentDateUSFormat());
         toDate = DateUtil.getCurrentDateUSFormat();
         headingTitle = "Resolved Feedback >> View";
         returnResult = SUCCESS;
       }
       setGridColomnNames();
     } catch (Exception e) {
       e.printStackTrace();
     }
   } else {
     returnResult = LOGIN;
   }
   return returnResult;
 }
 public String beforeActionOnFeedback() {
   String returnResult = ERROR;
   boolean sessionFlag = ValidateSession.checkSession();
   if (sessionFlag) {
     try {
       if (moduleName != null
           && !moduleName.equals("")
           && moduleName.equalsIgnoreCase("DREAM_HDM")
           && feedStatus != null
           && !feedStatus.equals("")
           && (feedStatus.equals("Pending")
               || feedStatus.equals("Snooze")
               || feedStatus.equals("High Priority"))) {
         setFromDate(DateUtil.getNewDate("week", -1, DateUtil.getCurrentDateUSFormat()));
         toDate = DateUtil.getCurrentDateUSFormat();
         statusList();
         deptList();
         returnResult = SUCCESS;
       } else if (moduleName != null
           && !moduleName.equals("")
           && moduleName.equalsIgnoreCase("DREAM_HDM")
           && feedStatus != null
           && !feedStatus.equals("")
           && feedStatus.equals("Resolved")) {
         setFromDate(DateUtil.getNewDate("week", -1, DateUtil.getCurrentDateUSFormat()));
         toDate = DateUtil.getCurrentDateUSFormat();
         statusList();
         deptList();
         returnResult = SUCCESS;
       }
       if (moduleName != null
           && !moduleName.equals("")
           && moduleName.equalsIgnoreCase("DREAM_HDM")) {
         setGridColomnNames();
       }
     } catch (Exception e) {
       e.printStackTrace();
     }
   } else {
     returnResult = LOGIN;
   }
   return returnResult;
 }
 public String beforeAuditHeader() {
   boolean sessionFlag = ValidateSession.checkSession();
   if (sessionFlag) {
     try {
       fromDate = DateUtil.getNewDate("day", -6, DateUtil.getCurrentDateUSFormat());
       toDate = DateUtil.getCurrentDateUSFormat();
       return SUCCESS;
     } catch (Exception e) {
       e.printStackTrace();
       return ERROR;
     }
   } else {
     return LOGIN;
   }
 }
  @SuppressWarnings("rawtypes")
  public String beforeReportView() {
    if (ValidateSession.checkSession()) {
      try {
        String userName = (String) session.get("uName");
        CommonOperInterface cbt = new CommonConFactory().createInterface();
        SessionFactory connectionSpace = (SessionFactory) session.get("connectionSpace");
        TaskRegistrationHelper TRH = new TaskRegistrationHelper();
        StringBuilder query = new StringBuilder();
        String userEmpID = null;
        String alltedTo = null;
        String empIdofuser = (String) session.get("empIdofuser");
        if (empIdofuser == null || empIdofuser.split("-")[1].trim().equals("")) return ERROR;
        userEmpID = empIdofuser.split("-")[1].trim();
        String userContID = null;
        userContID = TRH.getEmpDetailsByUserName("DAR", userName, connectionSpace)[0];
        alltedTo = TRH.getContactListForReports(userEmpID, userContID, connectionSpace);

        query.append("SELECT DISTINCT (contact.id),emp.empName FROM task_registration AS tr ");
        query.append("INNER JOIN compliance_contacts as contact ON contact.id=tr.allotedto ");
        query.append(
            "INNER JOIN employee_basic as emp ON contact.emp_id=emp.id WHERE contact.id IN ("
                + alltedTo
                + ")");
        List data = cbt.executeAllSelectQuery(query.toString(), connectionSpace);
        allotedTo = new LinkedHashMap<Integer, String>();

        if (data != null && data.size() > 0) {
          for (Iterator iterator = data.iterator(); iterator.hasNext(); ) {
            Object[] object = (Object[]) iterator.next();
            if (object[1] != null) {
              allotedTo.put((Integer) object[0], object[1].toString());
            }
          }
        }
        allotedTo.put(-1, "All Employee");
        query.setLength(0);
        if (data != null && data.size() > 0) {
          data.clear();
        }
        query.append("SELECT id,tasktype FROM task_type");
        taskType = new LinkedHashMap<Integer, String>();
        data = cbt.executeAllSelectQuery(query.toString(), connectionSpace);
        if (data != null && data.size() > 0) {
          for (Iterator iterator = data.iterator(); iterator.hasNext(); ) {
            Object[] object = (Object[]) iterator.next();
            if (object[1] != null) {
              taskType.put((Integer) object[0], object[1].toString());
            }
          }
        }
        fromDate = DateUtil.getNewDate("day", -7, DateUtil.getCurrentDateUSFormat());
        return SUCCESS;
      } catch (Exception e) {
        e.printStackTrace();
        return ERROR;
      }
    } else {
      return ERROR;
    }
  }