Package br.com.visualmidia.business

Examples of br.com.visualmidia.business.State


    private void fillCombo() {
        try {
          cityCombo.removeAll();
          int comboSelect = 0;
         
            State state = (State) system.query(new GetStates(stateCombo.getText()));
            List<City> cities = state.getCityList();
           
            for (City city : cities) {
              cityCombo.add(city.getCityName());
             
                if (gd.get("city").toString().equals(city.getCityName())) {
View Full Code Here


            close();
        }
    }
   
    private boolean isCityExistInState() throws Exception {
        State state = (State) system.query(new GetStates(stateAcronymCombo.getText()));
        for (City city : state.getCityList()) {
           if(city.getCityName().equals(cityNameText.getText())){
               return true;
           }
        }
        return false;
View Full Code Here

            public void handleEvent(Event arg0) {
                try {
                  cityCombo.removeAll();
                  int y = 0, index = 0;
                 
                    State state = (State) system.query(new GetStates(stateCombo.getText()));
                    List<City> cities = state.getCityList();
                   
                    for (City city : cities) {
                      cityCombo.add(city.getCityName());
                     
                      if(gd.get("city") != null) {
                          if (gd.get("city").toString().equals(city.getCityName())) {
                            index = y;
                          }
                      }
                        y++;
                    }
                    cityCombo.select(index);
                } catch (Exception e) {
                }
            }
        });
       
        try {
            List<State> states = (List<State>) system.query(new GetStatesList());
            for (State state : states) {
                stateCombo.add(state.getAcronym());
               
                if(gd.get("state") != null) {
                  if (gd.get("state").toString().equals(state.getAcronym())) {
                    stateCombo.select(i);
                  }
                }
                i++;
            }
View Full Code Here

        this.acronym = acronym;
    }
   
    @Override
    protected Object executeAndQuery(PrevalentSystem system) {
        State state = null;
      
        if(!system.getStates().containsKey(acronym)){
            state = new State(acronym, stateName);
            system.getStates().put(acronym, state);
        }
       
        return state;
    }
View Full Code Here

    protected void execute(PrevalentSystem system) {
      if(system.getStates().containsKey(acronym)){
        system.getStates().get(acronym).setAcronym(acronym);
        system.getStates().get(acronym).setName(stateName);
      }else{
        State state = new State(acronym, stateName);
        system.getStates().put(acronym, state);
      }
    }
View Full Code Here

    @Override
    protected void execute(PrevalentSystem system) {
        String id = getId(system);
       
        State state = system.getStates().get(acronym);

        if(system.getCities().get(id) == null){
          City city = new City(id, cityName, state);
          system.getCities().put(id, city);
        }
    
        if(!isCityExistsInState(system.getCities().get(id), state)) {
          state.addCity(system.getCities().get(id));
        }
    }
View Full Code Here

        this.acronym = acronym;
    }
   
    @Override
    protected void execute(PrevalentSystem system) throws BusinessException {
        State state = system.getStates().get(acronym);
        int i;
        for (i=0; i<state.getCityList().size(); i++) {
            if(state.getCityList().get(i).getId().equals(cityId)){
                break;
            }
        }
        system.getStates().get(acronym).getCityList().remove(i);
        system.getCities().remove(cityId);
View Full Code Here

TOP

Related Classes of br.com.visualmidia.business.State

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.