Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void updateDailyAttendance(ActionRequest areq, ActionResponse aRes) throws Exception {
- int totalEmployees = EmployeeLocalServiceUtil.getEmployeesCount();
- String attendanceValue = getAttendanceValue(areq);
- for (int i = 0; i < totalEmployees; i++) {
- // use attendanceValue to update employee entry
- }
- }
- private String getAttendanceValue(ActionRequest areq) {
- Enumeration parameters = areq.getParameterNames();
- while (parameters.hasMoreElements()) {
- String parameterName = parameters.nextElement().toString();
- if (parameterName.startsWith("updateattendance")) {
- return areq.getParameter(parameterName);
- }
- }
- throw new IllegalStateException("Parameter updateattendance is not found");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement