Submit all LeafInputFiles together

This commit is contained in:
2016-03-28 10:20:50 -04:00
parent 4b2757b19a
commit 9e86b92f08
29 changed files with 353 additions and 268 deletions
+9 -9
View File
@@ -31,25 +31,25 @@ namespace LeafWeb.Web.Services
public EmailNotificationService() : this(new DataService())
{ }
public void SendLeafWebError(int leafWebFileId, string errorMessage)
public void SendLeafWebError(int leafInputId, string errorMessage)
{
var file = _dataService.GetLeafInputFile(leafWebFileId);
var body = $"Your LeafWeb analysis job, {file.LeafInput.Identifier} (with filename {file.Filename}), encountered the following errors." + Environment.NewLine
var leafInput = _dataService.GetLeafInput(leafInputId);
var body = $"Your LeafWeb analysis job, {leafInput.Identifier}, encountered the following errors." + Environment.NewLine
+ "You will need to correct your input and resubmit." + Environment.NewLine + Environment.NewLine
+ errorMessage;
var message = new MailMessage(_emaialFromAddress, file.LeafInput.Email, "LeafWeb processing error", body);
var message = new MailMessage(_emaialFromAddress, leafInput.Email, "LeafWeb processing error", body);
SendMessage(message);
}
public void SendLeafWebSuccess(int leafWebFileId)
public void SendLeafWebSuccess(int leafInputId)
{
var file = _dataService.GetLeafInputFile(leafWebFileId);
var body = $"Your LeafWeb analysis job, {file.LeafInput.Identifier} (with filename {file.Filename}), has completed." + Environment.NewLine;
var message = new MailMessage(_emaialFromAddress, file.LeafInput.Email, "LeafWeb results", body);
var leafInput = _dataService.GetLeafInput(leafInputId);
var body = $"Your LeafWeb analysis job, {leafInput.Identifier}, has completed." + Environment.NewLine;
var message = new MailMessage(_emaialFromAddress, leafInput.Email, "LeafWeb results", body);
var fileStreams =
(from outputFile in
file.LeafOutputFiles
leafInput.OutputFiles
select Tuple.Create(outputFile, new MemoryStream(outputFile.Contents))).ToList();
try