Advertisement
Guest User

Untitled

a guest
Mar 28th, 2013
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.83 KB | None | 0 0
  1.     public void updateDailyAttendance(ActionRequest areq, ActionResponse aRes) throws Exception {
  2.         int totalEmployees = EmployeeLocalServiceUtil.getEmployeesCount();
  3.         String attendanceValue = getAttendanceValue(areq);
  4.         for (int i = 0; i < totalEmployees; i++) {
  5.             // use attendanceValue to update employee entry
  6.         }
  7.     }
  8.  
  9.     private String getAttendanceValue(ActionRequest areq) {
  10.         Enumeration parameters = areq.getParameterNames();
  11.         while (parameters.hasMoreElements()) {
  12.             String parameterName = parameters.nextElement().toString();
  13.             if (parameterName.startsWith("updateattendance")) {
  14.                 return areq.getParameter(parameterName);
  15.             }
  16.         }
  17.         throw new IllegalStateException("Parameter updateattendance is not found");
  18.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement