예제 #1
0
        /// <summary>
        /// Gets the expertise of a user in a team.
        /// The expertise is calculated as the sum of the times you were part of
        /// a team which has that category.
        /// </summary>
        /// <returns>The expertise.</returns>
        /// <param name="categoryID">Category identifier.</param>
        private int GetExpertise(int categoryID)
        {
            //Prendo i team di cui l'utente ha fatto parte e li filtro per categoria
            var teams = TMS.GetTeams(UserID).FindAll((obj) => TCS.IsCategory(obj.Id, categoryID));

            return(teams.Count);
        }
예제 #2
0
        private void PrepareTeamsListView()
        {
            var teams = TMS.GetTeams(User.Id);

            TeamViewGroups = new List <TeamViewGroup>();
            for (int i = 1; i < CategoryService.GetMaxCategory(); i++)
            {
                var kat       = CategoryService.GetCategory(i);
                var teams4cat = teams.FindAll((obj) => TCS.IsCategory(obj.Id, i));
                //Aggiungo il gruppo solo se è presente almeno una squadra di quel gruppo
                if (teams4cat.Count > 0)
                {
                    TeamViewGroup tvg = new TeamViewGroup(kat, i.ToString());
                    foreach (Team team in teams4cat)
                    {
                        var tv = new TeamView(team, kat);
                        tvg.Add(tv);
                    }
                    TeamViewGroups.Add(tvg);
                }
            }
            TeamsLV.ItemsSource = TeamViewGroups;
        }