예제 #1
0
        public void CarregarMenu()
        {
            var collection = _service.ItensMenu();

            if (ItensMenu.Count > 0)
            {
                ItensMenu.Clear();
            }

            foreach (var material in collection)
            {
                var users = Data.GetList <UserModel>(true);
                var user  = users.Where(a => a.Id == App.GetUser.Id).FirstOrDefault();

                var atived = user.CollectorItens.Where(a => a.IdItem == material.IdItem).FirstOrDefault();

                if (atived != null)
                {
                    ItensMenu.Add(atived);
                }
                else
                {
                    ItensMenu.Add(material);
                }
            }
        }
예제 #2
0
        public void CarregarMenu()
        {
            var collection = service.GetItensMenu();

            foreach (var item in collection)
            {
                ItensMenu.Add(item);
            }
        }
        public void CarregarHistorico()
        {
            var lista = _prontuarioService.GetAll();

            foreach (var item in lista)
            {
                item.DateTimeString = item.Data.ToString("dd/MM/yyyy");
                ItensHistorico.Add(item);
            }
        }
예제 #4
0
        private async Task InitialMessage()
        {
            await PopupNavigation.Instance.PushAsync(loading);

            var message1 = await _service.InitialsMessages1();

            Message.Add(message1);

            var message2 = await _service.InitialsMessages2();

            Message.Add(message2);

            var message3 = await _service.InitialsMessages3();

            Message.Add(message3);

            IsEntry = "true";

            await loading.Close();
        }
예제 #5
0
        protected override async void OnAppearing()
        {
            var favsList = await App.FavRepo.GetFavs();

            var test = favsList.Count;

            foreach (var fav in favsList)
            {
                favs.Add(fav);
            }
            favList.FlowItemsSource = favs;
        }
예제 #6
0
        public ListChallengeVM()
        {
            ListChallAcc  = new FlowObservableCollection <ChallengeInfo>();
            ListChallClub = new FlowObservableCollection <ChallengeInfo>();

            foreach (var item in ChallengeAction.ListAccRecive)
            {
                ListChallAcc.Add(item.Value);
            }
            foreach (var item in ChallengeAction.ListClubRecive)
            {
                ListChallClub.Add(item.Value);
            }
        }
예제 #7
0
        public async Task CarregarListaUsuarios()
        {
            var users = await _service.UsuariosProximos();


            foreach (var user in users)
            {
                if (user.IsCollector)
                {
                    user.CollectorItemsView.AddRange(user.CollectorItens);
                    Usuarios.Add(user);
                }
            }
        }
예제 #8
0
        protected override async void OnAppearing()
        {
            var filteredClubs = await manager.GetFilteredClubs(sportId);

            foreach (var c in filteredClubs)
            {
                if (flowClubs.All(x => x.id != c.id))
                {
                    flowClubs.Add(c);
                }
            }

            clubList.FlowItemsSource = flowClubs;
        }
예제 #9
0
        protected override async void OnAppearing()
        {
            var allSports = await manager.GetAllSports();

            foreach (var sport in allSports)
            {
                if (flowSports.All(x => x.id != sport.id))
                {
                    flowSports.Add(sport);
                }
            }

            carousel.ItemsSource = flowSports;
        }
예제 #10
0
        public async void refreshList()
        {
            var newFavsList = await App.FavRepo.GetFavs();

            FlowObservableCollection <Favourite> newFavs = new FlowObservableCollection <Favourite>();

            foreach (var fav in newFavsList)
            {
                if (newFavs.All(x => x.clubId != fav.clubId))
                {
                    newFavs.Add(fav);
                }
            }
            favList.FlowItemsSource = newFavs;
        }
예제 #11
0
        protected override async void OnAppearing()
        {
            t = await manager.GetTeam(teamId);

            foreach (var singleMatch in t.matches)
            {
                if (AllMatches.All(x => x.id != singleMatch.id))
                {
                    singleMatch.clubName = cTeam.clubName;
                    AllMatches.Add(singleMatch);
                }
            }

            flowListAllMatches.FlowItemsSource = AllMatches;
        }
예제 #12
0
        protected override async void OnAppearing()
        {
            cClub = await manager.GetClub(clubId, sportId);

            cTeams = cClub.clubTeams;

            foreach (var t in cTeams)
            {
                if (flowClubTeams.All(x => x.id != t.id))
                {
                    flowClubTeams.Add(t);
                }
            }
            BindingContext = cClub;
            flowAllTeams.FlowItemsSource = flowClubTeams;
        }
예제 #13
0
        public async void OnViewShown()
        {
            var teamsCollection = await manager.GetTeams(clubId);

            if (teamsCollection.Count != 0)
            {
                foreach (teams team in teamsCollection)
                {
                    if (flowTeams.All(t => t.name != team.name))
                    {
                        flowTeams.Add(team);
                    }
                }
                flowListTest.FlowItemsSource = flowTeams;
            }
        }
예제 #14
0
        protected override async void OnAppearing()
        {
            var singleTeam = await manager.GetTeam(teamId);

            foreach (var t in singleTeam.matches)
            {
                t.clubName  = clubName;
                t.clubImage = clubImage;
                if (flowSingleTeam.All(x => x.id != t.id))
                {
                    flowSingleTeam.Add(t);
                }
            }

            BindingContext = singleTeam;

            flowTeamMatches.FlowItemsSource = flowSingleTeam;
        }
예제 #15
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            InitializeComponent();
            Admin admin = await localStorage.GetAdminCredentials();

            switch (currentClub.clubSports[0])
            {
            case "Soccer":
                BackgroundImage = "FodboldBG.png";
                break;

            case "Handball":
                BackgroundImage = "HandballBG.png";
                break;

            case "Tennis":
                BackgroundImage = "TennisBG.png";
                break;

            case "Hockey":
                BackgroundImage = "HockeyBG.png";
                break;

            default:
                break;
            }

            ClubMatches.Clear();
            currentMatches.Clear();
            comingMatches.Clear();
            completedMatches.Clear();

            if (!CrossConnectivity.Current.IsConnected)
            {
                Debug.WriteLine($"No connection");
            }
            else
            {
                requestedClub = await apiMethods.GetClub("GetCLub", currentClub.clubId);
            }

            List <Team>    ClubTeams    = requestedClub.Teams;
            List <Sponsor> ClubSponsors = requestedClub.Sponsors;

            //add to teams list
            foreach (Team team in ClubTeams)
            {
                if (teams.All(b => b.teamId != team.teamId))
                {
                    teams.Add(team);
                }

                foreach (Match match in team.teamMatches)
                {
                    ClubMatches.Add(match);

                    if (match.status == "Current")
                    {
                        match.buttonColor = "#F8144E";
                        match.buttonText  = "VÆLG";
                        currentMatches.Add(match);
                    }
                    else if (match.status == "Coming")
                    {
                        match.buttonColor = "#F8144E";
                        match.buttonText  = "VÆLG";
                        comingMatches.Add(match);
                    }
                    else if (match.status == "Finished")
                    {
                        match.buttonColor = "#FF7F00";
                        match.buttonText  = "VÆLG";
                        completedMatches.Add(match);
                    }
                }
            }

            // add to sponsor list
            foreach (Sponsor sponsor in ClubSponsors)
            {
                if (sponsors.All(b => b.sponsorId != sponsor.sponsorId))
                {
                    sponsors.Add(sponsor);
                }
            }

            BindingContext = teams;
            //clubTeamList.FlowItemsSource = teams;
            gameList.ItemsSource    = currentMatches;
            sponsorList.ItemsSource = sponsors;

            Title                       = admin.UserFriendlyName;
            coming.TextColor            = Color.FromHsla(255, 255, 255, 0.6);
            completed.TextColor         = Color.FromHsla(255, 255, 255, 0.6);
            sponsorList.BackgroundColor = Color.FromHsla(255, 255, 255, 0.6);
        }