private void Entrar() { var user = new User(); user.Username = Username; user.Password = Password; var loggeduser = ServiceWS.GetUser(user); if (loggeduser == null) { //(Page) ((Page)App.Current.MainPage).DisplayAlert("Erro", "Acesso negado.", "OK"); } else { //((Page)App.Current.MainPage).DisplayAlert("Aceito", loggeduser.Login, "OK"); UserUtil.SetUserLogged(loggeduser); App.Current.MainPage = new NavigationPage(new View.PrincipalPage()) { BarBackgroundColor = Color.FromHex("#C032") }; } /*if(loggeduser == "") * { * //UserUtil.SetUserLogged(loggeduser); * * ((Page)App.Current.MainPage).DisplayAlert("Erro", "Failed", "OK"); * }*/ }
public void Handle_Clicked(object sender, System.EventArgs e) { status.Text = CrossConnectivity.Current.IsConnected ? null : "Sem acesso a internet!"; if (status.Text != null) { return; } var _user = ServiceWS.GetUser(user.Text, senha.Text); if (_user != null) { PopupNavigation.Instance.PopAsync(); Navigation.PushAsync(new HomePage()); } else { status.Text = "Usuario ou senha invalido!"; } }
private void Access() { User user = new User { nome = Name, password = Password }; var userLogged = ServiceWS.GetUser(user); if (userLogged == null) { MessageError = "Password incorrect"; } else { UserUtil.SetLoggedUser(userLogged); //App.Current.Properties["LOGIN"] = JsonConvert.SerializeObject(userLogged); App.Current.MainPage = new NavigationPage(new ChatPage()) { BarBackgroundColor = Color.LightGreen, BarTextColor = Color.White }; } }