Exemplo n.º 1
0
        private async void bestSkillsReportBtn_Click(object sender, EventArgs e)
        {
            try
            {
                telemetry.TrackEvent("Skill Stats: showing best skills");

                ThrowIfNoServerGroup();

                bestSkillsReportBtn.Enabled = false;
                var queryParams = BuildQueryParams();
                queryParams.QueryKind = QueryKind.BestSkill;

                var reportItems = await GetSkillLevelsAsync(queryParams);

                reportItems =
                    reportItems.GroupBy(item => item.Name)
                    .Select(items => items.OrderByDescending(item => item.CurrentValue).First())
                    .ToList();

                var view = new SkillLevelsForm(queryParams, reportItems);
                view.ShowCenteredOnForm(this);
            }
            catch (Exception exception)
            {
                ShowError(exception);
                logger.Error(exception, "Best skills query build failed");
            }
            finally
            {
                bestSkillsReportBtn.Enabled = true;
            }
        }
Exemplo n.º 2
0
        private async void totalSkillReportBtn_Click(object sender, EventArgs e)
        {
            try
            {
                telemetry.TrackEvent("Skill Stats: showing total skills");

                ThrowIfNoServerGroup();

                totalSkillReportBtn.Enabled = false;
                var queryParams = BuildQueryParams();
                queryParams.QueryKind = QueryKind.TotalSkills;

                var reportItems = await GetSkillLevelsAsync(queryParams);

                var view = new SkillLevelsForm(queryParams, reportItems);
                view.ShowCenteredOnForm(this);
            }
            catch (Exception exception)
            {
                ShowError(exception);
                logger.Error(exception, "Total skills query build failed");
            }
            finally
            {
                totalSkillReportBtn.Enabled = true;
            }
        }