Package de.forsthaus.backend.model

Examples of de.forsthaus.backend.model.Customer


  private void doNew() {

    // remember the old vars
    doStoreInitValues();

    /** !!! DO NOT BREAK THE TIERS !!! */
    // we don't create a new Kunde() in the frontend.
    // we get it from the backend.
    final Customer aCustomer = getCustomerService().getNewCustomer();

    // our customer have a table-reference on filiale
    // we take the filiale we have become by logged in
    aCustomer.setOffice(getUserWorkspace().getOffice());
    setCustomer(aCustomer);

    doEdit(); // edit mode
    doClear(); // clear all commponents

View Full Code Here


   *
   * @throws InterruptedException
   */
  public void doSave() throws InterruptedException {

    final Customer aCustomer = getCustomer();

    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    // force validation, if on, than execute by component.getValue()
    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    if (!isValidationOn()) {
      doSetValidation();
    }

    // fill the customer object with the components data
    doWriteComponentsToBean(aCustomer);

    // get the selected branch object from the listbox
    // Listitem item = kunBranche.getSelectedItem();

    if (StringUtils.isEmpty(kunBranche.getValue())) {
      try {
        Messagebox.show("Please select a branch !");
      } catch (final InterruptedException e) {
        throw new RuntimeException(e);
      }
      return;
    }

    // ListModelList lml1 = (ListModelList) kunBranche.getListModel();
    // Branche branche = (Branche) lml1.get(item.getIndex());
    // aCustomer.setBranche(branche);

    if (kunMahnsperre.isChecked() == true) {
      aCustomer.setKunMahnsperre(true);
    } else {
      aCustomer.setKunMahnsperre(false);
    }

    // save it to database
    try {
      getCustomerService().saveOrUpdate(aCustomer);
View Full Code Here

  private static final Logger logger = Logger.getLogger(OrderSearchCustomerListModelItemRenderer.class);

  @Override
  public void render(Listitem item, Object data) throws Exception {

    final Customer customer = (Customer) data;

    Listcell lc = new Listcell(customer.getKunNr());
    lc.setParent(item);
    lc = new Listcell(customer.getKunMatchcode());
    lc.setParent(item);
    lc = new Listcell(customer.getKunName1());
    lc.setParent(item);
    lc = new Listcell(customer.getKunOrt());
    lc.setParent(item);

    item.setAttribute("data", data);
    // ComponentsCtrl.applyForward(img, "onClick=onImageClicked");
    // ComponentsCtrl.applyForward(item, "onClick=onClickedCustomerItem");
View Full Code Here

  private final static Logger logger = Logger.getLogger(CustomerListModelItemRenderer.class);

  @Override
  public void render(Listitem item, Object data) throws Exception {

    final Customer customer = (Customer) data;

    Listcell lc = new Listcell(customer.getKunNr());
    lc.setParent(item);
    lc = new Listcell(customer.getKunMatchcode());
    lc.setParent(item);
    lc = new Listcell(customer.getKunName1());
    lc.setParent(item);
    lc = new Listcell(customer.getKunName2());
    lc.setParent(item);
    lc = new Listcell(customer.getKunOrt());
    lc.setParent(item);
    ComponentsCtrl.applyForward(lc, "onMouseOver=onMouseOverListCell");

    lc = new Listcell();
    final Checkbox cb = new Checkbox();
    cb.setDisabled(true);
    cb.setChecked(customer.getKunMahnsperre());
    lc.appendChild(cb);
    lc.setParent(item);

    item.setAttribute("data", data);
    ComponentsCtrl.applyForward(item, "onDoubleClick=onCustomerItemDoubleClicked");
View Full Code Here

    // get the selected customer object
    Listitem item = this.listBoxCustomer.getSelectedItem();

    if (item != null) {
      // CAST AND STORE THE SELECTED OBJECT
      Customer aCustomer = (Customer) item.getAttribute("data");

      showDetailView(aCustomer);
    }
  }
View Full Code Here

    // create a new customer object
    /** !!! DO NOT BREAK THE TIERS !!! */
    // We don't create a new DomainObject() in the frontend.
    // We GET it from the backend.
    try {
      Customer aCustomer = getCustomerService().getNewCustomer();

      // init
      aCustomer.setOffice(getUserWorkspace().getOffice()); // init
      // init Default empty Branch
      aCustomer.setBranche(getBrancheService().getBrancheById(new Integer(1033).longValue())); // init
      aCustomer.setKunMahnsperre(false); // init

      showDetailView(aCustomer);
    } catch (DataAccessException e) {
      ZksampleMessageUtils.showErrorMessage(e.getMostSpecificCause().toString());
    } catch (Exception e) {
View Full Code Here

    // logger.debug(event.toString());

    /** !!! DO NOT BREAK THE TIERS !!! */
    // We don't create a new DomainObject() in the frontend.
    // We GET it from the backend.
    Customer aCustomer = getCustomerService().getNewCustomer();
    aCustomer.setOffice(getUserWorkspace().getOffice()); // init
    // customer.setBranche(Workspace.getBranche()); // init
    // TODO get the init values from a setup configuration
    aCustomer.setBranche(getBrancheService().getBrancheById(new Integer(1033).longValue())); // init
    aCustomer.setKunMahnsperre(false); // init

    /*
     * We can call our Dialog zul-file with parameters. So we can call them
     * with a object of the selected item. For handed over these parameter
     * only a Map is accepted. So we put the object in a HashMap.
View Full Code Here

  private static Logger logger = Logger.getLogger(CustomerDAOImpl.class);

  @Override
  public Customer getNewCustomer() {
    return new Customer();
  }
View Full Code Here

      }
      if ((ListModelList) listBoxOrderArticle.getModel() != null) {
        ((ListModelList) listBoxOrderArticle.getModel()).clear();
      }

      Customer customer = (Customer) item.getAttribute("data");

      if (customer != null)
        setCustomer(customer);

      bandbox_OrderList_CustomerSearch.setValue(customer.getKunName1() + ", " + customer.getKunOrt());

      // get all orders for the selected customer
      HibernateSearchObject<Order> soOrder = new HibernateSearchObject<Order>(Order.class, getPageSizeOrders());
      soOrder.addSort("aufNr", false);
      soOrder.addFilter(new Filter("customer", customer, Filter.OP_EQUAL));
View Full Code Here

TOP

Related Classes of de.forsthaus.backend.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.