Package com.itedge.solutionmanager.domain.impl

Examples of com.itedge.solutionmanager.domain.impl.Employee


  }
 
  @Override
  @Transactional
    public Employee merge(Employee emp) {
    Employee merged = null;
       /* Update version property, in case employee was changed in meantime. */   
    synchronized(this) {
      Employee attached = this.entityManager.find(Employee.class, emp.getId());
      emp.setVersion(attached.getVersion());
      merged = this.entityManager.merge(emp);
    }
    this.entityManager.flush();
        return merged;
    }
View Full Code Here


    String peopleStr = request.getParameter("assignedEmployees");
    if (!StringUtil.isEmpty(peopleStr)) {
      String[] emplyeesIds = peopleStr.split(",");
      for(String temp: emplyeesIds) {
        Long id = new Long(temp);
        Employee p = employeeService.findEntity(id);
        emplyees.add(p);
      }
    }
    taskData.setAssignedEmployees(emplyees);   
  }
View Full Code Here

        return "redirect:/useradmin/" + WebUtil.encodeUrlPathSegment(employee.getId().toString(), request);
    }
   
  @RequestMapping(params = "form", method = RequestMethod.GET)
    public String createForm(Model model) {
        model.addAttribute("employee", new Employee());
        return "useradmin/create";
    }
View Full Code Here

        if (result.hasErrors()) {
            model.addAttribute("employee", employee);
            return "useradmin/edit";
        }
        bindRoles(employee,request);
        Employee toUpdate = employeeService.findEntity(employee.getId());
      toUpdate.getAddress().setEmail(employee.getAddress().getEmail());
      toUpdate.setUsername(employee.getUsername());
      toUpdate.setFirstName(employee.getFirstName());
      toUpdate.setSecondName(employee.getSecondName());
        toUpdate.setEmplAuthorities(employee.getEmplAuthorities());
        toUpdate.setEnabled(employee.isEnabled());
        employeeService.merge(toUpdate);
        return "redirect:/useradmin/" + WebUtil.encodeUrlPathSegment(employee.getId().toString(), request);
   
View Full Code Here

        return "redirect:/useradmin/" + WebUtil.encodeUrlPathSegment(employee.getId().toString(), request);
   
 
  @RequestMapping(value = "/{id}", params = "form", method = RequestMethod.GET)
    public String edit(@PathVariable("id") Long id, Model model) {
        Employee employee = employeeService.findEntity(id);
        model.addAttribute("assignedIds", WebUtil.getIdsStringFromEntities(employee.getEmplAuthorities()));
    model.addAttribute("employee", employee);
        return "useradmin/edit";
    }
View Full Code Here

        return "useradmin/search";
    }  
 
  @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    public String show(@PathVariable("id") Long id, Model model) {
        Employee employee = employeeService.findEntity(id);
        model.addAttribute("itemId", id);
    model.addAttribute("employee", employee);
        return "useradmin/show";
    }
View Full Code Here

   * Method used for AJAX search requests on users, returning data in JSON format
   */
  @RequestMapping(params = "searchForm", method = RequestMethod.POST, headers = "Accept=application/json")
    public @ResponseBody List<EmployeeDto> searchAsyncForUsers(@RequestParam(value = "searchName") String searchName,
          @RequestParam(value = "maxResults", required = false) Integer maxResults, HttpServletRequest request) {     
        Employee searchEmployee = new Employee();
        searchEmployee.setUsername(searchName);
        Iterator<Employee> usersIt = employeeService.findEntitiesByCriteria(searchEmployee, maxResults).iterator();
        List<EmployeeDto> employeeDtoList = new ArrayList<EmployeeDto>();
        while(usersIt.hasNext()) {
          employeeDtoList.add(new EmployeeDto(usersIt.next()));
        }
View Full Code Here

TOP

Related Classes of com.itedge.solutionmanager.domain.impl.Employee

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.