Package org.opencustomer.db.dao.crm

Examples of org.opencustomer.db.dao.crm.CompanyDAO


    protected void chooseEntity(EntityPanel panel, AddCompanyForm form, ActionMessages errors, HttpServletRequest request, HttpServletResponse response)
    {
        if (log.isDebugEnabled())
            log.debug("add company with ID: " + form.getId());

        CompanyVO company = new CompanyDAO().getById(form.getId());

        if (company == null)
        {
            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("default.error.invalidEntity", new Integer(form.getId())));
View Full Code Here


    }
   
    @Override
    protected void chooseEntity(EntityPanel panel, AddCompanyForm form, ActionMessages errors, HttpServletRequest request, HttpServletResponse response)
    {
        CompanyVO company = new CompanyDAO().getById(form.getId());
        if (company != null)
        {
            PersonVO person = (PersonVO)panel.getEntity();
            person.setCompany(company);
        }
View Full Code Here

        if (log.isDebugEnabled())
            log.debug("load company (ID:" + form.getId() + ")");

        CompanyVO company = null;
        try {
            company = new CompanyDAO().getById(form.getId());

            Hibernate.initialize(company.getAddresses());
            Hibernate.initialize(company.getPersons());
            Hibernate.initialize(company.getSector());
            Hibernate.initialize(company.getLegalForm());
View Full Code Here

    {
        UserVO user = (UserVO)request.getSession().getAttribute(Globals.USER_KEY);

        try
        {
            new CompanyDAO().delete((CompanyVO)panel.getEntity());
        }
        catch (HibernateException e)
        {
            log.error("could not delete company", e);
View Full Code Here

        CompanyVO company = (CompanyVO) panel.getEntity();

        try {
            // speicher die Firma
            if (company.getId() == null)
                new CompanyDAO().insert(company);
            else
                new CompanyDAO().update(company);
        } catch (HibernateException e) {
            log.error("problems saving company (id:" + company.getId() + ")", e);
            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("default.error.rollback"));
        }
    }
View Full Code Here

        // Abfangen der m�glichen Fehler
        if (company.getCompanyName() == null) {
            errors.add("companyName", new ActionMessage("default.error.missingInput", MessageUtil.message(request, "entity.crm.company.companyName")));
        } else {
            try {
                CompanyDAO dao = new CompanyDAO();

                CompanyVO namedCompany = dao.getByName(company.getCompanyName());
                if (namedCompany != null && !namedCompany.getId().equals(company.getId()))
                    errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("module.crm.company.error.nameExists"));

                HibernateContext.getSession().evict(namedCompany);
            } catch (HibernateException e) {
View Full Code Here

        Page page = new Page(conf.getIntValue(UserConfiguration.Key.LIST_NUMBER_ROWS), form.getPage());

        String paramCompanyName = form.getCompanyName();

        CompanyDAO dao = new CompanyDAO();

        count = dao.countList(paramCompanyName, null, null, null, null, user);
        if (count < page.getFirstEntry())
            page.setPage(1);

        if (count > 0)
            list = dao.getList(paramCompanyName, null, null, null, null, sort, page, user);
        else
            list = new ArrayList<CompanyVO>();

        ScrollBean scroll = new ScrollBean();
        scroll.setCount(count);
View Full Code Here

            }
        }
       
        if(attrs.get("street") == null && person.getCompany() != null)
        {
            Set<AddressVO> addresses = new CompanyDAO().getById(person.getCompany().getId()).getAddresses();
            for(AddressVO address : addresses)
            {
                if(address.getType() == AddressVO.Type.MAIN)
                {
                    if(address.getStreet() != null)
View Full Code Here

        {
            Binding b = (Binding) enm.next();
            ctx.unbind(b.getName());
        }
       
        insertLdapCompany(new CompanyDAO().getAll());
    }
View Full Code Here

    protected void chooseEntity(EntityPanel panel, AddCompanyForm form, ActionMessages errors, HttpServletRequest request, HttpServletResponse response)
    {
        try
        {
            ContactVO contact = (ContactVO) panel.getEntity();
            contact.setCompany(new CompanyDAO().getById(form.getId()));
        }
        catch (HibernateException e)
        {
            errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("default.error.invalidEntity", new Integer(form.getId())));
View Full Code Here

TOP

Related Classes of org.opencustomer.db.dao.crm.CompanyDAO

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.