Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.CostType


  /**
   * @see no.ugland.utransprod.gui.handlers.AbstractViewHandler#getNewObject()
   */
  @Override
  public CostType getNewObject() {
    return new CostType();
  }
View Full Code Here


   * @see no.ugland.utransprod.gui.model.AbstractModel#getBufferedObjectModel(com.jgoodies.binding.PresentationModel)
   */
  @Override
  public CostTypeModel getBufferedObjectModel(
      PresentationModel presentationModel) {
    CostTypeModel costTypeModel = new CostTypeModel(new CostType());
    costTypeModel.setCostTypeId((Integer) presentationModel
        .getBufferedValue(PROPERTY_COST_TYPE_ID));
    costTypeModel.setCostTypeName((String) presentationModel
        .getBufferedValue(PROPERTY_COST_TYPE_NAME));
    costTypeModel.setDescription((String) presentationModel
View Full Code Here

  /**
   * @param costType
   */
  public void setCostType(CostType costType) {
    CostType oldType = getCostType();
    object.setCostType(costType);
    firePropertyChange(PROPERTY_COST_TYPE, oldType, costType);
  }
View Full Code Here

  }

  @Test
  public void testSaveObject() throws Exception {
    costType = new CostType();
    costType.setCostTypeName("test");
    viewHandler.saveObject(new CostTypeModel(costType), null);
    assertEquals(1, viewHandler.getObjectSelectionListSize());
  }
View Full Code Here

   * @param rowIndex
   * @param columnIndex
   * @return verdi
   */
  public Object getValueAt(int rowIndex, int columnIndex) {
    CostType costType = (CostType) getRow(rowIndex);
    switch (columnIndex) {
    case 0:
      return costType.getCostTypeName();
    case 1:
      return costType.getDescription();
    default:
      throw new IllegalStateException("Unknown column");
    }

  }
View Full Code Here

        .transportCostDAO(transportCostDAO) //
        .costTypeManager(costTypeManager) //
        .costUnitManager(costUnitManager) //
        .transportCostAdditionManager(transportCostAdditionManager)
        .build();
    CostType costType = new CostType();
    when(costTypeManager.findByName("Fraktkost")).thenReturn(costType);
    CostUnit costUnit = new CostUnit();
    when(costUnitManager.findByName("Intern")).thenReturn(costUnit);
  }
View Full Code Here

    incomingOrderManager.setCostTypeManager(costTypeManager);
    incomingOrderManager.setCostUnitManager(costUnitManager);
  }
  @Test
  public void skal_importere_montering() throws Exception {
    CostType costType=new CostType();
    when(costTypeManager.findByName("Montering")).thenReturn(costType);
    CostUnit costUnit=new CostUnit();
    when(costUnitManager.findByName("Kunde")).thenReturn(costUnit);
   
    String orderNr="1";
View Full Code Here

  private OrderCost getOrderCost(final String costTypeName,
      final CostTypeManager costTypeManager, final BigDecimal costAmount,
      final Order order, final CostUnitManager costUnitManager,
      final String costUnitName) {
    CostType costType = costTypeManager.findByName(costTypeName);
    CostUnit costUnit = costUnitManager.findByName(costUnitName);
    OrderCost orderCost = order.getOrderCost(costTypeName, costUnitName);
    orderCost = orderCost != null ? orderCost : new OrderCost();
    orderCost.setCostAmount(costAmount);
    orderCost.setCostType(costType);
View Full Code Here

    if (costsList.size() == 0 && addInternalCost) {
      CostTypeManager costTypeManager = (CostTypeManager) ModelUtil
          .getBean("costTypeManager");
      CostUnitManager costUnitManager = (CostUnitManager) ModelUtil
          .getBean("costUnitManager");
      CostType costTypeDev = costTypeManager.findByName("Avvik");
      CostUnit costUnitInternal = costUnitManager.findByName("Intern");
      OrderCost defaultOrderCost = new OrderCost();
      defaultOrderCost.setCostAmount(BigDecimal.valueOf(500));
      defaultOrderCost.setCostType(costTypeDev);
      defaultOrderCost.setCostUnit(costUnitInternal);
View Full Code Here

    CostUnitManager costUnitManager = (CostUnitManager) ModelUtil
        .getBean("costUnitManager");
    List<String> defaultCosts = ApplicationParamUtil
        .getDefaultDeviationCosts();

    CostType costType;
    CostUnit costUnitInternal = costUnitManager.findByName("Intern");
    OrderCost orderCost;
    List<CostType> containsCostTypes = getCostTypes();
    for (String costName : defaultCosts) {
      costType = costTypeManager.findByName(costName);
View Full Code Here

TOP

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

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.