Examples of DayTypePerYearOption


Examples of org.worldbank.transport.tamt.shared.DayTypePerYearOption

    }
   
  }
 
  public DayTypePerYearOption getDayTypePerYearOption(String studyRegionId) throws Exception {
    DayTypePerYearOption option = dao.getDayTypePerYearOption(studyRegionId);
    return option;
  }
View Full Code Here

Examples of org.worldbank.transport.tamt.shared.DayTypePerYearOption

  }
 
  @UiHandler("save")
  void onClickSave(ClickEvent e) {
   
    DayTypePerYearOption dayTypePerYearOption = new DayTypePerYearOption();
    dayTypePerYearOption.setRegionId(currentStudyRegion.getId());
   
    if( currentOption != null)
    {
      dayTypePerYearOption.setId(currentOption.getId());
    }
   
    // if activeOption = 1, save weekday1 value
    if( activeOption == 1 )
    {
      dayTypePerYearOption.setOption1weekday(option1weekday.getValue());
    } else
    // if activeOption = 2, save weekday2, saturday2, sundayHoliday2 values
    {
      dayTypePerYearOption.setOption2weekday(option2weekday.getValue());
      dayTypePerYearOption.setOption2saturday(option2saturday.getValue());
      dayTypePerYearOption.setOption2sundayHoliday(option2sundayHoliday.getValue());
    }
    dayTypePerYearOption.setActiveOption(Integer.toString(activeOption));
   
    GWT.log("save day type option=" + dayTypePerYearOption);
    regionService.saveDayTypePerYearOption(dayTypePerYearOption, new AsyncCallback<DayTypePerYearOption>() {
     
      @Override
View Full Code Here

Examples of org.worldbank.transport.tamt.shared.DayTypePerYearOption

    }
  }

  public DayTypePerYearOption getDayTypePerYearOption(String studyRegionId)
    throws Exception {
    DayTypePerYearOption dayTypePerYearOption = null;
    /*
     * Granted, this method does not access the study region table, but it
     * was only one option and creating a new API/BO/DAO structure for it
     * seemed overkill. Since it is most closely related to a StudyRegion,
     * we sunk it in this DAO.
     */
    try {
      Connection connection = getConnection();
      Statement s = connection.createStatement();
      String sql = "SELECT id, regionid, activeoption, option1weekday, " +
          "option2weekday, option2saturday, option2sundayholiday " +
          "FROM daytypeperyearoption WHERE regionid = '"+studyRegionId+"'";
      logger.debug("getDayTypePerYearOption sql=" + sql);
      ResultSet r = s.executeQuery(sql);
      while( r.next() ) {
        dayTypePerYearOption = new DayTypePerYearOption();
        dayTypePerYearOption.setId(r.getString(1));
        dayTypePerYearOption.setRegionId(r.getString(2));
        dayTypePerYearOption.setActiveOption(r.getString(3));
        dayTypePerYearOption.setOption1weekday(r.getString(4));
        dayTypePerYearOption.setOption2weekday(r.getString(5));
        dayTypePerYearOption.setOption2saturday(r.getString(6));
        dayTypePerYearOption.setOption2sundayHoliday(r.getString(7));
      }
      connection.close(); // returns connection to the pool

    }
      catch (SQLException e) {
View Full Code Here

Examples of org.worldbank.transport.tamt.shared.DayTypePerYearOption

        currentStudyRegion = studyRegion;
        break;
      }
    }
 
    DayTypePerYearOption dayTypePerYearOption = getDayTypePerYearOption(currentStudyRegion);
    ArrayList<String> multipliers = new ArrayList<String>();
   
    /*
     * We will pass this off to stored procedure which expects:
     *     activeoption text,
        option1weekday integer,
        option2weekday integer,
        option2saturday integer,
        option2sundayholiday integer
     
      which means we have to fill in the blanks
     */
    String activeoption = dayTypePerYearOption.getActiveOption();
    String option1weekday = null;
    String option2weekday = null;
    String option2saturday = null;
    String option2sundayholiday = null;
   
    // handle daytypeperyear option
    if( activeoption.equals("1") )
    {
      option1weekday = dayTypePerYearOption.getOption1weekday();
      option2weekday = null;
      option2saturday = null;
      option2sundayholiday = null;
     
    } else {
      option1weekday = null;
      option2weekday = dayTypePerYearOption.getOption2weekday();
      option2saturday = dayTypePerYearOption.getOption2saturday();
      option2sundayholiday = dayTypePerYearOption.getOption2sundayHoliday();
    }
   
    try {
      Connection connection = getConnection();
      Statement s = connection.createStatement();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.