Package cn.edu.pku.dr.requirement.elicitation.data

Examples of cn.edu.pku.dr.requirement.elicitation.data.UserScenarioRelation


        return 0;
    }
//==========================================================================================
    public static Integer applyScenario(Scenario scenario, Long userId)
            throws EasyJException {
        UserScenarioRelation relation = new UserScenarioRelation();
        relation.setUserId(userId);
        relation.setScenarioId(scenario.getScenarioId());
        ArrayList list = sdp.query(relation);
        if (list.size() == 0)
            return 1;
        relation = (UserScenarioRelation) list.get(0);
        if (relation.getApplyStateRelatedValue() == DictionaryConstant.CANCELED
                || relation.getApplyStateRelatedValue() == DictionaryConstant.REJECTED)
            return 1;
        return 0;
    }
View Full Code Here


                    sourceList.add(scenario);
                }
            }
            //得到用户可以查看的场景
           
            UserScenarioRelation relation=new UserScenarioRelation();
            relation.setUserId(userId);
            ArrayList relationList=dp.query(relation);
            for(int i=0;i<relationList.size();i++) {
                relation=(UserScenarioRelation)relationList.get(i);
                Scenario scenario=new Scenario();
                scenario.setScenarioId(relation.getScenarioId());
                scenario.setScenarioName(relation.getScenarioName());
                sourceList.add(scenario);
            }
        }
       
        StringBuffer buffer= HtmlClientComponentService.getMultiSelect(sourceList, new ArrayList(), "scenarioName",Scenario.class);
View Full Code Here

    }

   
    private void updateApplyState(int state) throws EasyJException {
        dp.setContext(null);
        UserScenarioRelation relation = (UserScenarioRelation) object;
        relation = (UserScenarioRelation) dp.get(relation);
        Long userScenarioState = DictionaryProxy.getIdByRelatedValue(
                "PROJECT_APPLY_STATE", new Long(state));
        relation.setApplyState(userScenarioState);
        dp.update(relation);
    }
View Full Code Here

        request.setAttribute(Globals.OBJECT, object);
    }

    public void apply() throws EasyJException {
        Scenario scenario = (Scenario) object;
        UserScenarioRelation relation = new UserScenarioRelation();
        relation.setScenarioId((scenario.getScenarioId()));
        relation.setUserId(userId);
        Long applyState = DictionaryProxy.getIdByRelatedValue(
                "PROJECT_APPLY_STATE", new Long(DictionaryConstant.APPLYING));
        relation.setApplyState(applyState);
        dp.create(relation);
    }
View Full Code Here

TOP

Related Classes of cn.edu.pku.dr.requirement.elicitation.data.UserScenarioRelation

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.