public PlanAppointment(DynamicsContextController customerContext) : base(new LuisService(new LuisModelAttribute(
                                                                                              ConfigurationManager.AppSettings["LuisAppId"],
                                                                                              ConfigurationManager.AppSettings["LuisAPIKey"],
                                                                                              domain: ConfigurationManager.AppSettings["LuisAPIHostName"])))
 {
     this.customerContext = customerContext;
 }
Exemple #2
0
 public RootDialog() : base(new LuisService(new LuisModelAttribute(
                                                ConfigurationManager.AppSettings["LuisAppId"],
                                                ConfigurationManager.AppSettings["LuisAPIKey"],
                                                domain: ConfigurationManager.AppSettings["LuisAPIHostName"])))
 {
     customerContext = new DynamicsContextController();
 }
Exemple #3
0
        public async Task AfterResetAsync(IDialogContext context, IAwaitable <bool> argument)
        {
            var confirm = await argument;

            if (confirm)
            {
                this.customerContext = new DynamicsContextController();
                return;
            }
            else
            {
                await context.PostAsync($"Ok, no reset, where were we?");
            }

            context.Wait(MessageReceived);
        }
Exemple #4
0
        private async Task ResumeAfterPlanDate(IDialogContext context, IAwaitable <object> result)
        {
            var newContext = await result as DynamicsContextController;

            this.customerContext = newContext;

            if (this.shouldContinueWithLastMessage)
            {
                var newMessage = context.MakeMessage();
                newMessage.Text = this.lastMessage;

                await this.MessageReceived(context, Awaitable.FromItem(newMessage));

                return;
            }

            context.Wait(this.MessageReceived);
        }
Exemple #5
0
        private async Task ResumeAfterCustomerIdentification(IDialogContext context, IAwaitable <object> result)
        {
            var newContext = await result as DynamicsContextController;

            this.customerContext = newContext;
            if (this.customerContext.CustomerId.HasValue) // Customer identification successful.
            {
                await context.PostAsync($"Welcome {this.customerContext.FirstName}");

                if (this.shouldContinueWithLastMessage)
                {
                    var newMessage = context.MakeMessage();
                    newMessage.Text = this.lastMessage;

                    await this.MessageReceived(context, Awaitable.FromItem(newMessage));

                    return;
                }
            }

            context.Wait(this.MessageReceived);
        }
Exemple #6
0
        private async Task ResumeAfterCvIdentification(IDialogContext context, IAwaitable <object> result)
        {
            var newContext = await result as DynamicsContextController;

            this.customerContext = newContext;

            if (this.shouldContinueWithLastMessage)
            {
                var newMessage = context.MakeMessage();
                newMessage.Text = this.lastMessage;

                await context.PostAsync($"We see that you have a {this.customerContext.CustomerCv.ProductName}.");

                await this.MessageReceived(context, Awaitable.FromItem(newMessage));

                return;
            }

            await context.PostAsync($"We see that you have a {this.customerContext.CustomerCv.ProductName}. Does the boiler show a error code?");

            this.customerContext.ErrorCodeAsked = true;
            context.Wait(this.MessageReceived);
        }