/// </summary>获取数据加上绑定数据
        protected void BindData()
        {
            int[] arr = new int[] { 68, 69, -9, 58, 9, 57, 60, 61 };
            if (arr.Contains <int>(softsid))
            {
                string otherKeyString = softsid == 51 ? "SoftID51_" : "";
                maxTime = UtilityService.GetInstance().GetMaxTimeCache(Period, ReportType.StatTerminationDistributionForPC, CacheTimeOption.TenMinutes, otherKeyString);
            }
            else
            {
                string otherKeyString = softsid == 51 ? "SoftID51_" : "";
                maxTime = UtilityService.GetInstance().GetMaxTimeCache(Period, ReportType.StatTerminationDistribution, CacheTimeOption.TenMinutes, otherKeyString);
            }
            startTime = DateTime.Now;
            switch (Period)
            {
            case PeriodOptions.LatestOneMonth:
                startTime = maxTime.AddMonths(-1).AddDays(1);
                break;

            case PeriodOptions.LatestOneWeek:
                startTime = maxTime.AddDays(-6);
                break;

            case PeriodOptions.LatestThreeMonths:
                startTime = maxTime.AddMonths(-3).AddDays(1);
                break;

            case PeriodOptions.LatestTwoWeeks:
                startTime = maxTime.AddDays(-13);
                break;

            case PeriodOptions.All:
                startTime = DateTime.MinValue;
                break;
            }
            reportTitle = Period == PeriodOptions.All ? "软件版本分布(" + maxTime.ToString("yyyy-MM-dd") + "之前)" : "软件版本分布(" + startTime.ToString("yyyy-MM-dd") + "至" + maxTime.ToString("yyyy-MM-dd") + ")";
            allSoftlan  = StatUsersByVersionService.GetInstance().GetSoftSjVersionTransverse(Period,
                                                                                             Convert.ToInt32(maxTime.ToString("yyyyMMdd")),
                                                                                             softsid, (MobileOption)platformsid);

            if (allSoftlan.Count == 0)
            {
                SeriesJsonStr = "[]";
                reportTitle   = "无数据";
            }
            else
            {
                SeriesJsonStr = GetYlineJson(allSoftlan);
            }
            tableStr = GetTableString();
        }
Beispiel #2
0
        public void GetVersionForSession()
        {
            int softid = Convert.ToInt32(HttpContext.Current.Request["soft"]);

            int platformid  = Convert.ToInt32(HttpContext.Current.Request["platform"]);
            int versiontype = Convert.ToInt32(HttpContext.Current.Request["versiontype"]);

            if (platformid <= 0)
            {
                HttpContext.Current.Response.Write("[]");
                return;
            }
            StatUsersByVersionService ss           = StatUsersByVersionService.GetInstance();
            List <SoftVersion>        listVersions = ss.GetVersionCacheStatDB(softid, platformid, versiontype, CacheTimeOption.TenMinutes);
            string jsonVersions = JsonConvert.SerializeObject(listVersions);

            HttpContext.Current.Response.Write(jsonVersions);
        }