public Create() { InitializeComponent (); using (var dados = new AcessoDados ()) { this.lista.ItemsSource = dados.Listar (); } }
protected void CreateClick(object sender, EventArgs e) { var user1 = new User { Name = this.user.Text, Password = this.password.Text }; using (var dados = new AcessoDados ()) { dados.Insert(user1); DisplayAlert("Login","Novo usuário registrado com sucesso","ok"); Navigation.PopAsync (); } }
protected void LoginClick(object sender, EventArgs e) { using (var dados = new AcessoDados ()) { User _user = dados.GetUser (this.user.Text); if (this.user.Text == "" || this.password.Text == "") { DisplayAlert("Login","Usuário e/ou senha incorretos","ok"); }else if (_user.Name == this.user.Text && _user.Password == this.password.Text) { //DisplayAlert("Login","Sim","ok"); Navigation.PushAsync (new Loggedin ()); }else{ DisplayAlert("Login","Usuário e/ou senha incorretos","ok"); } } }