예제 #1
0
        private void ConfirmPayment(object sender, RoutedEventArgs e)
        {
            List <String> fields = new List <String>();

            fields.Add(NumCreditCard_TextBox.Text);
            fields.Add(CCVCreditCard_TextBox.Text);

            if (InputChecker.AreAllFieldsComplete(fields))
            {
                ProcessingOrder.PaymentConfirmed();
                DialogBox.Ok("Success", "Great business with you, master chief");
            }
            else
            {
                DialogBox.Ok("Error", "Correctly fill the fields so i can buy a new bike.");
            }
        }
예제 #2
0
        private bool AreAllFieldsComplete()
        {
            List <String> fields = new List <string>();

            fields.Add(Name_TxtBox.Text);
            fields.Add(FirstName_TxtBox.Text);
            fields.Add(Mail_TxtBox.Text);
            fields.Add(Telephone_TxtBox.Text);
            fields.Add(Text_TxtBox.Text);
            if (InputChecker.AreAllFieldsComplete(fields))
            {
                return(true);
            }
            else
            {
                DialogBox.Ok("Error", "Please, fill all the fields");
                return(false);
            }
        }
예제 #3
0
        private bool AreUserFieldsOk()
        {
            bool isLoginComplete    = InputChecker.IsLoginOK(Login_TxtBox.Text);
            bool isPasswordComplete = InputChecker.IsPasswordOk(Password_Box.Password);
            bool isBirthdayOk       = InputChecker.IsBirthdayOk(Birthday_DatePicker.SelectedDate);
            bool isStreetNumOk      = InputChecker.IsStringOk(StreetNumber_TxtBox.Text);
            bool isStreetNameOk     = InputChecker.IsStringOk(StreetName_TxtBox.Text);
            bool isCityNameOk       = InputChecker.IsStringOk(CityName_TxtBox.Text);
            bool isPostalCodeOk     = InputChecker.IsPostalCodeOk(PostalCode_TxtBox.Text);

            if (isLoginComplete && isPasswordComplete && isBirthdayOk && isStreetNumOk &&
                isStreetNameOk && isCityNameOk && isPostalCodeOk)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #4
0
 private void OnlyNumbersPreview(object sender, TextCompositionEventArgs e)
 {
     InputChecker.OnlyNumbersPreview(sender, e);
 }