Search in sources :

Example 1 with Campaign

use of com.axelor.apps.marketing.db.Campaign in project axelor-open-suite by axelor.

the class CampaignController method inviteAllTargets.

public void inviteAllTargets(ActionRequest request, ActionResponse response) {
    Campaign campaign = request.getContext().asType(Campaign.class);
    try {
        Beans.get(CampaignService.class).inviteAllTargets(Beans.get(CampaignRepository.class).find(campaign.getId()));
        response.setReload(true);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : CampaignService(com.axelor.apps.marketing.service.CampaignService) Campaign(com.axelor.apps.marketing.db.Campaign)

Example 2 with Campaign

use of com.axelor.apps.marketing.db.Campaign in project axelor-open-suite by axelor.

the class CampaignController method markPartnerPresent.

public void markPartnerPresent(ActionRequest request, ActionResponse response) {
    Campaign campaign = request.getContext().getParent().asType(Campaign.class);
    Partner partner = request.getContext().asType(Partner.class);
    partner = Beans.get(PartnerRepository.class).find(partner.getId());
    try {
        Beans.get(CampaignService.class).markPartnerPresent(Beans.get(CampaignRepository.class).find(campaign.getId()), partner);
        response.setReload(true);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : CampaignService(com.axelor.apps.marketing.service.CampaignService) Campaign(com.axelor.apps.marketing.db.Campaign) Partner(com.axelor.apps.base.db.Partner)

Example 3 with Campaign

use of com.axelor.apps.marketing.db.Campaign in project axelor-open-suite by axelor.

the class CampaignController method inviteSelectedTargets.

public void inviteSelectedTargets(ActionRequest request, ActionResponse response) {
    Campaign campaignContext = request.getContext().asType(Campaign.class);
    try {
        Beans.get(CampaignService.class).inviteSelectedTargets(Beans.get(CampaignRepository.class).find(campaignContext.getId()), campaignContext);
        response.setReload(true);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : CampaignService(com.axelor.apps.marketing.service.CampaignService) Campaign(com.axelor.apps.marketing.db.Campaign)

Example 4 with Campaign

use of com.axelor.apps.marketing.db.Campaign in project axelor-open-suite by axelor.

the class CampaignController method generateTargets.

public void generateTargets(ActionRequest request, ActionResponse response) {
    Campaign campaign = request.getContext().asType(Campaign.class);
    try {
        campaign = Beans.get(CampaignRepository.class).find(campaign.getId());
        Beans.get(CampaignService.class).generateTargets(campaign);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
    response.setReload(true);
}
Also used : CampaignService(com.axelor.apps.marketing.service.CampaignService) Campaign(com.axelor.apps.marketing.db.Campaign)

Example 5 with Campaign

use of com.axelor.apps.marketing.db.Campaign in project axelor-open-suite by axelor.

the class CampaignController method addNotParticipatingTargets.

public void addNotParticipatingTargets(ActionRequest request, ActionResponse response) {
    Campaign campaignContext = request.getContext().asType(Campaign.class);
    try {
        Beans.get(CampaignService.class).addNotParticipatingTargets(Beans.get(CampaignRepository.class).find(campaignContext.getId()), campaignContext);
        response.setReload(true);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : CampaignService(com.axelor.apps.marketing.service.CampaignService) Campaign(com.axelor.apps.marketing.db.Campaign)

Aggregations

Campaign (com.axelor.apps.marketing.db.Campaign)11 CampaignService (com.axelor.apps.marketing.service.CampaignService)10 MetaFile (com.axelor.meta.db.MetaFile)2 Partner (com.axelor.apps.base.db.Partner)1 Lead (com.axelor.apps.crm.db.Lead)1 IExceptionMessage (com.axelor.apps.marketing.exception.IExceptionMessage)1 Message (com.axelor.apps.message.db.Message)1 Transactional (com.google.inject.persist.Transactional)1