async Task RegisterValidations(RegisterModel register) { if (!UserValidations.IsnotEmpty(register.UserName)) { Result = ErrorCodes.UserNameRequired; } else if (!UserValidations.IsnotEmpty(register.Password)) { Result = ErrorCodes.PasswordRequired; } else if (!UserValidations.IsEqual(register.Password, ConfirmPassword)) { Result = ErrorCodes.PassNoMatch; } else if (!UserValidations.IsnotEmpty(register.Email)) { Result = ErrorCodes.UserEmailRequired; } else if (!UserValidations.NumberIsNotEmpty(register.Number)) { Result = ErrorCodes.TelNumberRequired; } else { await ToHomePage(); } }
public ContactPageViewModel() { contact = new ContactModel(); SaveContactsCommand = new Command(async() => { if (UserValidations.NumberIsNotEmpty(contact.CelNumber)) { MessagingCenter.Send <ContactPageViewModel, ContactModel>(this, "SendContact", contact); await Application.Current.MainPage.Navigation.PopModalAsync(); } else { Result = "El Numero telefonico es requerido."; } }); }