Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private async Task getInvoiceDetailsAsync(IDialogContext context, IAwaitable<object> result)
- {
- var activity = await result as Activity;
- companyName = activity.Text;
- noOfCompany = 10;
- // calling the Api to get invoice details
- InvoiceDetailsController obj = new InvoiceDetailsController();
- // store return data in to a list
- returnInvoiceDetails = obj.getInvoiceDetails(userid, companyName, noOfCompany);
- invoiceCount = obj.getItems();
- // checking if the return list contains any useful values
- if (invoiceCount!=0) {
- for (int i = 0; i < invoiceCount; i++)
- {
- customerID[i] = returnInvoiceDetails[i].customer_id.ToString();
- settleamount[i] = float.Parse(returnInvoiceDetails[i].settle_amount.ToString());
- settAmount[i] = settleamount[i].ToString("#,##0");
- }
- var selectedCard = await result;
- var message = context.MakeMessage();
- // calling the card to show details
- var attachment = invoiceCard();
- message.Attachments.Add(attachment);
- await context.PostAsync(message); }
- context.Wait(MessageReceivedAsync);
- }
- private static Attachment invoiceCard()
- {
- ThumbnailCard invoiceDetails = new ThumbnailCard
- {
- Images = new List<CardImage> {
- new CardImage("https://thumb9.shutterstock.com/display_pic_with_logo/701173/108824516/stock-photo-cloud-computing-concept-isolated-on-white-background-d-rendered-108824516.jpg"), },
- Title = "<b><u><font color ="#721B59">These are the Invoice Details for " + companyName+ "<b><u><font color ="#721B59"></font></b></u>",
- Text = $"<b>Customer Id :-</b>" + " " + customerID[0] + "<br> <b>Settlement amount :-</b>" + " " + settAmount[0] +
- "<br><br><b>Customer Id :-</b>" + " " + customerID[1] + "<br> <b>Settlement amount :-</b>" + " " + settAmount[1] +
- "<br><br><b>Customer Id :-</b>" + " " + customerID[2] + "<br> <b>Settlement amount :-</b>" + " " + settAmount[2] +
- "<br><br><b>Customer Id :-</b>" + " " + customerID[3] + "<br> <b>Settlement amount :-</b>" + " " + settAmount[3] +
- "<br><br><b>Customer Id :-</b>" + " " + customerID[4] + "<br> <b>Settlement amount :-</b>" + " " + settAmount[4],
- Buttons = new List<CardAction>
- {
- new CardAction(ActionTypes.ImBack,"Thank you",value:"U0001F642")
- },
- };
- return invoiceDetails.ToAttachment();
- }
- <?xml version="1.0" encoding="utf-8"?>
- <!--
- For more information on how to configure your ASP.NET application, please visit
- http://go.microsoft.com/fwlink/?LinkId=301879
- -->
- <configuration>
- <appSettings>
- <!-- update these with your BotId, Microsoft App Id and your Microsoft App Password-->
- <add key="BotId" value="AX_Bot" />
- <add key="MicrosoftAppId" value="" />
- <add key="MicrosoftAppPassword" value="" />
- </appSettings>
- <!--
- For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
- The following attributes can be set on the <httpRuntime> tag.
- <system.Web>
- <httpRuntime targetFramework="4.6" />
- </system.Web>
- -->
- <system.web>
- <customErrors mode="Off" />
- <compilation debug="true" targetFramework="4.6" />
- <httpRuntime targetFramework="4.6" />
- </system.web>
- <system.webServer>
- <defaultDocument>
- <files>
- <clear />
- <add value="default.htm" />
- </files>
- </defaultDocument>
- <handlers>
- <remove name="ExtensionlessUrlHandler-Integrated-4.0" />
- <remove name="OPTIONSVerbHandler" />
- <remove name="TRACEVerbHandler" />
- <add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
- </handlers></system.webServer>
- <runtime>
- <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
- <dependentAssembly>
- <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
- <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
- <bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
- <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Net.Http.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-4.2.29.0" newVersion="4.2.29.0" />
- </dependentAssembly>
- <dependentAssembly>
- <assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
- <bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
- </dependentAssembly>
- </assemblyBinding>
- </runtime>
- </configuration>
Add Comment
Please, Sign In to add comment