Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.Area


    transportCost.setPlace(excelUtil.readCell(row,
        COLUMN_TRANSPORT_COST_PLACE, null));
    String areaCode = excelUtil.readCell(row,
        COLUMN_TRANSPORT_COST_AREA_CODE, "%1$04.0f");

    Area area = areaManager.load(areaCode);
    if (area == null) {
      throw new ProTransException("Kommunenr " + areaCode
          + " finnes ikke!");
    }
    transportCost.setArea(area);
View Full Code Here


    }
  }

  private void importArea(final int row, final ExcelUtil excelUtil)
      throws ProTransException {
    Area area = new Area();
    String areaCode = excelUtil.readCell(row, COLUMN_AREA_AREA_CODE,
        "%1$04.0f");
    County county;
    if (areaCode != null && areaCode.length() > 2) {
      String countyNr = areaCode.substring(0, 2);
      county = countyManager.load(countyNr);
      if (county == null) {
        throw new ProTransException("Fylkesnr " + countyNr
            + " finnes ikke");
      }
      area.setCounty(county);
    } else {
      throw new ProTransException("Feil kommunenr " + areaCode);
    }
    area.setAreaCode(areaCode);
    area.setAreaName(excelUtil.readCell(row, COLUMN_AREA_AREA_NAME, null));
    areaManager.saveArea(area);
  }
View Full Code Here

  }

  private void importSnowLoad(int row, ExcelUtil excelUtil)
      throws ProTransException {
    Area area = null;
    String areaCode = excelUtil.readCell(row, COLUMN_AREA_AREA_CODE,
        "%1$04.0f");
    County county;
    if (areaCode != null && areaCode.length() > 2) {
      area = areaManager.findByAreaCode(areaCode);
      if (area == null) {
        area = new Area();
        String countyNr = areaCode.substring(0, 2);
        county = countyManager.load(countyNr);
        if (county == null) {
          throw new ProTransException("Fylkesnr " + countyNr
              + " finnes ikke");
        }
        area.setCounty(county);
        area.setAreaCode(areaCode);
      }

      area.setSnowloadBasicValue(excelUtil.readCellAsBigDecimal(row,
          COLUMN_AREA_SNOWLOAD_BASIC_VALUE));
      area.setHeightLimit(excelUtil.readCellAsInteger(row,
          COLUMN_AREA_HEIGHT_LIMIT));
      area.setDeltaSnowload(excelUtil.readCellAsBigDecimal(row,
          COLUMN_AREA_DELTA_SNOWLOAD));
      area.setSnowloadMax(excelUtil.readCellAsBigDecimal(row,
          COLUMN_AREA_SNOWLOAD_MAX));
      area.setSnowloadComment(excelUtil.readCell(row,
          COLUMN_AREA_SNOWLOAD_COMMENT, null));
    } else {
      throw new ProTransException("Feil kommunenr " + areaCode);
    }
View Full Code Here

TOP

Related Classes of no.ugland.utransprod.model.Area

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.