Examples of Office


Examples of org.mifosplatform.organisation.office.domain.Office

        this.context.authenticatedUser();

        this.moneyTransferCommandFromApiJsonDeserializer.validateOfficeTransfer(command.json());

        Long officeId = null;
        Office fromOffice = null;
        final Long fromOfficeId = command.longValueOfParameterNamed("fromOfficeId");
        if (fromOfficeId != null) {
            fromOffice = this.officeRepository.findOne(fromOfficeId);
            officeId = fromOffice.getId();
        }
        Office toOffice = null;
        final Long toOfficeId = command.longValueOfParameterNamed("toOfficeId");
        if (toOfficeId != null) {
            toOffice = this.officeRepository.findOne(toOfficeId);
            officeId = toOffice.getId();
        }

        if (fromOffice == null && toOffice == null) { throw new OfficeNotFoundException(toOfficeId); }

        final String currencyCode = command.stringValueOfParameterNamed("currencyCode");
View Full Code Here

Examples of org.mifosplatform.organisation.office.domain.Office

     * office or lower (child) in the office hierarchy
     */
    private Office validateUserPriviledgeOnOfficeAndRetrieve(final AppUser currentUser, final Long officeId) {

        final Long userOfficeId = currentUser.getOffice().getId();
        final Office userOffice = this.officeRepository.findOne(userOfficeId);
        if (userOffice == null) { throw new OfficeNotFoundException(userOfficeId); }

        if (userOffice.doesNotHaveAnOfficeInHierarchyWithId(officeId)) { throw new NoAuthorizationException(
                "User does not have sufficient priviledges to act on the provided office."); }

        Office officeToReturn = userOffice;
        if (!userOffice.identifiedBy(officeId)) {
            officeToReturn = this.officeRepository.findOne(officeId);
            if (officeToReturn == null) { throw new OfficeNotFoundException(officeId); }
        }

View Full Code Here

Examples of org.mifosplatform.organisation.office.domain.Office

        }
        return officeId;
    }

    public Office getOffice() {
        Office office = null;
        if (this.client != null) {
            office = this.client.getOffice();
        } else {
            office = this.group.getOffice();
        }
View Full Code Here

Examples of org.mifosplatform.organisation.office.domain.Office

            final JournalEntryCommand journalEntryCommand = this.fromApiJsonDeserializer.commandFromApiJson(command.json());
            journalEntryCommand.validateForCreate();

            // check office is valid
            final Long officeId = command.longValueOfParameterNamed(JournalEntryJsonInputParams.OFFICE_ID.getValue());
            final Office office = this.officeRepository.findOne(officeId);
            if (office == null) { throw new OfficeNotFoundException(officeId); }

            final Long accountRuleId = command.longValueOfParameterNamed(JournalEntryJsonInputParams.ACCOUNTING_RULE.getValue());
            final String currencyCode = command.stringValueOfParameterNamed(JournalEntryJsonInputParams.CURRENCY_CODE.getValue());
View Full Code Here

Examples of org.springmodules.xt.examples.domain.Office

public class InsertOfficeController extends EnhancedSimpleFormController {
   
    private MemoryRepository store;
   
    protected Object formBackingObject(HttpServletRequest request) throws Exception {
        return new Office();
    }
View Full Code Here

Examples of org.springmodules.xt.examples.domain.Office

    private MemoryRepository store;

    protected Object formBackingObject(HttpServletRequest request) throws Exception {
        String officeId = request.getParameter("officeId");
        if (officeId == null) {
            return new Office();
        }
        else {
            return this.store.getOffice(officeId);
        }
    }
View Full Code Here

Examples of org.springmodules.xt.examples.domain.Office

       
        return result;
    }

    protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception {
        Office office = (Office) command;
       
        try {
            this.store.addOffice(office);
        }
        catch(BusinessException ex) {
View Full Code Here

Examples of org.springmodules.xt.examples.domain.Office

        return result;
    }

    protected ModelAndView onSubmit(Object command, BindException errors) throws Exception {
        EmployeesListForm form = (EmployeesListForm) command;
        Office office = form.getOffice();
        Collection<IEmployee> employees = store.getEmployeesByOffice(office);
        Map model = new HashMap(3);
       
        model.put("employees", employees);
       
View Full Code Here

Examples of org.springmodules.xt.examples.domain.Office

       
        return result;
    }

    protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception {
        Office office = (Office) command;
       
        try {
            this.store.addOffice(office);
        }
        catch(BusinessException ex) {
View Full Code Here

Examples of org.springmodules.xt.test.domain.Office

    public BindStatusHelperTest(String testName) {
        super(testName);
    }

    protected void setUp() throws Exception {
        this.office = new Office();
       
        Employee employee = new Employee();
        employee.setFirstname("Sergio");
        employee.setSurname("Bossa");
        employee.setMatriculationCode("abc");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.