Exemple #1
0
        public async Task <BulkInviteResults> BulkInvitations(string BulkInviteSubmissionId)
        {
            var res = new BulkInviteResults(BulkInviteSubmissionId);

            try
            {
                var batch = await BulkInviteSubmission.GetItem(BulkInviteSubmissionId);

                if (batch == null)
                {
                    return(new BulkInviteResults
                    {
                        ErrorMessage = "Batch not found."
                    });
                }
                if (batch.StopProcessing)
                {
                    return(new BulkInviteResults
                    {
                        ErrorMessage = "Batch was flagged to discontinue processing."
                    });
                }
                res = await ProcessBulkInvitations(batch);

                return(res);
            }
            catch (Exception ex)
            {
                var msg = "Error processing bulk invitation";
                res.ErrorMessage = Logging.WriteToAppLog(msg, System.Diagnostics.EventLogEntryType.Error, ex);
                await BulkInviteResults.AddItem(res);

                return(res);
            }
        }
 public async Task <BatchDTO> GetBatchItem(string id)
 {
     return(new BatchDTO
     {
         Submission = await BulkInviteSubmission.GetItem(id),
         BatchResults = await BulkInviteResults.GetItems(id)
     });
 }