protected async override void OnAppearing() { base.OnAppearing(); ErrorLabel_Ime.IsVisible = false; ErrorLabel_Prezime.IsVisible = false; ErrorLabel_KorisnickoIme.IsVisible = false; ErrorLabel_Email.IsVisible = false; ErrorLabel_Datum.IsVisible = false; ErrorLabel_Lozinka.IsVisible = false; ErrorLabel_LozinkaProvjera.IsVisible = false; await registracija.Init(); }
private async void Button_Registrujse(object sender, EventArgs e) { if (!Regex.IsMatch(this.Ime.Text, @"^[a-zA-Z]+$")) { await Application.Current.MainPage.DisplayAlert(" ", "Ime se sastoji od samo slova", "OK"); } else if (!Regex.IsMatch(this.Prezime.Text, @"^[a-zA-Z]+$")) { await Application.Current.MainPage.DisplayAlert(" ", "Prezime se sastoji od samo slova", "OK"); } else if (!Regex.IsMatch(this.Email.Text, @"^[a-zA-Z.]+@[a-z]+(?:.[a-z]+).[a-z]+$")) { await Application.Current.MainPage.DisplayAlert(" ", "Email nije ispravnog formata", "OK"); } else if (model.Slika.SequenceEqual(new byte[0])) { await Application.Current.MainPage.DisplayAlert(" ", "Morate unjeti sliku", "OK"); } else if (!Regex.IsMatch(this.KorinsickoIme.Text, @"^[a-z]+$")) { await Application.Current.MainPage.DisplayAlert(" ", "Korisnicko ime se sastoji samo od malih slova", "OK"); } else if (string.IsNullOrWhiteSpace(this.Lozinka.Text)) { await Application.Current.MainPage.DisplayAlert(" ", "Morate unjeti lozinku", "OK"); } else if (this.Lozinka.Text != this.PotvrdiLozinku.Text) { await Application.Current.MainPage.DisplayAlert(" ", "Lozinke se moraju podudarati", "OK"); } else if (this.Lozinka.Text.Length < 4) { await Application.Current.MainPage.DisplayAlert(" ", "Lozinke ne smije biti manja od 4 karaktera", "OK"); } else if (await model.ProvjeriKorisnickoIme(this.KorinsickoIme.Text)) { await Application.Current.MainPage.DisplayAlert(" ", "Korisničko ime nije dozvoljeno", "OK"); } else { await model.Init(); } }
protected async override void OnAppearing() { base.OnAppearing(); await model.Init(); }