Package net.sf.esims.exception

Examples of net.sf.esims.exception.BusinessRuleException


    }

    public void setBuyerLastName(String buyerLastName) {
      EsimsUtils.validateStrings(buyerLastName, 32);
      if(! StringUtils.isAlpha(buyerLastName))
        throw new BusinessRuleException("The Last name of the applicaton buyer cannot contain numbers / special characters");
      this.buyerLastName = buyerLastName;
    }
View Full Code Here


    public void setDateOfSale(Date dateOfSale) {
      Calendar today = Calendar.getInstance();
      //Date of sale cannot be null
      if(dateOfSale == null)
        throw new BusinessRuleException("Date of sale cannot be null");
      else{
        Calendar saleCal = Calendar.getInstance();
        saleCal.setTime(dateOfSale);
        if(saleCal.get(Calendar.YEAR) != today.get(Calendar.YEAR))
          throw new BusinessRuleException("The Year in Date of Sale must be the current year");
        if(saleCal.get(Calendar.MONTH)!= today.get(Calendar.MONTH))
          throw new BusinessRuleException("The Month in Date of Sale must be the current month");
        if(saleCal.get(Calendar.DAY_OF_YEAR)!= today.get(Calendar.DAY_OF_YEAR))
          throw new BusinessRuleException("The Day in Date of Sale must be todays date.");
      }
      this.dateOfSale = dateOfSale;
    }
View Full Code Here

TOP

Related Classes of net.sf.esims.exception.BusinessRuleException

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.