private Attachment GetPoDetailsCard(PoDetails details) { var receiptCard = new ReceiptCard { Title = $"PO# {details.Number}", Facts = new List <Fact> { new Fact("Line", details.LineNumber.ToString()), new Fact("Description", details.Description), new Fact("To Be Invoiced", details.ToBeInvoiced), new Fact("To Be Delivered", details.ToBeDelivered), new Fact("Invoice #", details.InvoiceNumber.ToString()), new Fact("Quantity", details.InvoiceQuantity), new Fact("GR Posting Date", details.GrPostingDate.ToShortDateString()), new Fact("Payment Date", details.PaymentDate.ToShortDateString()) } }; return(receiptCard.ToAttachment()); }
private async Task AfterPOChoiceSelected(IDialogContext context, IAwaitable <string> result) { var selectedPO = await result; var message = context.MakeMessage(); var po1 = new PoDetails() { Number = 2515438, LineNumber = 10, Description = "Y1 3 Year Renewal Oracle OTM", ToBeInvoiced = "N/A", ToBeDelivered = "N/A", InvoiceNumber = 438123, GrPostingDate = DateTime.Now.AddMonths(-10), PaymentDate = DateTime.Now.AddMonths(-8), InvoiceQuantity = "342,214" }; message.Attachments.Add(GetPoDetailsCard(po1)); var po2 = new PoDetails() { Number = 2515438, LineNumber = 20, Description = "Y2 3 Year Renewal Oracle OTM", ToBeInvoiced = "383,333", ToBeDelivered = "383,333", InvoiceNumber = 0, GrPostingDate = DateTime.Now.AddMonths(-10), PaymentDate = DateTime.Now.AddMonths(-8), InvoiceQuantity = "342,214" }; message.Attachments.Add(GetPoDetailsCard(po2)); var po3 = new PoDetails() { Number = 2515438, LineNumber = 20, Description = "Y3 3 Year Renewal Oracle OTM", ToBeInvoiced = "383,333", ToBeDelivered = "383,333", InvoiceNumber = 0, GrPostingDate = DateTime.Now.AddMonths(-10), PaymentDate = DateTime.Now.AddMonths(-8), InvoiceQuantity = "342,214" }; message.Attachments.Add(GetPoDetailsCard(po3)); message.Attachments.Add(new Attachment() { ContentUrl = "https://northwelldemo.blob.core.windows.net/apim/APIManagement-Northwell.pdf", ContentType = "application/pdf", Name = "Invoice.pdf" }); await context.PostAsync(message); //await this.StartOverAsync(context, message); //context.Wait(MessageReceivedAsync); }