Example #1
0
  public AccountTypeDTO create(AccountTypeDTO accountTypeDTO) {

    accountTypeDTO.setDateCreated(new Date());
    accountTypeDTO = accountTypeDAS.save(accountTypeDTO);

    accountTypeDAS.flush();
    accountTypeDAS.clear();
    return accountTypeDTO;
  }
Example #2
0
  public void update(AccountTypeDTO accountType) {

    AccountTypeDTO accountTypeDTO = accountTypeDAS.find(accountType.getId());

    accountTypeDTO.setCreditLimit(accountType.getCreditLimit());
    accountTypeDTO.setCreditNotificationLimit1(accountType.getCreditNotificationLimit1());
    accountTypeDTO.setCreditNotificationLimit2(accountType.getCreditNotificationLimit2());
    accountTypeDTO.setInvoiceDesign(accountType.getInvoiceDesign());
    accountTypeDTO.setBillingCycle(accountType.getBillingCycle());
    accountTypeDTO.setLanguage(new LanguageDAS().find(accountType.getLanguageId()));
    accountTypeDTO.setCurrency(new CurrencyDAS().find(accountType.getCurrencyId()));
    accountTypeDTO.setInvoiceDeliveryMethod(
        new InvoiceDeliveryMethodDAS().find(accountType.getInvoiceDeliveryMethod().getId()));
    accountTypeDTO.setPaymentMethodTypes(accountType.getPaymentMethodTypes());
    accountTypeDTO.setPreferredNotificationAitId(accountType.getPreferredNotificationAitId());
    accountTypeDAS.save(accountTypeDTO);

    accountTypeDAS.flush();
    accountTypeDAS.clear();
  }
Example #3
0
  public boolean delete() {

    if (accountTypeDTO.getCustomers().size() > 0) {
      return false;
    }

    for (AccountInformationTypeDTO ait : accountTypeDTO.getInformationTypes()) {
      new AccountInformationTypeBL(ait.getId()).delete();
    }
    accountTypeDTO.getInformationTypes().clear();
    accountTypeDAS.delete(accountTypeDTO);
    return true;
  }
Example #4
0
 public void setAccountType(Integer accountTypeId) {
   accountTypeDTO = accountTypeDAS.find(accountTypeId);
 }