Search in sources :

Example 46 with InvalidDateException

use of org.mifos.application.admin.servicefacade.InvalidDateException in project head by mifos.

the class CustomerBO method updateCenterDetails.

public void updateCenterDetails(UserContext userContext, CenterUpdate centerUpdate) throws CustomerException {
    this.setUserContext(userContext);
    this.setUpdateDetails();
    this.setExternalId(centerUpdate.getExternalId());
    AddressDto dto = centerUpdate.getAddress();
    if (dto != null) {
        Address address = new Address(dto.getLine1(), dto.getLine2(), dto.getLine3(), dto.getCity(), dto.getState(), dto.getCountry(), dto.getZip(), dto.getPhoneNumber());
        this.updateAddress(address);
    }
    try {
        if (centerUpdate.getMfiJoiningDate() != null) {
            DateTime mfiJoiningDate = CalendarUtils.getDateFromString(centerUpdate.getMfiJoiningDate(), userContext.getPreferredLocale());
            this.setMfiJoiningDate(mfiJoiningDate.toDate());
        }
    } catch (InvalidDateException e) {
        throw new CustomerException(CustomerConstants.MFI_JOINING_DATE_MANDATORY, e);
    }
}
Also used : CustomerException(org.mifos.customers.exceptions.CustomerException) Address(org.mifos.framework.business.util.Address) InvalidDateException(org.mifos.application.admin.servicefacade.InvalidDateException) AddressDto(org.mifos.dto.domain.AddressDto) DateTime(org.joda.time.DateTime)

Aggregations

InvalidDateException (org.mifos.application.admin.servicefacade.InvalidDateException)46 ActionMessage (org.apache.struts.action.ActionMessage)22 ActionErrors (org.apache.struts.action.ActionErrors)20 Locale (java.util.Locale)12 Date (java.sql.Date)9 ResourceBundle (java.util.ResourceBundle)9 PersistenceException (org.mifos.framework.exceptions.PersistenceException)6 Date (java.util.Date)5 AccountException (org.mifos.accounts.exceptions.AccountException)5 DoubleConversionResult (org.mifos.framework.util.helpers.DoubleConversionResult)5 SimpleDateFormat (java.text.SimpleDateFormat)4 MifosRuntimeException (org.mifos.core.MifosRuntimeException)4 CustomerException (org.mifos.customers.exceptions.CustomerException)4 ParseException (java.text.ParseException)3 LocalDate (org.joda.time.LocalDate)3 PageExpiredException (org.mifos.framework.exceptions.PageExpiredException)3 BusinessRuleException (org.mifos.service.BusinessRuleException)3 ArrayList (java.util.ArrayList)2 DateMidnight (org.joda.time.DateMidnight)2 DateTime (org.joda.time.DateTime)2