Ejemplo n.º 1
0
        public async Task Validation(IDialogContext context, IAwaitable <object> result)
        {
            for (int i = 0; i < ListOfAnswer.Count; i++)
            {
                if (ListOfAnswer[i].Count() <= 0)
                {
                    ListOfUnAnsweredQuestion.Add(ListOfQusetions[i + 1]);
                }
            }

            if (ListOfUnAnsweredQuestion.Count > 0)
            {
                await context.PostAsync("these are * required");

                await context.PostAsync(ListOfUnAnsweredQuestion[index]);

                index++;
                context.Wait(InCaseOfValidation);
            }
            else
            {
                WiserRootDialog wiserRootDialog = new WiserRootDialog();
                await wiserRootDialog.RiseTicketForFault(context, result);
            }
        }
Ejemplo n.º 2
0
        private async Task CaptureChangeRequest(IDialogContext context, IAwaitable <string> result)
        {
            string Input = await result;;

            context.ConversationData.SetValue(StateKeys.ChangeRequest, Input);
            WiserRootDialog wiserRootDialog = new WiserRootDialog();
            await wiserRootDialog.AskForPinAndName(context, result);
        }
Ejemplo n.º 3
0
        internal async Task InCaseOfValidation(IDialogContext context, IAwaitable <object> result)
        {
            var Input = await result as Activity;

            if (String.IsNullOrEmpty(PinAndFullName))
            {
                PinAndFullName = Input.Text;

                SqlOperations.ForConversationLog("these are * required", ListOfQusetions[1]);

                await context.PostAsync(ListOfUnAnsweredQuestion[index]);

                index++;
                context.Wait(InCaseOfValidation);
            }

            else if (String.IsNullOrEmpty(TaskAttemptedWhileIssue))
            {
                TaskAttemptedWhileIssue = Input.Text;

                SqlOperations.ForConversationLog(PinAndFullName, ListOfQusetions[2]);

                await context.PostAsync(ListOfUnAnsweredQuestion[index]);

                index++;

                context.Wait(InCaseOfValidation);
            }
            else if (String.IsNullOrEmpty(DisplayedErrorMessage))
            {
                DisplayedErrorMessage = Input.Text;

                SqlOperations.ForConversationLog(DisplayedErrorMessage, ListOfQusetions[3]);

                await context.PostAsync(ListOfUnAnsweredQuestion[index]);

                index++;
                context.Wait(InCaseOfValidation);
            }

            else if (String.IsNullOrEmpty(NosOfUserImpacted))
            {
                NosOfUserImpacted = Input.Text;

                SqlOperations.ForConversationLog(NosOfUserImpacted, ListOfQusetions[4]);
                WiserRootDialog.UserIncomplete = true;
                WiserRootDialog wiserRootDialog = new WiserRootDialog();
                await wiserRootDialog.RiseTicketForFault(context, result);
            }
        }