Package com.impetus.kundera.datakeeper.entities

Examples of com.impetus.kundera.datakeeper.entities.Employee


    }

    public String searchEmployee()
    {
        DataKeeperService service = DataKeeperUtils.getService();
        Employee employee = null;
        switch (SearchType.getSearchType(searchBy))
        {
        case ID:
            employee = service.findEmployee(Integer.parseInt(getSearchText()));
            break;
View Full Code Here


    public String searchEmployeeByYearOfComplition()
    {
        DataKeeperService service = DataKeeperUtils.getService();
        HttpSession session = FacesUtils.getSession();
        Employee employee = (Employee) session.getAttribute(DataKeeperConstants.EMPLOYEE);
        List<Employee> employees = service.findEmployeeByDateOfJoining(getNoOfYears(), employee.getCompany());
        if (employees != null)
        {
            this.subordinates = employees;
        }
        return "foundEmployess";
View Full Code Here

    public String incrementCounter()
    {
        DataKeeperService service = DataKeeperUtils.getService();

        HttpSession session = FacesUtils.getSession();
        Employee employee = (Employee) session.getAttribute(DataKeeperConstants.EMPLOYEE);
        counter.setEmployeeId(employee.getEmployeeId());
       
        service.incrementCounter(counter);
       
        return "success";
    }
View Full Code Here

    }

    public String handleFileUpload(FileUploadEvent event)
    {
        HttpSession session = FacesUtils.getSession();
        Employee employee = (Employee) session.getAttribute(DataKeeperConstants.EMPLOYEE);

        DataKeeperService service = DataKeeperUtils.getService();

        UploadedFile file = event.getFile();

        if (file != null)
        {
            DocumentInfo dataInfo = new DocumentInfo();
            dataInfo.setData(file.getContents());
            dataInfo.setDocumentName(file.getFileName());
            dataInfo.setSize(file.getSize());
            dataInfo.setOwnerName(employee.getEmployeeName());
            dataInfo.setOwnerId(employee.getEmployeeId());
            dataInfo.setUplodedDate(new Date());

            service.insertData(dataInfo);

            FacesMessage msg = new FacesMessage("Succesful", file.getFileName() + " is uploaded.");
View Full Code Here

    public String deleteAccount()
    {
        HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true);
        DataKeeperService service = DataKeeperUtils.getService();
        Employee employee = (Employee) session.getAttribute(DataKeeperConstants.EMPLOYEE);

        service.removeEmployee(employee);

        FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Account successfully deleted"));
        session.invalidate();
View Full Code Here

            return outcome;
        }
        else
        {
            DataKeeperService service = DataKeeperUtils.getService();
            Employee foundEmployee = service.findEmployeeByName(employee.getEmployeeName());
            boolean success = service.authenticateEmployee(foundEmployee, employee.getPassword());

            if (!success)
            {
                FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Incorrect User Name/Password"));
View Full Code Here

    public String save()
    {
        DataKeeperService service = DataKeeperUtils.getService();

        Employee manager = service.findEmployee(managerId);

        employee.setManager(manager);
        employee.setTimestamp(employee.getJoiningDate().getTime());

        service.insertEmployee(employee);
View Full Code Here

    }

    @Override
    public Employee findEmployeeByName(String employeeName)
    {
        Employee employee = null;
        String query = "Select e from " + Employee.class.getSimpleName() + " e where e.employeeName = " + employeeName;
        List<Employee> employees = (List<Employee>) dao.findByQuery(query);
        if (!employees.isEmpty() && employees.get(0) != null)
        {
            employee = employees.get(0);
View Full Code Here

    }

    @Override
    public List<Employee> findSubOrdinates(int managerId)
    {
        Employee manager = dao.findById(Employee.class, managerId);
        List<Employee> subOrdinates = manager != null ? manager.getSubordinates() : new ArrayList<Employee>();
        return subOrdinates;
    }
View Full Code Here

TOP

Related Classes of com.impetus.kundera.datakeeper.entities.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.