示例#1
0
        public async Task IssueCategory(IDialogContext context, IAwaitable <object> result)
        {
            List <string> category = new List <string>();

            category = SQLManager.ChooseIssueCategory();
            RootDialog.BotResponse = SQLManager.GetITQuestions(1);
            SQLManager.GetConversationData(UserData.UserID, RootDialog.UserResponse, RootDialog.BotResponse);
            //await context.PostAsync(RootDialog.BotResponse);
            PromptDialog.Choice(context, this.ChooseIssue, category, RootDialog.BotResponse);
        }
示例#2
0
        public async Task IssueDescription(IDialogContext context, IAwaitable <object> result)
        {
            var    activity    = await result as Activity;
            string description = activity.Text;

            RootDialog.UserResponse = description;
            RootDialog.BotResponse  = SQLManager.GetITQuestions(4);
            SQLManager.GetConversationData(UserData.UserID, RootDialog.UserResponse, RootDialog.BotResponse);
            PromptDialog.Choice(context, this.RaiseIssue, new List <string>()
            {
                "Yes", "No"
            }, RootDialog.BotResponse);

            //await context.PostAsync("end flow");
        }
示例#3
0
        public async Task HardwareIssue(IDialogContext context, IAwaitable <string> result)
        {
            try

            {
                string optionSelected = await result;
                RootDialog.UserResponse = optionSelected;
                RootDialog.BotResponse  = SQLManager.GetITQuestions(3);
                await context.PostAsync(RootDialog.BotResponse);

                SQLManager.GetConversationData(UserData.UserID, RootDialog.UserResponse, RootDialog.BotResponse);

                context.Wait(IssueDescription);
            }

            catch (Exception e)

            {
                await context.PostAsync("enter a valid option");
            }
        }
示例#4
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");
            }
        }
示例#5
0
        public async Task RaiseIssue(IDialogContext context, IAwaitable <string> result)
        {
            RootDialog root = new RootDialog();

            try

            {
                string optionSelected = await result;
                RootDialog.UserResponse = optionSelected;
                switch (optionSelected)

                {
                case "Yes":
                    RootDialog.BotResponse = SQLManager.GetITQuestions(5);
                    await context.PostAsync(RootDialog.BotResponse);

                    SQLManager.GetConversationData(UserData.UserID, RootDialog.UserResponse, RootDialog.BotResponse);
                    root.StartAsync(context);


                    break;

                case "No":
                    root.StartAsync(context);

                    break;
                }
            }

            catch (Exception e)

            {
                SQLManager.StoreExceptionData(e.GetType().ToString(), e.Message, e.StackTrace, e.Data.ToString());
                // await context.PostAsync("enter a valid option");
            }
        }