Example #1
0
        private void ForceValidation()
        {
            if (NoNIPCheckBox.IsChecked == false)
            {
                NIPTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateSource();
            }

            if (NoREGONCheckBox.IsChecked == false)
            {
                REGONTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateSource();
            }

            if (NoBankAccountCheckBox.IsChecked == false)
            {
                BankAccountNumberTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateSource();
            }

            CustomerNameTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateSource();
            CityTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateSource();
            ZipCodeTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateSource();
            FlatNumberTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateSource();
            StreetNumberTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateSource();
            StreetTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateSource();
            PhoneNumberTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateSource();
        }
Example #2
0
        /// <summary>
        /// Shows the message.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="controlName">Name of the control.</param>
        public void ShowMessage(string message, ControlNames controlName)
        {
            if (!string.IsNullOrEmpty(message))
            {
                ErrorMessageTextBlock.Text       = message;
                ErrorMessageTextBlock.Visibility = Visibility.Visible;
                switch (controlName)
                {
                case ControlNames.ConfirmPassword:
                {
                    ConfirmPasswordBox.DelayedFocus();
                    break;
                }

                case ControlNames.Password:
                {
                    PasswordBox.DelayedFocus();
                    break;
                }

                case ControlNames.ZipCode:
                {
                    ZipCodeTextBox.DelayedFocus();
                    break;
                }

                case ControlNames.LastName:
                {
                    LastNameTextBox.DelayedFocus();
                    break;
                }

                case ControlNames.FirstName:
                {
                    FirstNameTextBox.DelayedFocus();
                    break;
                }

                case ControlNames.Email:
                {
                    EmailTextBox.DelayedFocus();
                    break;
                }

                case ControlNames.GetEmail:
                {
                    GetEmailCheckBox.DelayedFocus();
                    break;
                }
                }
            }
            else
            {
                ErrorMessageTextBlock.Visibility = Visibility.Collapsed;
            }
        }
Example #3
0
 /// <summary>
 /// Clears this instance.
 /// </summary>
 public void Clear()
 {
     ErrorMessageTextBlock.Visibility = Visibility.Collapsed;
     FirstNameTextBox.Clear();
     LastNameTextBox.Clear();
     EmailTextBox.Clear();
     PasswordBox.Clear();
     ConfirmPasswordBox.Clear();
     ZipCodeTextBox.Clear();
 }
        /// <summary>
        /// Handles the Click event of the NoButton control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param>
        private void NoButton_Click(object sender, RoutedEventArgs e)
        {
            FirstNameTextBox.Clear();
            LastNameTextBox.Clear();
            EmailTextBox.Clear();
            PasswordBox.Clear();
            ConfirmPasswordBox.Clear();
            ZipCodeTextBox.Clear();
            GetEmailCheckBox.IsChecked = null;

            this.NavigationService.GoBack();
        }
Example #5
0
        /// <summary>
        /// Handles the OnTextButtonClicked event of the ZipcodeNumericKeyboard control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="TextButtonClickedEventArgs" /> instance containing the event data.</param>
        protected void ZipcodeNumericKeyboard_OnTextButtonClicked(object sender, TextButtonClickedEventArgs e)
        {
            if (e.Character == "Del")
            {
                ZipCodeTextBox.Text = string.Empty;
            }
            else
            {
                SendInput(ZipCodeTextBox, e.Character);
            }

            ZipCodeTextBox.Focus();
        }
Example #6
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            if (FirstNameTextBox.Text == "" || LastNameTextBox.Text == "" || EmailTextBox.Text == "" || CityTextBox.Text == "" || StreetNameTextBox.Text == "" || ZipCodeTextBox.Text == "")
            {
                WarningLabel.DissapearAfterSeconds(2);
                FirstNameTextBox.FlickerIfEmpty();
                LastNameTextBox.FlickerIfEmpty();
                EmailTextBox.FlickerIfEmpty();
                CityTextBox.FlickerIfEmpty();
                StreetNameTextBox.FlickerIfEmpty();
                ZipCodeTextBox.FlickerIfEmpty();
            }
            else
            {
                //DAL.Instance.CreatePlace(NameTextBox.Text, LuxeCheckBox.Checked, DescriptionTextBox.Text, image);
                //Place place = (Place)PlacesComboBox.SelectedItem;
                if (FirstNameTextBox.Text != customer.FirstName)
                {
                    customer.FirstName = FirstNameTextBox.Text;
                }
                if (LastNameTextBox.Text != customer.LastName)
                {
                    customer.LastName = LastNameTextBox.Text;
                }
                if (EmailTextBox.Text != customer.Email)
                {
                    customer.Email = EmailTextBox.Text;
                }
                if (CityTextBox.Text != customer.City)
                {
                    customer.City = CityTextBox.Text;
                }
                if (StreetNameTextBox.Text != customer.Street)
                {
                    customer.Street = StreetNameTextBox.Text;
                }
                if (ZipCodeTextBox.Text != customer.ZipCode)
                {
                    customer.ZipCode = ZipCodeTextBox.Text;
                }
                if (DateOfBirthPicker.Value != customer.DateOfBirth)
                {
                    customer.DateOfBirth = DateOfBirthPicker.Value;
                }


                this.Close();
            }
        }
Example #7
0
        /// <summary>
        /// Handles the OnTextButtonClicked event of the ZipcodeNumericKeyboard control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="KeyBoard.TextButtonClickedEventArgs" /> instance containing the event data.</param>
        protected void ZipcodeNumericKeyboard_OnTextButtonClicked(object sender, KeyBoard.TextButtonClickedEventArgs e)
        {
            if (e.Character == "BACKSPACE")
            {
                if (ZipCodeTextBox.Text.Length > 0)
                {
                    ZipCodeTextBox.Text = ZipCodeTextBox.Text.Substring(0, ZipCodeTextBox.Text.Length - 1);
                    ZipCodeTextBox.Select(ZipCodeTextBox.Text.Length, 0);
                }
            }
            else
            {
                UIHelper.SendInput(ZipCodeTextBox, e.Character);
            }

            ZipCodeTextBox.Focus();
        }
Example #8
0
        public void FillRegisterForm(User user, string takeaction = "save")
        {
            FirstNameTextBox.SendKeys(user.FirstName);
            LastNameTextBox.SendKeys(user.LastName);
            PasswordTextBox.SendKeys(user.Password);
            AliasAddressTextBox.SendKeys(user.AliasAddress);
            AddressTextBox.SendKeys(user.Address);
            CityTextBox.SendKeys(user.City);
            ZipCodeTextBox.SendKeys(user.ZipCode);
            CountryDropdown.SelectByText(user.Country);
            StateDropdown.SelectByText(user.State);
            MobilePhoneTextBox.SendKeys(user.MobilePhone);
            SelectDateOfBirth(user.DateOfBirth);

            if (takeaction == "save")
            {
                RegisterButton.Click();
            }
        }
Example #9
0
 /// <summary>
 /// Handles the Loaded event of the Page control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="RoutedEventArgs" /> instance containing the event data.</param>
 private void Page_Loaded(object sender, RoutedEventArgs e)
 {
     ZipCodeTextBox.Focus();
 }
Example #10
0
 /// <summary>
 /// Loads this instance.
 /// </summary>
 /// <param name="zipCode">The zip code.</param>
 public void Load(string zipCode)
 {
     ZipCodeTextBox.Text = zipCode;
     ClearMessage();
     ZipCodeTextBox.DelayedFocus();
 }