Пример #1
0
        public async Task Retrieve(IDialogContext context, LuisResult result)
        {
            string account = "";
            EntityRecommendation thisAccount;

            if (result.TryFindEntity("Account", out thisAccount))
            {
                account = thisAccount.Entity.ToUpper();
            }
            else
            {
                await context.PostAsync($"The query is not correct. Please try again.");

                return;
            }

            contosouserinfo user = await AzureService.serviceInstance.Get(account);

            // If the user exists
            if (user != null)
            {
                await context.PostAsync($"Your total balance is: ${user.balance}");

                PromptDialog.Confirm(context, Continuation, $"Is there anything else I can help you with?");
            }
            // Otherwise
            else
            {
                await context.PostAsync($"The account number is invalid. Please try again");

                context.Wait(MessageReceived);
            }
        }
Пример #2
0
 // This method POST the a new user to the Easytable SQL database
 public async Task Post(string id, string name, string secretcode, double balance)
 {
     user            = new contosouserinfo();
     user.ID         = id;
     user.name       = name;
     user.secretcode = secretcode;
     user.balance    = balance;
     await this.customerdata.InsertAsync(user);
 }