Package org.focusns.model.core

Examples of org.focusns.model.core.ProjectCategory


        model.put("categories", categories);
        return "console/menu-items";
    }

    public String menuItem(long id, Map<String, Object> model) {
        ProjectCategory category = new ProjectCategory();
        if (id > 0) {
            category = categoryService.getCategory(id);
        }
        model.put("category", category);
        return "console/menu-item";
View Full Code Here


            ProjectService projectService = applicationContext.getBean(ProjectService.class);
            ProjectCategoryService projectCategoryService = applicationContext.getBean(ProjectCategoryService.class);
            ProjectFeatureService projectFeatureService = applicationContext.getBean(ProjectFeatureService.class);
            //
            Project project = projectService.getProject(projectCode);
            ProjectCategory projectCategory = projectCategoryService.getCategory(project.getCategoryId());
            //
            request.setAttribute(Keys.REQUEST_PROJECT, project);
            request.setAttribute(Keys.REQUEST_PROJECT_CATEGORY, projectCategory);
            //
            List<ProjectFeature> projectFeatures = projectFeatureService.getProjectFeatures(project.getId());
View Full Code Here

        return "console/site/menu-list";
    }

    @RequestMapping("/menu-edit")
    public String doEdit(@RequestParam(required = false) Long id, Model model) {
        ProjectCategory category = new ProjectCategory();
        if (id != null) {
            category = categoryService.getCategory(id);
        }
        model.addAttribute("category", category);
        //
View Full Code Here

    @Autowired
    private ProjectCategoryDao categoryDao;

    @Test
    public void testInsert() {
        ProjectCategory category = new ProjectCategory();
        category.setCode("People");
        category.setLabel("人员");
        //
        int count = categoryDao.insert(category);
        Assert.assertEquals(1, count);
    }
View Full Code Here

        Assert.assertEquals(1, count);
    }

    @Test
    public void testDelete() {
        ProjectCategory category = categoryDao.selectByCode("People");
        int count = categoryDao.delete(category.getId());
        Assert.assertEquals(1, count);
    }
View Full Code Here

        if(project.getModifiedBy()==null && project.getModifiedById()>0) {
            ProjectUser modifiedBy = projectUserDao.select(project.getModifiedById());
            project.setModifiedBy(modifiedBy);
        }
        if(project.getCategory()==null && project.getCategoryId()>0) {
            ProjectCategory projectCategory = projectCategoryService.getCategory(project.getCategoryId());
            project.setCategory(projectCategory);
        }
        //
        return project;
    }
View Full Code Here

    @Autowired
    private ProjectCategoryDao categoryDao;

    @Test
    public void setup() {
        ProjectCategory category = new ProjectCategory();
        category.setCode("People");
        int count = categoryDao.insert(category);
        Assert.assertEquals(1, count);
    }
View Full Code Here

        Assert.assertEquals(1, count);
    }

    @Test
    public void testInsert() {
        ProjectCategory category = categoryDao.selectByCode("People");
        Assert.assertNotNull(category);
        //
        Date now = new Date();
        //
        Project project = new Project();
View Full Code Here

        Assert.assertEquals(1, count);
    }

    @Test
    public void destroy() {
        ProjectCategory category = categoryDao.selectByCode("People");
        int count = categoryDao.delete(category.getId());
        Assert.assertEquals(1, count);
    }
View Full Code Here

    @Autowired
    private ProjectCategoryService projectCategoryService;

    @Test
    public void testCreateProject() {
        ProjectCategory category = new ProjectCategory();
        category.setCode("People");
        category.setLabel("人员");
        projectCategoryService.createCategory(category);
        //
        ProjectUser user = new ProjectUser();
        user.setUsername("haozhonghu");
        user.setPassword("123456");
        user.setEmail("haozhonghu@hotmail.com");
        projectUserDao.insert(user);
        //
        Date now = new Date();
        Project project = new Project();
        project.setCode("gavin");
        project.setTitle("Gavin Hu");
        project.setDescription("This is gavin's profile!");
        //
        project.setCreatedAt(now);
        project.setModifiedAt(now);
        project.setCreatedById(user.getId());
        project.setModifiedById(user.getId());
        project.setCategoryId(category.getId());
        //
        projectService.createProject(project);
    }
View Full Code Here

TOP

Related Classes of org.focusns.model.core.ProjectCategory

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.