Beispiel #1
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;
        }
Beispiel #2
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;
        }
Beispiel #3
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;
        }
Beispiel #4
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;
        }
Beispiel #5
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;
        }
Beispiel #6
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;
            }
        }
Beispiel #7
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;
        }
Beispiel #8
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);
        }