Package org.spw.controller

Examples of org.spw.controller.ContactController


       
        return null;
    }

    void deleteDonation(final Donation donation) {
        new ContactController().removeDonation(donation);
    }
View Full Code Here


     * the object was created from a list).
     */
    public void refreshList() {
        aList.clear();
        if (getContact() != null) {
            contact = new ContactController().read(getContact().getIdContact());
            aList.addAll(
                    contact.getDonations());
        } else {
            aList.addAll(
                    new DonationController().getDonations());
View Full Code Here

    private void persistDonation() {
        Contact contact = getContact();
        Donation donation = getDonation();
        donation.setDonor(contact);
        donation = new ContactController().addDonation(donation);
       
        setDonation(donation);
        setContact(donation.getDonor());
    }
View Full Code Here

            this.document.setDocumentLink(justFileName);
            this.document.setTitle(doc);
            this.document.setDocumentType(uploadedFileType);
            this.document = new DocumentController().update(this.document);
            getContact().getDocumentLinks().add(this.document);
            new ContactController().update(
                    getContact());
            title.setText("");
           
        } catch (Exception ex) {
            error("Cannot upload file: " + uploadedFile.getOriginalName() + " to " +
View Full Code Here

       
        return null;
    }

    private void removeDocument(final Document document) {
        new ContactController().removeDocument(document);
        list.refreshListContact();
    }
View Full Code Here

    }
   
    public void refreshListContact() {
        aList.clear();
        if (getContact() != null) {
            contact = new ContactController().
                    read(getContact().getIdContact());
            aList.addAll(contact.getDocumentLinks());
        }
    }
View Full Code Here

    }
   
    public void refreshListContact() {
        aList.clear();
        if (getContact() != null) {
            contact = new ContactController().
                    read(getContact().getIdContact());
            aList.addAll(contact.getDocumentLinks());
        }
    }
View Full Code Here

    private void persistDonation() {
        Contact contact = getContact();
        Donation donation = getDonation();
        donation.setDonor(contact);
        donation = new ContactController().addDonation(donation);
       
        setDonation(donation);
        setContact(donation.getDonor());
    }
View Full Code Here

   
    public void contact_complete(FacesContext context, String prefix, CompletionResult result) {
        if (prefix == null || prefix.trim().length() < 1) {
            return;
        }
        java.util.List<Contact> contacts = new ContactController().
                getContactsBeginningBy(prefix, MAX_AUTOCOMPLETE);
        for (Contact contact : contacts) {
            result.addItem(contact.toString());
        }
    }
View Full Code Here

        DonationController donationCtrl = new DonationController();
        Donation resultDonation = donationCtrl.read(donation.getIdDonation());
        assertEquals(donation, resultDonation);
        assertEquals(contact, resultDonation.getDonor());
        assertEquals(this.getName(), resultDonation.getDonor().getFirstName());
        ContactController contactCtrl = new ContactController();
        Contact resultContact = contactCtrl.read(contact.getIdContact());
        assertTrue(resultContact.getDonations().contains(donation));
        assertEquals(1, resultContact.getDonations().size());
    }
View Full Code Here

TOP

Related Classes of org.spw.controller.ContactController

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.