private async Task <DialogTurnResult> SelectSecurityQn1StepAsync_old(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        {
            string card       = "\\Cards\\artSecQn1.json";
            var    otpDetails = (ArtOTP)stepContext.Options;
            //otpDetails.IsValidMobile = false;

            //otpDetails.IsValidOTP = false;
            var    turnState        = stepContext.Context.TurnState.Values.ElementAt(6).ToString();
            var    turnStateDetails = JObject.Parse(turnState);
            string botUseriD        = turnStateDetails.SelectToken("activity.from.id").ToString();

            string json = "{\"UserID\":\"{UserID}\",\"Password\":\"null\",\"NewPassword\":\"null\",\"ConfirmNewPassword\":\"null\",\"sessionId\":\"{sessionId}\",\"sourceorigin\":\"1\",\"OTP\":\"null\",\"QuestionAnswerModelList\":\"null\"}";

            json = json.Replace("{UserID}", otpDetails.EmpID).Replace("{sessionId}", botUseriD);

            Root secQns = await APIRequest.GetAllSecurityQuestions(json);

            var adaptiveCardJson       = File.ReadAllText(Environment.CurrentDirectory + card);
            var adaptiveCardAttachment = new Attachment()
            {
                ContentType = "application/vnd.microsoft.card.adaptive",
                Content     = JsonConvert.DeserializeObject(adaptiveCardJson.ToString()),
            };

            var opts = new PromptOptions
            {
                Prompt = new Activity
                {
                    Attachments = new List <Attachment>()
                    {
                        adaptiveCardAttachment
                    },
                    Type = ActivityTypes.Message,
                }
            };

            return(await stepContext.PromptAsync(AdaptivePromptId, opts, cancellationToken));
        }
        private async Task <DialogTurnResult> SelectSecurityQn1StepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        {
            var otpDetails = (ArtOTP)stepContext.Options;

            string Option = stepContext.Result.ToString();

            if (Option == "Main Menu")
            {
                return(await stepContext.EndDialogAsync("MainMenu", cancellationToken));
            }
            else if (Option == "Chat with a live agent")
            {
                return(await stepContext.EndDialogAsync("Chat with a live agent", cancellationToken));
            }

            string card = "\\Cards\\artSecQn1.json";
            //otpDetails.IsValidMobile = false;

            //otpDetails.IsValidOTP = false;
            var    turnState        = stepContext.Context.TurnState.Values.ElementAt(6).ToString();
            var    turnStateDetails = JObject.Parse(turnState);
            string botUseriD        = turnStateDetails.SelectToken("activity.from.id").ToString();

            string json = "{\"UserID\":\"{UserID}\",\"Password\":\"null\",\"NewPassword\":\"null\",\"ConfirmNewPassword\":\"null\",\"sessionId\":\"{sessionId}\",\"sourceorigin\":\"1\",\"OTP\":\"null\",\"QuestionAnswerModelList\":\"null\"}";

            json = json.Replace("{UserID}", otpDetails.EmpID).Replace("{sessionId}", botUseriD);

            Root secQns = await APIRequest.GetAllSecurityQuestions(json);

            string AdaptiveCard  = "{\"$schema\": \"http://adaptivecards.io/schemas/adaptive-card.json\",\"type\": \"AdaptiveCard\",\"version\": \"1.0\",\"body\": [{QnsSet}],\"actions\": [{\"type\": \"Action.Submit\",\"title\": \"OK\"}]}";
            string finaltemplate = string.Empty;

            //string json = "{\"UserID\":\"{UserID}\",\"Password\":\"null\",\"NewPassword\":\"null\",\"ConfirmNewPassword\":\"null\",\"sessionId\":\"{sessionId}\",\"sourceorigin\":\"1\",\"OTP\":\"null\",\"QuestionAnswerModelList\":\"null\"}";
            //json = json.Replace("{UserID}", "51296").Replace("{sessionId}", "123456789012sdsd");

            //Root secQns = await GetAllSecurityQuestions(json);

            for (int i = 0; i < secQns.questions.Count; i++)
            {
                string template = "{\"type\": \"TextBlock\",\"text\": \"Choose question in [Category] Category\"},{\"type\": \"Input.ChoiceSet\",\"id\": \"Qn[i]\",\"style\": \"compact\",\"isMultiSelect\": false,\"value\": \"1\",\"choices\": [{Qns}]},{\"type\": \"Input.Text\",\"id\": \"An[i]\",\"placeholder\": \"Answer\"}";

                template = template.Replace("[i]", (i + 1).ToString()).Replace("[Category]", secQns.questions[i].categoryname);
                string qnsSet = "{\"title\": \"{Qn}\",\"value\": \"{QnId}\"}";
                for (int j = 0; j < secQns.questions[i].lstQuestions.Count; j++)
                {
                    if (j == 0)
                    {
                        qnsSet = qnsSet.Replace("{Qn}", secQns.questions[i].lstQuestions[j].question_text).Replace("{QnId}", secQns.questions[i].lstQuestions[j].question_id.ToString());
                    }
                    else
                    {
                        qnsSet = qnsSet + "," + qnsSet.Replace("{Qn}", secQns.questions[i].lstQuestions[j].question_text).Replace("{QnId}", secQns.questions[i].lstQuestions[j].question_id.ToString());
                    }
                    template = template.Replace("{Qns}", qnsSet);
                }

                if (i == 0)
                {
                    finaltemplate = template;
                }
                else
                {
                    finaltemplate = finaltemplate + "," + template;
                }
            }
            AdaptiveCard = AdaptiveCard.Replace("{QnsSet}", finaltemplate);

            var adaptiveCardJson       = File.ReadAllText(Environment.CurrentDirectory + card);
            var adaptiveCardAttachment = new Attachment()
            {
                ContentType = "application/vnd.microsoft.card.adaptive",
                Content     = JsonConvert.DeserializeObject(AdaptiveCard.ToString()),
            };

            var opts = new PromptOptions
            {
                Prompt = new Activity
                {
                    Attachments = new List <Attachment>()
                    {
                        adaptiveCardAttachment
                    },
                    Type = ActivityTypes.Message,
                }
            };

            return(await stepContext.PromptAsync(AdaptivePromptId, opts, cancellationToken));
        }