Package com.pre.exception

Examples of com.pre.exception.BPException


   */
  @Override
  public void addLine(String itemCode, double quantity) throws BPException {
    if(order==null){
      //Order is not valid
      throw new BPException("SALES_000002");
    }
    CustomerOrderLine orderLine=new CustomerOrderLine();
    //check item
    Item item=findItem(itemCode);
    if(item==null){
View Full Code Here


  public void setOrder(String code) throws BPException {
    List<CustomerOrder> orders=orderManager.findByCode(code);
    if(orders.isEmpty()){
      //Customer order does not exit
      orderLineBPOperationResult = 4;
      throw new BPException("SALES_000003", code);
    }
    order=orders.get(0);   
  }
View Full Code Here

  public void create(Company c) throws BPException{
    //check real PK
    if(c.getName() !=null && c.getDivision() !=null){
      List<Company> company=findByPK(c.getName(), c.getDivision().getCode());
      if(!company.isEmpty()){
        throw new BPException("BASE_0000001", c.getName());
      }
    }
    em.persist(c);
  }
View Full Code Here

      String customerOrderType)
      throws BPException {
    errors=new HashMap<String, String>();
    //Check customer
    if(!validateCustomer(customerName)){
      throw new BPException(errors);     
    }
    //Check order type
    if(!validateOrderType(customerOrderType)){
      throw new BPException(errors)
    }
    //Create Order but do not persist yet
    order=new CustomerOrder();
    order.setCustomer(customer);
    order.setType(orderType);
View Full Code Here

 
  @Override
  public void persistOrder() throws BPException {
    if(order==null || !orderPersistable){
      //Order is not valid
      throw new BPException("SALES_000002");
    }
    //TODO define order numbering rules
    orderManager.create(order);
  }
View Full Code Here

TOP

Related Classes of com.pre.exception.BPException

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.