Search in sources :

Example 1 with OrganizationDAO

use of com.autentia.tnt.dao.hibernate.OrganizationDAO in project TNTConcept by autentia.

the class OccupationBean method getSelectedOrganization.

public Organization getSelectedOrganization() {
    if (occupation != null && occupation.getProject() != null) {
        if (selectedOrganization == null) {
            selectedOrganization = occupation.getProject().getClient();
        }
        return selectedOrganization;
    }
    if (selectedOrganization == null) {
        OrganizationDAO organizationDAO = new OrganizationDAO();
        selectedOrganization = organizationDAO.loadById(ConfigurationUtil.getDefault().getIdOurCompany());
    }
    return selectedOrganization;
}
Also used : OrganizationDAO(com.autentia.tnt.dao.hibernate.OrganizationDAO)

Example 2 with OrganizationDAO

use of com.autentia.tnt.dao.hibernate.OrganizationDAO in project TNTConcept by autentia.

the class DuplicateOfferTest method insertInitialData.

/**
 * Metodo encargado de insertar datos muy generales pero que son necesarios
 * para generar facturas en base a ofertas
 */
private void insertInitialData() {
    final OfferDAO offerDAO = (OfferDAO) SpringUtilsForTesting.getSpringBean("daoOffer");
    final ProjectDAO projectDAO = (ProjectDAO) SpringUtilsForTesting.getSpringBean("daoProject");
    final OrganizationDAO organizationDAO = (OrganizationDAO) SpringUtilsForTesting.getSpringBean("daoOrganization");
    final ContactDAO contactDAO = (ContactDAO) SpringUtilsForTesting.getSpringBean("daoContact");
    final UserDAO userDAO = (UserDAO) SpringUtilsForTesting.getSpringBean("daoUser");
    final RoleDAO roleDAO = (RoleDAO) SpringUtilsForTesting.getSpringBean("daoRole");
    final UserCategoryDAO categoryDAO = (UserCategoryDAO) SpringUtilsForTesting.getSpringBean("daoUserCategory");
    final DepartmentDAO departmentDAO = (DepartmentDAO) SpringUtilsForTesting.getSpringBean("daoDepartment");
    final WorkingAgreementDAO workingAgreementDAO = (WorkingAgreementDAO) SpringUtilsForTesting.getSpringBean("daoWorkingAgreement");
    final Role role = new Role();
    roleDAO.insert(role);
    final Department department = new Department();
    department.setName("departamento");
    departmentDAO.insert(department);
    final UserCategory category = new UserCategory();
    categoryDAO.insert(category);
    final WorkingAgreement workingAgreement = new WorkingAgreement();
    workingAgreementDAO.insert(workingAgreement);
    contact.setName("Sergio Hermida");
    contactDAO.insert(contact);
    projectDAO.insert(project);
    organizationDAO.insert(organization);
    user.setRole(role);
    user.setCategory(category);
    user.setDepartment(department);
    user.setAgreement(workingAgreement);
    userDAO.insert(user);
    offer.setNumber(OFFER_NUMBER);
    offer.setOrganization(organization);
    offer.setContact(contact);
    offer.setTitle(OFFER_TITLE);
    offer.setDescription(OFFER_DESCRIPTION);
    offer.setOfferPotential(OfferPotential.MEDIUM);
    offer.setOfferState(OfferState.OPEN);
    offer.setCreationDate(new Date());
    offer.setMaturityDate(new Date());
    offerDAO.insert(offer);
}
Also used : UserCategory(com.autentia.tnt.businessobject.UserCategory) DepartmentDAO(com.autentia.tnt.dao.hibernate.DepartmentDAO) Date(java.util.Date) WorkingAgreementDAO(com.autentia.tnt.dao.hibernate.WorkingAgreementDAO) Role(com.autentia.tnt.businessobject.Role) OfferRole(com.autentia.tnt.businessobject.OfferRole) Department(com.autentia.tnt.businessobject.Department) UserCategoryDAO(com.autentia.tnt.dao.hibernate.UserCategoryDAO) UserDAO(com.autentia.tnt.dao.hibernate.UserDAO) ContactDAO(com.autentia.tnt.dao.hibernate.ContactDAO) RoleDAO(com.autentia.tnt.dao.hibernate.RoleDAO) OfferDAO(com.autentia.tnt.dao.hibernate.OfferDAO) OrganizationDAO(com.autentia.tnt.dao.hibernate.OrganizationDAO) ProjectDAO(com.autentia.tnt.dao.hibernate.ProjectDAO) WorkingAgreement(com.autentia.tnt.businessobject.WorkingAgreement)

Example 3 with OrganizationDAO

use of com.autentia.tnt.dao.hibernate.OrganizationDAO in project TNTConcept by autentia.

the class FromOfferToBillTest method insertInitialData.

/**
 * Metodo encargado de insertar datos muy generales pero que son necesarios
 * para generar facturas en base a ofertas
 */
private void insertInitialData() {
    final OfferDAO offerDAO = (OfferDAO) SpringUtilsForTesting.getSpringBean("daoOffer");
    final ProjectDAO projectDAO = (ProjectDAO) SpringUtilsForTesting.getSpringBean("daoProject");
    final OrganizationDAO organizationDAO = (OrganizationDAO) SpringUtilsForTesting.getSpringBean("daoOrganization");
    final ContactDAO contactDAO = (ContactDAO) SpringUtilsForTesting.getSpringBean("daoContact");
    contact.setName("Sergio Hermida");
    contactDAO.insert(contact);
    projectDAO.insert(project);
    organizationDAO.insert(organization);
    offer.setNumber(OFFER_NUMBER);
    offer.setOrganization(organization);
    offer.setContact(contact);
    offer.setTitle(OFFER_TITLE);
    offer.setDescription(OFFER_DESCRIPTION);
    offer.setOfferPotential(OfferPotential.MEDIUM);
    offer.setOfferState(OfferState.OPEN);
    offer.setCreationDate(new Date());
    offerDAO.insert(offer);
}
Also used : ContactDAO(com.autentia.tnt.dao.hibernate.ContactDAO) OfferDAO(com.autentia.tnt.dao.hibernate.OfferDAO) OrganizationDAO(com.autentia.tnt.dao.hibernate.OrganizationDAO) Date(java.util.Date) ProjectDAO(com.autentia.tnt.dao.hibernate.ProjectDAO)

Example 4 with OrganizationDAO

use of com.autentia.tnt.dao.hibernate.OrganizationDAO in project TNTConcept by autentia.

the class ContactPositionManagerTest method insertInitialData.

/**
 * Metodo encargado de insertar datos muy generales pero que son necesarios
 * en la gestion de contactos
 */
private void insertInitialData() {
    final ProvinceDAO provinceDAO = (ProvinceDAO) SpringUtilsForTesting.getSpringBean("daoProvince");
    final OrganizationISOCategoryDAO organizationISOCategoryDAO = (OrganizationISOCategoryDAO) SpringUtilsForTesting.getSpringBean("daoOrganizationISOCategory");
    final OrganizationTypeDAO organizationTypeDAO = (OrganizationTypeDAO) SpringUtilsForTesting.getSpringBean("daoOrganizationType");
    final OrganizationDAO organizationDAO = (OrganizationDAO) SpringUtilsForTesting.getSpringBean("daoOrganization");
    final DepartmentDAO departmentDAO = (DepartmentDAO) SpringUtilsForTesting.getSpringBean("daoDepartment");
    // provincia
    province.setName("Madrid");
    provinceDAO.insert(province);
    // categoria de la organizacion
    organizationType.setName("prospecto");
    organizationTypeDAO.insert(organizationType);
    // categoria ISO de la organizacion
    organizationISOCategory.setName("A");
    organizationISOCategoryDAO.insert(organizationISOCategory);
    // organizacion
    organization.setName("Tecnologías de España");
    organization.setProvince(province);
    organization.setType(organizationType);
    organization.setCategory(organizationISOCategory);
    organizationDAO.insert(organization);
    // departamento
    department.setName("comercial");
    department.setDescription("comercial");
    departmentDAO.insert(department);
}
Also used : OrganizationTypeDAO(com.autentia.tnt.dao.hibernate.OrganizationTypeDAO) OrganizationISOCategoryDAO(com.autentia.tnt.dao.hibernate.OrganizationISOCategoryDAO) ProvinceDAO(com.autentia.tnt.dao.hibernate.ProvinceDAO) DepartmentDAO(com.autentia.tnt.dao.hibernate.DepartmentDAO) OrganizationDAO(com.autentia.tnt.dao.hibernate.OrganizationDAO)

Example 5 with OrganizationDAO

use of com.autentia.tnt.dao.hibernate.OrganizationDAO in project TNTConcept by autentia.

the class OfferTest method insertInitialData.

/**
 * Metodo encargado de insertar datos muy generales pero que son necesarios
 * para generar facturas en base a ofertas
 */
private void insertInitialData() {
    final OfferDAO offerDAO = (OfferDAO) SpringUtilsForTesting.getSpringBean("daoOffer");
    final ProjectDAO projectDAO = (ProjectDAO) SpringUtilsForTesting.getSpringBean("daoProject");
    final OrganizationDAO organizationDAO = (OrganizationDAO) SpringUtilsForTesting.getSpringBean("daoOrganization");
    final ContactDAO contactDAO = (ContactDAO) SpringUtilsForTesting.getSpringBean("daoContact");
    final UserDAO userDAO = (UserDAO) SpringUtilsForTesting.getSpringBean("daoUser");
    final RoleDAO roleDAO = (RoleDAO) SpringUtilsForTesting.getSpringBean("daoRole");
    final UserCategoryDAO categoryDAO = (UserCategoryDAO) SpringUtilsForTesting.getSpringBean("daoUserCategory");
    final DepartmentDAO departmentDAO = (DepartmentDAO) SpringUtilsForTesting.getSpringBean("daoDepartment");
    final WorkingAgreementDAO workingAgreementDAO = (WorkingAgreementDAO) SpringUtilsForTesting.getSpringBean("daoWorkingAgreement");
    final Role role = new Role();
    roleDAO.insert(role);
    final Department department = new Department();
    department.setName("departamento");
    departmentDAO.insert(department);
    final UserCategory category = new UserCategory();
    categoryDAO.insert(category);
    final WorkingAgreement workingAgreement = new WorkingAgreement();
    workingAgreementDAO.insert(workingAgreement);
    contact.setName("Sergio Hermida");
    contactDAO.insert(contact);
    projectDAO.insert(project);
    organizationDAO.insert(organization);
    user.setRole(role);
    user.setCategory(category);
    user.setDepartment(department);
    user.setAgreement(workingAgreement);
    userDAO.insert(user);
    offer.setNumber(OFFER_NUMBER);
    offer.setOrganization(organization);
    offer.setContact(contact);
    offer.setTitle(OFFER_TITLE);
    offer.setDescription(OFFER_DESCRIPTION);
    offer.setOfferPotential(OfferPotential.MEDIUM);
    offer.setOfferState(OfferState.OPEN);
    offer.setCreationDate(new Date());
    offer.setMaturityDate(new Date());
    offerDAO.insert(offer);
}
Also used : DepartmentDAO(com.autentia.tnt.dao.hibernate.DepartmentDAO) Date(java.util.Date) WorkingAgreementDAO(com.autentia.tnt.dao.hibernate.WorkingAgreementDAO) UserCategoryDAO(com.autentia.tnt.dao.hibernate.UserCategoryDAO) UserDAO(com.autentia.tnt.dao.hibernate.UserDAO) ContactDAO(com.autentia.tnt.dao.hibernate.ContactDAO) RoleDAO(com.autentia.tnt.dao.hibernate.RoleDAO) OfferDAO(com.autentia.tnt.dao.hibernate.OfferDAO) OrganizationDAO(com.autentia.tnt.dao.hibernate.OrganizationDAO) ProjectDAO(com.autentia.tnt.dao.hibernate.ProjectDAO)

Aggregations

OrganizationDAO (com.autentia.tnt.dao.hibernate.OrganizationDAO)6 ContactDAO (com.autentia.tnt.dao.hibernate.ContactDAO)3 DepartmentDAO (com.autentia.tnt.dao.hibernate.DepartmentDAO)3 OfferDAO (com.autentia.tnt.dao.hibernate.OfferDAO)3 ProjectDAO (com.autentia.tnt.dao.hibernate.ProjectDAO)3 Date (java.util.Date)3 RoleDAO (com.autentia.tnt.dao.hibernate.RoleDAO)2 UserCategoryDAO (com.autentia.tnt.dao.hibernate.UserCategoryDAO)2 UserDAO (com.autentia.tnt.dao.hibernate.UserDAO)2 WorkingAgreementDAO (com.autentia.tnt.dao.hibernate.WorkingAgreementDAO)2 Department (com.autentia.tnt.businessobject.Department)1 OfferRole (com.autentia.tnt.businessobject.OfferRole)1 Role (com.autentia.tnt.businessobject.Role)1 UserCategory (com.autentia.tnt.businessobject.UserCategory)1 WorkingAgreement (com.autentia.tnt.businessobject.WorkingAgreement)1 OrganizationISOCategoryDAO (com.autentia.tnt.dao.hibernate.OrganizationISOCategoryDAO)1 OrganizationTypeDAO (com.autentia.tnt.dao.hibernate.OrganizationTypeDAO)1 ProvinceDAO (com.autentia.tnt.dao.hibernate.ProvinceDAO)1