Exemplo n.º 1
0
        private async void signin_toolbar_Clicked(object sender, EventArgs e)
        {
            if (!CheckNetwork.Check_Connectivity())
            {
                return;
            }

            //folder = FileSystem.Current.LocalStorage;
            //ExistenceCheckResult Resultfolder = await folder.CheckExistsAsync("folderAccount");
            //if (Resultfolder != ExistenceCheckResult.FolderExists)
            //{
            //    DependencyService.Get<SnackBar>().ShowSnackBar("Don't Have Any Account");
            //    return;
            //}
            //folder = await folder.CreateFolderAsync("folderAccount", CreationCollisionOption.OpenIfExists);
            //file = await folder.CreateFileAsync("fileAccount", CreationCollisionOption.OpenIfExists);

            //string Accounts = await file.ReadAllTextAsync();
            //if (Accounts == "")
            //{
            //    DependencyService.Get<SnackBar>().ShowSnackBar("Don't Have Any Account");
            //    return;
            //}
            //await Navigation.PushAsync(new SignIn());


            RegistersServices R_S           = new RegistersServices();
            List <User>       listregisters = await R_S.GetRegistersAsync();

            if (listregisters == null)
            {
                DependencyService.Get <SnackBar>().ShowSnackBar(Lang.Resource.NotFoundAccounts);
                return;
            }

            //folder = FileSystem.Current.LocalStorage;
            //ExistenceCheckResult Resultfolder = await folder.CheckExistsAsync("folderAccount");
            //if (Resultfolder != ExistenceCheckResult.FolderExists)
            //{
            //    DependencyService.Get<SnackBar>().ShowSnackBar("Don't Have Any Account");
            //    return;
            //}
            //folder = await folder.CreateFolderAsync("folderAccount", CreationCollisionOption.OpenIfExists);
            //file = await folder.CreateFileAsync("fileAccount", CreationCollisionOption.OpenIfExists);


            await Navigation.PushAsync(new SignIn());
        }
Exemplo n.º 2
0
        private async void SignIn_clicked(object sender, EventArgs e)
        {
            if (!CheckNetwork.Check_Connectivity())
            {
                return;
            }

            RegistersServices R_S           = new RegistersServices();
            List <User>       listregisters = await R_S.GetRegistersAsync();

            if (listregisters == null || listregisters.Count == 0)
            {
                DependencyService.Get <SnackBar>().ShowSnackBar("Don't Have Any Account");
                return;
            }
            await Navigation.PushAsync(new SignIn());
        }
Exemplo n.º 3
0
        private async void GetUsers()
        {
            Users = await R_S.GetRegistersAsync();

            folder = FileSystem.Current.LocalStorage;
            folder = await folder.CreateFolderAsync("folderUser", CreationCollisionOption.OpenIfExists);

            file = await folder.CreateFileAsync("fileUser", CreationCollisionOption.OpenIfExists);

            string AccountUser = await file.ReadAllTextAsync();

            User register = Serializable_Account.deserialize(AccountUser).ElementAt(0);

            Users = Users.Where(user => user.Email != register.Email).ToList();

            ListUsers.ItemsSource = Users;
            await Task.Delay(400);

            ActivityIndicator.IsRunning = false;
            contentpage.IsVisible       = true;
        }