Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.OrderCost


          .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);

      addCost(defaultOrderCost);
      presentationModel.setBufferedValue(ICostableModel.PROPERTY_COSTS,
          costsList);
    }
View Full Code Here


    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);

      if (costType == null) {
        throw new ProTransException("Kan ikke finne kostnadstype "
            + costName);
      }

      if (!containsCostTypes.contains(costType)) {
        orderCost = new OrderCost();
        orderCost.setCostType(costType);
        orderCost.setCostUnit(costUnitInternal);
        orderCost.setOrder((Order) presentationModel
            .getBufferedValue(ICostableModel.PROPERTY_ORDER));
        orderCost.setDeviation((Deviation) presentationModel
            .getBufferedValue(ICostableModel.PROPERTY_DEVIATION));
        addCost(orderCost);
        presentationModel.setBufferedValue(
            ICostableModel.PROPERTY_COSTS, costsList);
      }
View Full Code Here

    dialog.add(orderCostView.buildPanel(dialog));
    dialog.pack();
    Util.locateOnScreenCenter(dialog);
    dialog.setVisible(true);

    OrderCost orderCost = orderCostView.getOrderCost();
    if (orderCost != null) {
      if (selectedOrderCost == null) {
        addCost(orderCost);

      } else {
View Full Code Here

   * Editere kostnad
   *
   * @param window
   */
  void doEditCost(WindowInterface window) {
    OrderCost selectedOrderCost = (OrderCost) costSelectionList
        .getSelection();
    openCostView(window, selectedOrderCost);
  }
View Full Code Here

     * @param rowIndex
     * @param columnIndex
     * @return verdi
     */
    public Object getValueAt(int rowIndex, int columnIndex) {
      OrderCost orderCost = (OrderCost) getRow(rowIndex);
      switch (columnIndex) {
      case 0:
        return orderCost.getCostType();
      case 1:
        return orderCost.getCostUnit();
      case 2:
        return orderCost.getCostAmount();
      case 3:
        return orderCost.isInclVat();
      case 4:
        if (orderCost.getDeviation() != null) {
          return true;
        }
        return false;

      default:
View Full Code Here

     * @see javax.swing.table.AbstractTableModel#setValueAt(java.lang.Object,
     *      int, int)
     */
    @Override
    public void setValueAt(Object object, int rowIndex, int columnIndex) {
      OrderCost orderCost = (OrderCost) getRow(rowIndex);
      if (columnIndex == 2) {
        orderCost.setCostAmount((BigDecimal) object);
        presentationModel.setBufferedValue(
            DeviationModel.PROPERTY_MOD_COUNT, 1);
      }
    }
View Full Code Here

     * @see no.ugland.utransprod.gui.Updateable#doDelete(no.ugland.utransprod.gui.WindowInterface)
     */
    public boolean doDelete(WindowInterface window) {
      boolean deleted = true;
      if (enabled) {
        OrderCost selectedCost = (OrderCost) costSelectionList
            .getSelection();

        if (selectedCost != null) {
          costsList.remove(selectedCost);
          presentationModel.setBufferedValue(
View Full Code Here

TOP

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

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.