public async Task ProcessQueueMessageWebJobXml ( [QueueTrigger("webjob-xml")] string message, int DequeueCount, ILogger logger ) { Inserted myFiles = _myFiles.GetFileInfo(Convert.ToInt32(message)); if (myFiles.Fail) { throw new Exception("User's exception"); } string fileName = $"{myFiles.GUID}.xml", fileNameJson = $"{myFiles.GUID}.json"; XmlDocument doc = new XmlDocument(); doc.Load(_blob.Download(fileName).Content); string json = JsonConvert.SerializeXmlNode(doc, Newtonsoft.Json.Formatting.Indented); Image file = new Image(fileNameJson, json); _blob.SaveJson(file); Form mailMsg = new Form(myFiles.Name, myFiles.Email, fileNameJson); string sgID = await _myEmail.SendSuccessMessage(mailMsg); Inserted update = new Inserted(Convert.ToInt32(message), true, DequeueCount, sgID); _myFiles.UpdateFileInfo(update); }
public async Task ProcessQueueMessageWebJobPdf ( [QueueTrigger("%queueName%")] string message, int DequeueCount, ILogger logger ) { Form info = _info.GetFileInfo(Convert.ToInt32(message)); Image pdfEnglish = new Image($"{info.Guid}-eng.pdf", "application/pdf", _pdf.CreateEnglish(info)); _blob.Save(pdfEnglish); if (info.Portuguese) { Image pdfPortuguese = new Image($"{info.Guid}-pt.pdf", "application/pdf", _pdf.CreatePortuguese(info)); _blob.Save(pdfPortuguese); } string SGMsg = await _email.SendSuccessMessage(info); _info.UpdateFileInfo(Convert.ToInt32(message), true, DequeueCount, SGMsg); }