示例#1
0
        public async Task ChooseIssue(IDialogContext context, IAwaitable <string> result)
        {
            try

            {
                string optionSelected = await result;
                RootDialog.UserResponse = optionSelected;

                List <string> Issues = new List <string>();
                Issues = SQLManager.GetIssueName(optionSelected.ToString());

                switch (optionSelected)

                {
                case "Software":
                    RootDialog.BotResponse = SQLManager.GetITQuestions(2);
                    SQLManager.GetConversationData(UserData.UserID, RootDialog.UserResponse, RootDialog.BotResponse);
                    PromptDialog.Choice(context, this.SoftwareIssue, Issues, RootDialog.BotResponse);



                    break;

                case "Hardware":
                    RootDialog.BotResponse = SQLManager.GetITQuestions(3);
                    SQLManager.GetConversationData(UserData.UserID, RootDialog.UserResponse, RootDialog.BotResponse);
                    PromptDialog.Choice(context, this.HardwareIssue, Issues, RootDialog.BotResponse);


                    break;
                }
            }

            catch (Exception e)

            {
                await context.PostAsync("enter a valid option");
            }
        }