Beispiel #1
0
        private async Task <DialogTurnResult> RetreiveValueAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        {
            coil2 = stepContext.Result.ToString();
            string result = CoilData.isCoilCombinationValid(coil1, coil2);
            await stepContext.Context.SendActivityAsync(MessageFactory.Text(result), cancellationToken);

            await stepContext.Context.SendActivityAsync("For more information about Coil Combination , Please refer under Coils tab in User Documentation");

            var reply = MessageFactory.Text("Do you have other queries ");

            reply.SuggestedActions = new SuggestedActions()
            {
                Actions = new List <CardAction>()
                {
                    new CardAction()
                    {
                        Title = "Yes", Type = ActionTypes.ImBack, Value = "default"
                    },
                    new CardAction()
                    {
                        Title = "No", Type = ActionTypes.ImBack, Value = "exit"
                    }
                },
            };
            reply.InputHint = InputHints.ExpectingInput;
            await stepContext.Context.SendActivityAsync(reply, cancellationToken);

            return(await stepContext.EndDialogAsync(null, cancellationToken));
        }
        private static async Task <DialogTurnResult> RetreiveValueAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        {
            string coilType = CoilData.GetCoilType(stepContext.Result.ToString());
            await stepContext.Context.SendActivityAsync(coilType);

            var reply = MessageFactory.Text("Do you have other queries ");

            reply.SuggestedActions = new SuggestedActions()
            {
                Actions = new List <CardAction>()
                {
                    new CardAction()
                    {
                        Title = "Yes", Type = ActionTypes.ImBack, Value = "default"
                    },
                    new CardAction()
                    {
                        Title = "No", Type = ActionTypes.ImBack, Value = "exit"
                    }
                },
            };
            reply.InputHint = InputHints.ExpectingInput;
            await stepContext.Context.SendActivityAsync(reply, cancellationToken);

            return(await stepContext.EndDialogAsync(cancellationToken : cancellationToken));
        }
        private static async Task <DialogTurnResult> RetreiveValueAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        {
            CoilModel coil = CoilData.GetCoilDatails(stepContext.Result.ToString());

            if (coil != null)
            {
                MediaCardProperties mediaCardProperties = new MediaCardProperties();
                mediaCardProperties.CardTitle    = coil.CoilName + " (" + coil.CoilType + ")";
                mediaCardProperties.CardSubtitle = coil.Applications;
                mediaCardProperties.CardText     = coil.Design;
                mediaCardProperties.URL          = coil.ImagePath;

                Media_Cards mediaCards = new Media_Cards();
                Attachment  attachment = mediaCards.ThumbnailCard(mediaCardProperties);

                await stepContext.Context.SendActivityAsync(MessageFactory.Attachment(attachment));
            }
            else
            {
                await stepContext.Context.SendActivityAsync(stepContext.Result.ToString() + " not found!");
            }
            await stepContext.Context.SendActivityAsync("For more information about Coils , Please refer under Coils tab in User Documentation");

            var reply = MessageFactory.Text("Do you have other queries ");

            reply.SuggestedActions = new SuggestedActions()
            {
                Actions = new List <CardAction>()
                {
                    new CardAction()
                    {
                        Title = "Yes", Type = ActionTypes.ImBack, Value = "default"
                    },
                    new CardAction()
                    {
                        Title = "No", Type = ActionTypes.ImBack, Value = "exit"
                    }
                },
            };
            reply.InputHint = InputHints.ExpectingInput;
            await stepContext.Context.SendActivityAsync(reply, cancellationToken);

            return(await stepContext.EndDialogAsync(cancellationToken : cancellationToken));
        }