public void GenerateList(ListSettings settings) { settings.Job.JobStatus = JobStatus.Running; settings.Job.Started = DateTime.Now; settings.Job.JobName = $"Generating new list '{settings.Name}' with '{settings.Recipients}' recipients"; try { settings.Job.Status = $"Creating {settings.Recipients} Contacts"; var contactRepository = new ContactRepository(); var contacts = contactRepository.CreateContacts(settings.Job, settings.Recipients); var contactListRepository = new ContactListRepository(); contactListRepository.CreateList(settings.Job, settings.Name, contacts); IndexService.RebuildListIndexes(settings.Job); settings.Job.JobStatus = JobStatus.Complete; settings.Job.Status = "DONE!"; Log.Info($"EXMGenerator completed: {settings.Job.CompletedContacts}", this); } catch { settings.Job.Status = "Failed!"; settings.Job.JobStatus = JobStatus.Failed; } finally { settings.Job.Ended = DateTime.Now; } }
public void GenerateList(ListSettings settings) { settings.Job.JobStatus = JobStatus.Running; settings.Job.Started = DateTime.Now; settings.Job.JobName = $"Generating new list '{settings.Name}' with '{settings.Recipients}' recipients"; try { settings.Job.Status = $"Creating {settings.Recipients} Contacts"; var contactRepository = new ContactRepository(); var contacts = contactRepository.CreateContacts(settings.Job, settings.Recipients); var contactListRepository = new ContactListRepository(); using (new SecurityDisabler()) { contactListRepository.CreateList(settings.Job, settings.Name, contacts); } settings.Job.JobStatus = JobStatus.Complete; settings.Job.Status = "DONE!"; Log.Info($"EXMGenerator completed: {settings.Job.CompletedContacts}", this); } catch (Exception ex) { settings.Job.Status = "Failed!"; settings.Job.JobStatus = JobStatus.Failed; Log.Error(string.Format("EXMGenerator failed: {0}", ex.Message), ex, this); } finally { settings.Job.Ended = DateTime.Now; } }
public GenerateCampaignDataService(Guid exmCampaignId, CampaignSettings campaign) { _campaign = campaign; _exmCampaignId = exmCampaignId; _contactListRepository = new ContactListRepository(); _adjustEmailStatisticsService = new AdjustEmailStatisticsService(); _randomContactMessageEventsFactory = new RandomContactMessageEventsFactory(_campaign); }
public GenerateCampaignDataService(Guid exmCampaignId, CampaignSettings campaign) { _campaign = campaign; _exmCampaignId = exmCampaignId; _contactListRepository = new ContactListRepository(); _exmCampaignService = (IExmCampaignService)ServiceLocator.ServiceProvider.GetService(typeof(IExmCampaignService)); _dispatchManager = (IDispatchManager)ServiceLocator.ServiceProvider.GetService(typeof(IDispatchManager)); _ecmDataProvider = (EcmDataProvider)ServiceLocator.ServiceProvider.GetService(typeof(EcmDataProvider)); _recipientManagerFactory = (IRecipientManagerFactory)ServiceLocator.ServiceProvider.GetService(typeof(IRecipientManagerFactory)); _logger = (ILogger)ServiceLocator.ServiceProvider.GetService(typeof(ILogger)); _itemUtilExt = (ItemUtilExt)ServiceLocator.ServiceProvider.GetService(typeof(ItemUtilExt)); _adjustEmailStatisticsService = new AdjustEmailStatisticsService(); _randomContactMessageEventsFactory = new RandomContactMessageEventsFactory(_campaign); }
public ContactController() { _contactRepo = new ContactListRepository(); }
public IEnumerable <UserAccount> GetContactListByUsernameAndPassword(IDbConnection connection, string username, string password) { ContactListRepository contactListRepository = new ContactListRepository(); return(contactListRepository.GetContactListByUser(connection, username, password)); }
public ContactModel() { contactListRepository = new ContactListRepository(); }
public void Setup() { _contactModelTest = new ContactListModel(); _contactRepoTest = new ContactListRepository(); }