예제 #1
0
        private async Task AfterDateOfBirthEntered(IDialogContext context, IAwaitable <DateTime> result)
        {
            try
            {
                var dateOfBirth = await result;

                if (dateOfBirth != DateTime.MinValue)
                {
                    await context.PostAsync($"The date of birth you provided is: {dateOfBirth.ToShortDateString()}");

                    // Add your custom reset password logic here.
                    var promptEmailDialog = new PromptStringRegex(
                        "Please enter your EmailID ([email protected]):",
                        EmailRegPattern,
                        "The value entered is not EmailID. Please try again using the following format ([email protected]):",
                        "You have tried to enter your EmailID many times. Please try again later.",
                        attempts: 2);
                    context.Call(promptEmailDialog, this.AfterEmailEntered);
                }
                else
                {
                    context.Done(false);
                }
            }
            catch (TooManyAttemptsException)
            {
                context.Done(false);
            }
        }
예제 #2
0
        public async Task StartAsync(IDialogContext context)
        {
            var promptPhoneDialog = new PromptStringRegex(
                "Please enter your phone number:",
                PhoneRegexPattern,
                "The value entered is not phone number. Please try again using the following format (xyz) xyz-wxyz:",
                "You have tried to enter your phone number many times. Please try again later.",
                attempts: 2);

            context.Call(promptPhoneDialog, this.ResumeAfterPhoneEntered);
        }