Beispiel #1
0
    private static void jsonOverview(string GameGUId, int startDate, int endDate)
    {
        structCount _structCount     = new structCount();
        DataSet     _OverviewDataset = sqlAudienceOverview(GameGUId, startDate, endDate);

        // Total and Unique Users
        _structCount.c1 = Convert.ToInt32(_OverviewDataset.Tables[0].Rows[0]["TotalUsers"] ?? 0);
        TotalUsers      = _structCount.c1;
        _structCount.c2 = Convert.ToInt32(_OverviewDataset.Tables[0].Rows[0]["UniqueUsers"] ?? 0);
        _classJSON.metrics.Add("Total", _structCount);

        // Total List
        _classJSON.metrics.Add("TotalUsers", AudienceTotalUsers(_OverviewDataset.Tables[1]));
        // Country
        _classJSON.metrics.Add("Country", AudienceCountry(_OverviewDataset.Tables[2]));
        // City
        _classJSON.metrics.Add("City", AudienceCity(_OverviewDataset.Tables[3]));
        // WebRef
        _classJSON.metrics.Add("WebRefer", AudienceWebRef(_OverviewDataset.Tables[4]));
        // First Seen Date
        _classJSON.metrics.Add("Seen", AudienceFirstSeenDate(_OverviewDataset.Tables[5]));
        // Site Played
        _classJSON.metrics.Add("SitePlayed", AudienceSitePlayed(_OverviewDataset.Tables[6]));
        // Average Time Played
        _classJSON.metrics.Add("AvgTimePlayed", AudienceAvgTimePlayed(_OverviewDataset.Tables[7]));
        // Bounce
        _classJSON.metrics.Add("Bounce", AudienceBounce(_OverviewDataset.Tables[8]));
    }
Beispiel #2
0
    private static void jsonTotalUsersWithOS(string GameGUId, int startDate, int endDate, string os)
    {
        structCount _structCount     = new structCount();
        DataSet     _OverviewDataset = sqlTechnologyTotalWithOS(GameGUId, startDate, endDate, os);

        // Total and Unique Users
        _structCount.c1 = Convert.ToInt32(_OverviewDataset.Tables[0].Rows[0]["TotalUsers"] ?? 0);
        TotalUsers      = _structCount.c1;
        _structCount.c2 = Convert.ToInt32(_OverviewDataset.Tables[0].Rows[0]["UniqueUsers"] ?? 0);
        _classJSON.metrics.Add("Total", _structCount);
        // Total List
        _classJSON.metrics.Add("TotalUsers", AudienceTotalUsers(_OverviewDataset.Tables[1]));
    }
Beispiel #3
0
    private static structCount[] AudienceAvgTimePlayed(DataTable _DataTable)
    {
        int i = 0;
        int TotalTimeplayed = 0;

        // Set _MetricsCount Size
        structCount[] _MetricsCount = new structCount[_DataTable.Rows.Count];
        foreach (DataRow dr in _DataTable.Rows)
        {
            _MetricsCount[i].c1 = Convert.ToInt32(dr["AvgTimePlayed"]);
            TotalTimeplayed    += _MetricsCount[i].c1;
            _MetricsCount[i].c2 = (int)TotalTimeplayed / (i + 1);
            i++;
        }
        return(_MetricsCount);
    }
Beispiel #4
0
    private static structCount[] AudienceSitePlayed(DataTable _DataTable)
    {
        int i = 0;
        int TotalSiteplayed = 0;

        // Set _MetricsCount Size
        structCount[] _MetricsCount = new structCount[_DataTable.Rows.Count];
        foreach (DataRow dr in _DataTable.Rows)
        {
            _MetricsCount[i].c1 = Convert.ToInt32(dr["WebSitePlayedCount"]);
            TotalSiteplayed    += _MetricsCount[i].c1;
            _MetricsCount[i].c2 = TotalSiteplayed;
            i++;
        }
        return(_MetricsCount);
    }