Package org.jayasoft.woj.portal.model.commercial

Examples of org.jayasoft.woj.portal.model.commercial.Purchaser


                    DynaActionForm f = (DynaActionForm)form;
                   
                   
                    org.jayasoft.woj.portal.model.registration.Registration r = (org.jayasoft.woj.portal.model.registration.Registration)request.getSession().getAttribute(Params.REGISTER.SESSION.CURRENT_REGISTRATION);
                    UserImpl u = (UserImpl)r.getUser();
                    Purchaser p = r.getPurchaser();
                   
                    // Set Form attributes
                    if (p != null) {
                      ActionsHelper.setIfNotSet(f, Params.REGISTER.PURCHASER.VALIDATE.PARAMS.PURCHASER_TYPE, p.getType());
                      ActionsHelper.setIfNotSet(f, Params.REGISTER.PURCHASER.VALIDATE.PARAMS.COMPANY_EEC_IDENT, p.getEECIdent());
                      ActionsHelper.setIfNotSet(f, Params.REGISTER.PURCHASER.VALIDATE.PARAMS.COMPANY_NAME, p.getCompany());
                      ActionsHelper.setIfNotSet(f, Params.REGISTER.PURCHASER.VALIDATE.PARAMS.FIRST_NAME, p.getFirstName());
                      ActionsHelper.setIfNotSet(f, Params.REGISTER.PURCHASER.VALIDATE.PARAMS.LAST_NAME, p.getLastName());
                      ActionsHelper.setIfNotSet(f, Params.REGISTER.PURCHASER.VALIDATE.PARAMS.ADRESS, p.getAdress());
                      ActionsHelper.setIfNotSet(f, Params.REGISTER.PURCHASER.VALIDATE.PARAMS.POSTAL_CODE, p.getPostalCode());
                      ActionsHelper.setIfNotSet(f, Params.REGISTER.PURCHASER.VALIDATE.PARAMS.CITY, p.getCity());
                      ActionsHelper.setIfNotSet(f, Params.REGISTER.PURCHASER.VALIDATE.PARAMS.COUNTRY, p.getCountry());
                    } else {
                      ActionsHelper.setIfNotSet(f, Params.REGISTER.PURCHASER.VALIDATE.PARAMS.PURCHASER_TYPE, Purchaser.COMPANY);
                      ActionsHelper.setIfNotSet(f, Params.REGISTER.PURCHASER.VALIDATE.PARAMS.COMPANY_NAME, u.getCompany());
                      ActionsHelper.setIfNotSet(f, Params.REGISTER.PURCHASER.VALIDATE.PARAMS.FIRST_NAME, u.getFirstName());
                      ActionsHelper.setIfNotSet(f, Params.REGISTER.PURCHASER.VALIDATE.PARAMS.LAST_NAME, u.getLastName());
View Full Code Here


                                addWOJMessages(request, RessourceBundleApplicationMessage.error("registration.purchaser-form.error.login.fields.required", null));
                                return "account.register.showPurchaserFormAction";
                        }
                       
                        // Store form infos in a bean
                        Purchaser p = (Purchaser)DaoFactory.getPurchaserDao().newHandledObject();
                        p.setType(pType);
                        p.setCompany(pCompanyName);
                        p.setEECIdent(pEECIdent);
                        p.setFirstName(pFirstName);
                        p.setLastName(pLastName);
                        p.setAdress(pAdress);
                        p.setCity(pCity);
                        p.setPostalCode(pPostalCode);
                        p.setCountry(pCountry);
                       
                        org.jayasoft.woj.portal.model.registration.Registration r = (org.jayasoft.woj.portal.model.registration.Registration)request.getSession().getAttribute(Params.REGISTER.SESSION.CURRENT_REGISTRATION);
                        if (r == null) {
                            throw new IllegalStateException("no registration form in session, maybe the url was bookmarked ?");
                        }
View Full Code Here

        p.setPriceByYear(50);
        l.setPrice(p);
        pi.setLicenses(Collections.singleton(l));
        o.setPayments(Collections.singleton(pi));
        o.setInvoice(i);
        Purchaser pur = getPurchaser();
        if (builder.buildInvoicePDF(o, pur, "inv-" + System.currentTimeMillis()) != null) {
            LOGGER.debug("pdf done");
        } else {
            LOGGER.debug("creation of pdf failed");
        }
View Full Code Here

            LOGGER.debug("creation of pdf failed");
        }
    }

    private static Purchaser getPurchaser() {
        Purchaser p = new Purchaser();
        if (System.currentTimeMillis()%2==0) {
            // build a home user
            System.out.println("purchaser : user");
            p.setFirstName("Matthieu");
            p.setLastName("BROUILLARD");
        } else {
            // build a company user
            System.out.println("purchaser : company");
            p.setCompany("Jayasoft");
            p.setEECIdent("123465464654654");
        }
        p.setAdress("22 rue Danton");
        p.setPostalCode("33160");
        p.setCity("Saint M�dard en Jalles");
        p.setCountry("France");
        return p;
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.jayasoft.woj.portal.data.dao.hibernate.DefaultHibernateWOJDao#newHandledObject()
     */
    public WOJObject newHandledObject() {
        return new Purchaser();
    }
View Full Code Here

TOP

Related Classes of org.jayasoft.woj.portal.model.commercial.Purchaser

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.