Exemplo n.º 1
0
        private async Task CheckForUserExistance(IDialogContext context, IAwaitable <object> result)
        {
            var activity = await result as Activity;

            Email = activity.Text;

            SqlOperations.GetStaticResponse(StateKeys.ProcForUserName, Email, "Email", "UserName");

            // validating Email
            Name = SqlOperations.Result;


            // If the User Existence
            if (SqlOperations.IsSuccess)
            {
                context.UserData.SetValue(StateKeys.UserEmail, Email);
                context.UserData.SetValue(StateKeys.UserName, Name);

                BotResponse = SqlOperations.GetResponseFromBot("ToFetchBotsReply", Intents.FootPrintsWiserIssueTicketing, MessageType.WiserWelcome);

                message = BotResponse.Replace("Name", Name);

                SqlOperations.ForConversationLog(activity.Text, message);
                await context.PostAsync(message);


                context.Wait(Luis.IdentifyUserQueryUsingLuis);
            }
            else
            {
                BotResponse = SqlOperations.GetResponseFromBot("ToFetchBotsReply", Intents.FootPrintsWiserIssueTicketing, "IncorrectEmail");

                await context.PostAsync(BotResponse);
            }
        }
Exemplo n.º 2
0
        private async Task MessageReceivedAsync(IDialogContext context, IAwaitable <string> result)
        {
            string activity = await result;

            if (activity == "Yes")
            {
                RootDialog.BotResponse = SqlOperations.GetResponseFromBot("ToFetchBotsReply", Intents.FootPrintsWiserIssueTicketing, "AskingForFaultOrChange");
                SqlOperations.ForConversationLog(activity, RootDialog.BotResponse);

                PromptDialog.Choice(context, FaultOrChange, new List <string>()
                {
                    "Fault", "Change"
                }, RootDialog.BotResponse, " Please select the given option ", 3);
            }

            else if (activity == "No")
            {
                RootDialog.BotResponse = SqlOperations.GetResponseFromBot("ToFetchBotsReply", Intents.FootPrintsWiserIssueTicketing, "AskingForProblem");
                SqlOperations.ForConversationLog(activity, RootDialog.BotResponse);

                await context.PostAsync(RootDialog.BotResponse);

                context.Wait(Proceed);
            }
        }
Exemplo n.º 3
0
        private async Task WiserChangeForm(IDialogContext context)
        {
            RootDialog.BotResponse = SqlOperations.GetResponseFromBot("ToFetchBotsReply", Intents.FootPrintsWiserIssueTicketing, "EndOfWiser");

            SqlOperations.ForConversationLog(UserInput, RootDialog.BotResponse);

            await context.PostAsync(RootDialog.BotResponse);

            await rootDialog.StartAsync(context);
        }
Exemplo n.º 4
0
        internal async Task RiseTicketForFault(IDialogContext context, IAwaitable <object> result)
        {
            RootDialog.BotResponse = SqlOperations.GetResponseFromBot("ToFetchBotsReply", Intents.FootPrintsWiserIssueTicketing, "EndForFault");

            await context.PostAsync(RootDialog.BotResponse);

            Email.SendEmail(RootDialog.Email);

            SqlOperations.ForConversationLog(RootDialog.BotResponse, "Email has been sent");

            context.Wait(Luis.IdentifyUserQueryUsingLuis);
        }
Exemplo n.º 5
0
 private async Task Proceed(IDialogContext context, IAwaitable <object> result)
 {
     if (UserRequest == "Change")
     {
         context.ConversationData.TryGetValue(StateKeys.PinAndName, out string message);
         RootDialog.BotResponse = SqlOperations.GetResponseFromBot("ToFetchBotsReply", Intents.FootPrintsWiserIssueTicketing, "AskingToProceed");
         SqlOperations.ForConversationLog(message, RootDialog.BotResponse);
     }
     PromptDialog.Choice(context, EndOfFlow, new List <string>()
     {
         "Yes", "No"
     }, RootDialog.BotResponse, "Please select from given Options");
 }
Exemplo n.º 6
0
        internal async Task RiseTicketForFault(IDialogContext context, IAwaitable <object> result)
        {
            //context.ConversationData.TryGetValue(StateKeys.AdditionalInfo, out string message);

            RootDialog.BotResponse = SqlOperations.GetResponseFromBot("ToFetchBotsReply", Intents.FootPrintsWiserIssueTicketing, "EndForFault");

            //SqlOperations.ForConversationLog(message, RootDialog.BotResponse);

            await context.PostAsync(RootDialog.BotResponse);

            Email.SendEmail(RootDialog.Email);

            context.Wait(Luis.IdentifyUserQueryUsingLuis);
        }
Exemplo n.º 7
0
        public async Task StartAsync(IDialogContext context)
        {
            string Name;

            context.UserData.TryGetValue(StateKeys.UserName, out Name);

            RootDialog.BotResponse = SqlOperations.GetResponseFromBot("ToFetchBotsReply", Intents.FootPrintsWiserIssueTicketing, "CheckForWiserLogin");
            message = RootDialog.BotResponse.Replace("Name", Name);

            SqlOperations.ForConversationLog(RootDialog.message, message);


            PromptDialog.Choice(context, MessageReceivedAsync, new List <string>()
            {
                "Yes", "No"
            }, message, " Please select the given option ", 3);
        }
Exemplo n.º 8
0
        public async Task StartAsync(IDialogContext context)
        {
            // Checking if the user has given his name before
            if (context.UserData.TryGetValue(StateKeys.UserName, out Name))
            {
                context.Wait(Luis.IdentifyUserQueryUsingLuis);
            }

            else
            {
                //If Its First Time
                BotResponse = SqlOperations.GetResponseFromBot("ToFetchBotsReply", Intents.FootPrintsWiserIssueTicketing, "AskForEmail");

                await context.PostAsync(BotResponse);

                context.Wait(MessageReceivedAsync);
            }
        }
Exemplo n.º 9
0
        public async Task AskForPinAndName(IDialogContext context, IAwaitable <object> result)
        {
            string PinAndName;

            if (!context.ConversationData.TryGetValue(StateKeys.PinAndName, out PinAndName))
            {
                //if (UserRequest == "Fault")
                //{
                //   // RootDialog.BotResponse = SqlOperations.GetResponseFromBot("ToFetchBotsReply", Intents.FootPrintsWiserIssueTicketing, "FaultQuestion1");
                //    //SqlOperations.ForConversationLog(UserRequest, RootDialog.BotResponse);
                //}
                //else
                {
                    //context.EndConversation("200");
                    context.ConversationData.TryGetValue(StateKeys.ChangeRequest, out message);
                    RootDialog.BotResponse = SqlOperations.GetResponseFromBot("ToFetchBotsReply", Intents.FootPrintsWiserIssueTicketing, "FaultQuestion1");
                    SqlOperations.ForConversationLog(message, RootDialog.BotResponse);
                }
                await context.PostAsync(RootDialog.BotResponse);

                context.Wait(CapturePinAndRegistrant);
            }
        }