Esempio n. 1
0
        private async void  Create()
        {
            UserDialogs.Instance.ShowLoading("Welcome");
            Nick     = string.Empty;
            Password = string.Empty;
            MainViewModels.GetInstance().Create = new CreateViewModel();
            await App.Current.MainPage.Navigation.PushAsync(new CreatePage(), true);

            UserDialogs.Instance.HideLoading();
        }
Esempio n. 2
0
        private async void Next()
        {
            UserDialogs.Instance.ShowLoading("Espere");
            var data = await ServiceWebApi.InsertUser(this.User);

            if (data == null)
            {
                UserDialogs.Instance.HideLoading();
                await App.Current.MainPage.DisplayAlert("Error", "Tu registro no fue aceptado", "Aceptar");

                this.User = null;
            }
            UserDialogs.Instance.HideLoading();
            await App.Current.MainPage.DisplayAlert("Bienvenido", $"Es momento de ingresar {data.Name}", "Aceptar");

            MainViewModels.GetInstance().Login = new LoginViewModel();
            this.User = null;
            await App.Current.MainPage.Navigation.PopToRootAsync();
        }
Esempio n. 3
0
        private async void Login()
        {
            UserDialogs.Instance.ShowLoading("Espere");
            if (string.IsNullOrEmpty(Nick))
            {
                Nick     = string.Empty;
                Password = string.Empty;
                await App.Current.MainPage.DisplayAlert("Error", "Debes completar los campos", "Aceptar");

                UserDialogs.Instance.HideLoading();
                return;
            }
            if (string.IsNullOrEmpty(Password))
            {
                Password = string.Empty;
                await App.Current.MainPage.DisplayAlert("Error", "Debes completar los campos", "Aceptar");

                UserDialogs.Instance.HideLoading();
                return;
            }

            App.User = await ServiceWebApi.GetUserByCredentials(Nick, Password);

            if (App.User != null)
            {
                Nick     = string.Empty;
                Password = string.Empty;
                MainViewModels.GetInstance().Home = new HomeViewModel();
                await App.Current.MainPage.Navigation.PushAsync(new HomePage(), true);

                UserDialogs.Instance.HideLoading();
            }
            else
            {
                Nick     = string.Empty;
                Password = string.Empty;
                UserDialogs.Instance.HideLoading();
                await App.Current.MainPage.DisplayAlert("Error", "Credenciales no válidas", "Aceptar");
            }
        }
Esempio n. 4
0
 private async void Back()
 {
     MainViewModels.GetInstance().Login = new LoginViewModel();
     await App.Current.MainPage.Navigation.PopAsync();
 }
Esempio n. 5
0
 private async void Next()
 {
     MainViewModels.GetInstance().Birth = new BirthdayViewModel(this.User);
     await App.Current.MainPage.Navigation.PushAsync(new BirthdayPage(), true);
 }
Esempio n. 6
0
 private async void Back()
 {
     MainViewModels.GetInstance().User = new UsuarioViewModel(this.User);
     await App.Current.MainPage.Navigation.PopAsync();
 }
Esempio n. 7
0
 private async void Next()
 {
     this.User.Birthday = Birthday.ToString("yyyy-MM-dd");
     MainViewModels.GetInstance().Movil = new MovilViewModel(this.User);
     await App.Current.MainPage.Navigation.PushAsync(new MovilPage(), true);
 }
Esempio n. 8
0
 private async void Next()
 {
     MainViewModels.GetInstance().User = new UsuarioViewModel(this.User);
     await App.Current.MainPage.Navigation.PushAsync(new UsuarioPage(), true);
 }
Esempio n. 9
0
 private async void Next()
 {
     MainViewModels.GetInstance().Pass = new PasswordViewModel(this.User);
     await App.Current.MainPage.Navigation.PushAsync(new PasswordPage(), true);
 }