public static IProgressItem Start(List <int> fileID, List <int> contactID, String subject, String bodyTemplate, bool storeInHistory) { lock (_syncObj) { var operation = _mailQueue.GetStatus(TenantProvider.CurrentTenantID); if (operation == null) { if (fileID == null) { fileID = new List <int>(); } if (contactID == null || contactID.Count == 0 || String.IsNullOrEmpty(subject) || String.IsNullOrEmpty(bodyTemplate)) { return(null); } if (contactID.Count > GetQuotas()) { contactID = contactID.Take(GetQuotas()).ToList(); } operation = new SendBatchEmailsOperation(fileID, contactID, subject, bodyTemplate, storeInHistory); _mailQueue.Add(operation); } if (!_mailQueue.IsStarted) { _mailQueue.Start(x => x.RunJob()); } return(operation); } }
public static IProgressItem GetStatus(EntityType entityType) { var result = _importQueue.GetStatus(String.Format("{0}_{1}", TenantProvider.CurrentTenantID, (int)entityType)); if (result == null) { return(ImportDataCache.Get(entityType)); } return(result); }
public static IProgressItem GetStatus() { return(_exportQueue.GetStatus(TenantProvider.CurrentTenantID)); }
public static PdfProgressItem GetTaskStatus(int tenantId, int invoiceId) { var id = GetTaskId(tenantId, invoiceId); return Queue.GetStatus(id) as PdfProgressItem; }
public static IProgressItem GetStatus(EntityType entityType) { return(_importQueue.GetStatus(String.Format("{0}_{1}", TenantProvider.CurrentTenantID, (int)entityType))); }
public static IProgressItem GetProgressItemStatus(int tenantId, Guid userId, Type progressItemType) { var id = GetProgressItemId(tenantId, userId, progressItemType); return(Queue.GetStatus(id)); }