Example #1
0
        /// <summary>
        /// Fetch user details. If new user details meets requirements, register new user.
        /// </summary>
        /// <param name="sender">Object that sends the event</param>
        /// <param name="e">The event</param>
        private async void ConfirmBtnClicked(object sender, RoutedEventArgs e)
        {
            SetInputStrings();
            statusMessage.Text = "";
            if (InputUserName == string.Empty || InputFirstName == string.Empty || InputLastName == string.Empty || InputPassword == string.Empty || InputRePassword == string.Empty)
            {
                statusMessage.Text = "Please fill out all fields.";
                return;
            }
            else if (!InputUserName.All(Char.IsLetterOrDigit))
            {
                statusMessage.Text = "Username can only contain letters and numbers.";
                return;
            }
            else if (!InputFirstName.All(Char.IsLetter))
            {
                statusMessage.Text = "Your name can only contain letters.";
                return;
            }
            else if (!InputLastName.All(Char.IsLetter))
            {
                statusMessage.Text = "Your name can only contain letters.";
                return;
            }

            if (InputPassword != InputRePassword)
            {
                Console.Write("Password doesnt match");
                Console.ReadLine();
                statusMessage.Text = "Password does not match. Please re-enter your password";
                return;
            }
            await CheckUserNameAvailability();
        }
 public RegisterPage()
 {
     InitializeComponent();
     InputTicketCode.ReturnCommand   = new Command(() => InputFirstName.Focus());
     InputFirstName.ReturnCommand    = new Command(() => InputSurname.Focus());
     InputOtherRemarks.ReturnCommand = new Command(() => InputEmail.Focus());
     InputEmail.ReturnCommand        = new Command(() => InputPassword.Focus());
     InputPassword.ReturnCommand     = new Command(() => InputConfirmPassword.Focus());
 }
        public void FillUserForm(string initial, string middleName, string firstName)
        {
            InputInitial.EnterText(initial);
            InputFirstName.EnterText(firstName);
            InputMiddleName.EnterText(middleName);
            btnSave.Clicks();

            /*
             * SeleniumSetMethods.EnterText(InputInitial, initial);
             * SeleniumSetMethods.EnterText(InputFirstName, firstName);
             * SeleniumSetMethods.EnterText(InputMiddleName, middleName);
             * SeleniumSetMethods.Click(btnSave);
             *
             * /
             * /*
             * InputInitial.SendKeys(initial);
             * InputFirstName.SendKeys(firstName);
             * InputMiddleName.SendKeys(middleName);
             *
             * btnSave.Click();
             */
        }
 //set FirstName
 void FirstName(string firstName)
 {
     InputFirstName.Clear();
     Thread.Sleep(500);
     InputFirstName.SendKeys(firstName);
 }
Example #5
0
 //set FirstName
 void FirstName(string firstName)
 {
     InputFirstName.Clear();
     InputFirstName.SendKeys(firstName);
 }