Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.Customer


  private void setCustomerSearchData(Order order, WindowInterface dialog,
      OrderModel orderModel) throws ProTransException {
    if (orderModel.getCustomerNr() != null
        || orderModel.getCustomerFirstName() != null
        || orderModel.getCustomerLastName() != null) {
      Customer customer = new Customer();
      try {
        if (orderModel.getCustomerNr() != null
            && orderModel.getCustomerNr().length() != 0) {
          customer.setCustomerNr(Integer.valueOf(orderModel
              .getCustomerNr()));
        }
      } catch (NumberFormatException e) {
        throw new ProTransException("Kundenr m� v�re tall");

      }
      customer.setFirstName(orderModel.getCustomerFirstName());
      customer.setLastName(orderModel.getCustomerLastName());
      order.setCustomer(customer);
    }
  }
View Full Code Here


  private void handleCustomer(final OrderModel object, final Order order) {
    if (object.getCustomer() == null
        || object.getCustomer().getCustomerId() == null) {
      CustomerManager customerManager = (CustomerManager) ModelUtil
          .getBean("customerManager");
      Customer customer = new Customer(null,
          object.getCustomerNr() != null ? Integer.valueOf(object
              .getCustomerNr()) : null, object
              .getCustomerFirstName(), object
              .getCustomerLastName(), null);
View Full Code Here

  @SuppressWarnings("unchecked")
  @Override
  public CheckObject checkSaveObject(OrderModel object,
      PresentationModel presentationModel1, WindowInterface window) {
    String errorString = null;
    Customer customer = null;

    Order order = object.getObject();
    if (order.getOrderId() == null && objectList.contains(order)) {
      errorString = "Kan ikke lagre ordre med et ordrenummer som finnes fra f�r";
    }

    if (object.getCustomer() == null) {
      CustomerManager customerManager = (CustomerManager) ModelUtil
          .getBean("customerManager");
      customer = customerManager.findByCustomerNr(Integer.valueOf(object
          .getCustomerNr()));
      if (customer != null) {
        if (JOptionPane.showConfirmDialog(window.getComponent(),
            "Kunde med dette kundenr finnes fra f�r med navn "
                + customer.getFirstName() + " "
                + customer.getLastName()
                + " �nskes denne kunden � benyttes?",
            "Kunde finnes fra f�r", JOptionPane.YES_NO_OPTION) == JOptionPane.OK_OPTION) {
          presentationModel1.setBufferedValue(
              OrderModel.PROPERTY_CUSTOMER, customer);
        } else {
View Full Code Here

   * @param presentationModel
   * @return bufferkunde
   */
    @Override
  public CustomerModel getBufferedObjectModel(PresentationModel presentationModel){
    CustomerModel customerModel = new CustomerModel(new Customer());
    customerModel.setCustomerId((Integer)presentationModel.getBufferedValue(PROPERTY_CUSTOMER_ID));
    customerModel.setCustomerNr((Integer)presentationModel.getBufferedValue(PROPERTY_CUSTOMER_NR));
    customerModel.setFirstName((String)presentationModel.getBufferedValue(PROPERTY_FIRST_NAME));
    customerModel.setLastName((String)presentationModel.getBufferedValue(PROPERTY_LAST_NAME));
    return customerModel;
View Full Code Here

    if (order != null) {
      productAreaGroup = order.getProductAreaGroup();
      canChangeInfo = changeInfo;
      canChangeStatus = statusChange;

      Customer orderCustomer = order.getCustomer();
      if (orderCustomer != null) {
        if (orderCustomer.getCustomerNr() != null) {
          setCustomerNr(String.valueOf(orderCustomer.getCustomerNr()));
        }
        setCustomerFirstName(orderCustomer.getFirstName());
        setCustomerLastName(orderCustomer.getLastName());
      }

      assembly = order.getAssembly();
    }
View Full Code Here

   * Setter kunde
   *
   * @param customer
   */
  public void setCustomer(Customer customer) {
    Customer oldCust = getCustomer();
    if (customer != null) {
      setCustomerFirstName(customer.getFirstName());
      setCustomerLastName(customer.getLastName());
      setCustomerNr(String.valueOf(customer.getCustomerNr()));
    }
View Full Code Here

  @After
  public void tearDown() throws Exception {
    CustomerManager customerManager = (CustomerManager) ModelUtil
        .getBean("customerManager");
    Customer customer = new Customer();
    customer.setFirstName("Tull");
    customer.setLastName("Ball");
    List<Customer> customers = customerManager.findByObject(customer);
    if (customers != null) {
      for (Customer cust : customers) {
        customerManager.removeCustomer(cust);
      }
View Full Code Here

    assertNotNull(viewHandler.getSearchButton(null));
  }

  @Test
  public void testDoNotSaveCustomerWithSameNr() {
    viewHandler.saveObject(new CustomerModel(new Customer(null, 100100100,
        "Tull", "Ball", null)), null);
    assertNotNull(viewHandler.checkSaveObject(new CustomerModel(
        new Customer(null, 100100100, "Tull", "Ball", null)), null,
        null));
  }
View Full Code Here

        null));
  }

  @Test
  public void testSaveCustomer() throws Exception {
    viewHandler.saveObject(new CustomerModel(new Customer(null, 100100100,
        "Tull", "Ball", null)), null);
    assertEquals(1, viewHandler.getObjectSelectionListSize());
  }
View Full Code Here

            final Object object, final boolean isSelected,
            final boolean hasFocus, final int row, final int column) {

        Transportable transportable = (Transportable) object;

        Customer customer = transportable.getCustomer();
        setText(customer.getFirstName() + " " + customer.getLastName() + " "
                + customer.getCustomerNr());

        StringBuffer toolTip = new StringBuffer();
       
        setCommentAsTooltip(object, toolTip);
View Full Code Here

TOP

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

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.