Exemplo n.º 1
0
 /// <summary>
 /// AppStore跳转地址编码
 /// </summary>
 public void AppStoreUrlEncode()
 {
     if (LinkType == 1)
     {
         string appid       = net91com.Core.Util.CryptoHelper.DES_Encrypt(SoftID.ToString(), "91appuse");
         string appStoreUrl = System.Web.HttpUtility.UrlEncode(LinkUrl.Trim());
         string channel     = net91com.Stat.Core.UtilHelper.EncryptDES(Channel, "5a@4a$0e", "e2Eb9A82");
         LinkUrl = string.Format(@"http://funcstatic.sj.91.com/link.ashx?id={0}&mt={1}&v={2}&chl={3}&url={4}",
                                 appid, Platform, AppVersion.Trim(), channel, appStoreUrl);
     }
     if (ID == 0 && string.IsNullOrEmpty(LinkTag))
     {
         LinkTag = net91com.Stat.Core.UtilHelper.ShortUrl(SoftID + "_" + Platform + "_" + DateTime.Now.Ticks)[0];
     }
 }
Exemplo n.º 2
0
        protected void GetQueryString()
        {
            HeadControl1.IsPlatSingle = true;
            HeadControl1.IsHasNoPlat  = false;
            HeadControl1.IsSoftSingle = true;

            HeadControl1.HiddenTime    = true;
            HeadControl1.MySupportSoft = AvailableSofts;
            //其他页面传递过来
            if (HeadControl1.IsFirstLoad && string.IsNullOrEmpty(Request["inputsoftselect"]))
            {
                SoftID         = CookieSoftid;
                PlatID         = CookiePlatid;
                EndTimeForHour = UtilityService.GetInstance().GetMaxTimeCache(net91com.Stat.Core.PeriodOptions.Daily, ReportType.SoftUserForHour, CacheTimeOption.TenMinutes);
                EndTime        = UtilityService.GetInstance().GetMaxTimeCache(net91com.Stat.Core.PeriodOptions.Daily, ReportType.UserUseNewActivity, CacheTimeOption.TenMinutes);
                BeginTime      = EndTime.AddDays(-30);
            }


            //用户选择模式
            else
            {
                if (!string.IsNullOrEmpty(Request["inputsoftselect"]) && !string.IsNullOrEmpty(Request["inputplatformselect"]))
                {
                    PlatID = Convert.ToInt32(Request["inputplatformselect"]);
                    SoftID = Convert.ToInt32(Request["inputsoftselect"]);
                }
                else
                {
                    PlatID = Convert.ToInt32(HeadControl1.PlatID);
                    SoftID = Convert.ToInt32(HeadControl1.SoftID);
                }
                EndTimeForHour = UtilityService.GetInstance().GetMaxTimeCache(net91com.Stat.Core.PeriodOptions.Daily, ReportType.SoftUserForHour, CacheTimeOption.TenMinutes);
                EndTime        = UtilityService.GetInstance().GetMaxTimeCache(net91com.Stat.Core.PeriodOptions.Daily, ReportType.UserUseNewActivity, CacheTimeOption.TenMinutes);
                BeginTime      = EndTime.AddDays(-30);
                SetRequestCookie(SoftID, PlatID);
            }

            HeadControl1.SoftID = SoftID.ToString();
            HeadControl1.PlatID = PlatID.ToString();
            //设置时段的时间和 最近30日的时间
            DateTimeFor30      = EndTime.Date.ToShortDateString();
            DateTimeSpan       = EndTimeForHour.Date.ToShortDateString();
            DateTimeFor30Begin = BeginTime.ToShortDateString();
        }
 protected void GetQueryString()
 {
     //初次加载一些参数设置成默认值
     ReportTitle   = "生命周期";
     AxisJsonStr   = "{}";
     SeriesJsonStr = "[]";
     if (HeadControl1.IsFirstLoad)
     {
         SoftID                  = CookieSoftid;
         PlatformID              = CookiePlatid;
         StartDateTime           = UtilityService.GetInstance().GetMaxTimeCache(net91com.Stat.Core.PeriodOptions.Daily, ReportType.UserLifecycle, CacheTimeOption.TenMinutes).AddMonths(-2);
         HeadControl1.SoftID     = SoftID.ToString();
         HeadControl1.PlatID     = PlatformID.ToString();
         HeadControl1.SingleTime = StartDateTime;
     }
     else  //用户选择模式
     {
         string beginstr = Request["inputtimestart"] == null ? "" : Request["inputtimestart"];
         StartDateTime = HeadControl1.SingleTime;
         PlatformID    = Convert.ToInt32(HeadControl1.PlatID);
         SoftID        = Convert.ToInt32(HeadControl1.SoftID);
         SetRequestCookie(SoftID, PlatformID);
     }
 }
Exemplo n.º 4
0
        protected void GetQueryString()
        {
            OrderBy = string.IsNullOrEmpty(Request["orderby"]) ? (string.IsNullOrEmpty(Request["hOrderBy"]) ? 0 : Convert.ToInt32(Request["hOrderBy"])) : Convert.ToInt32(Request["orderby"]);
            Desc    = string.IsNullOrEmpty(Request["Desc"]) ? (string.IsNullOrEmpty(Request["hDesc"]) ? true : Convert.ToBoolean(Request["hDesc"])) : Convert.ToBoolean(Request["desc"]);

            HeadControl1.IsHasNoPlat = true;

            //默认模式
            if (HeadControl1.IsFirstLoad)
            {
                SoftID              = CookieSoftid;
                Platform            = CookiePlatid;
                EndTime             = DateTime.Now.Date.AddDays(-1);
                BeginTime           = EndTime.AddDays(-30);
                HeadControl1.SoftID = SoftID.ToString();
                HeadControl1.PlatID = Platform.ToString();
            }
            else
            {
                SoftID    = Convert.ToInt32(HeadControl1.SoftID);
                Platform  = Convert.ToInt32(HeadControl1.PlatID);
                BeginTime = HeadControl1.BeginTime;
                EndTime   = HeadControl1.EndTime;
                SetRequestCookie(SoftID, Platform);
            }
            List <Sjqd_StatUsers> ranks = new StatUsersService().GetRankOfCountries(SoftID, Platform, ChannelTypeOptions.Category, 0, (int)PeriodSelector1.SelectedPeriod, ref BeginTime, ref EndTime);

            HeadControl1.BeginTime = BeginTime;
            HeadControl1.EndTime   = EndTime;
            switch (OrderBy)
            {
            case 0:
                ranks = (Desc ? ranks.OrderByDescending(a => a.NewUserCount) : ranks.OrderBy(a => a.NewUserCount)).ToList();
                break;

            case 1:
                ranks = (Desc ? ranks.OrderByDescending(a => a.NewUserCount - a.LastNewUserCount) : ranks.OrderBy(a => a.NewUserCount - a.LastNewUserCount)).ToList();
                break;

            default:
                ranks = (Desc ? ranks.OrderByDescending(a => (double)a.RetainedUserCount / a.OriginalNewUserCount) : ranks.OrderBy(a => (double)a.RetainedUserCount / a.OriginalNewUserCount)).ToList();
                break;
            }

            days = (EndTime - BeginTime).Days + 1;

            List <object> list = new List <object>();

            for (int i = 0; i < ranks.Count; i++)
            {
                list.Add(new
                {
                    RankIndex           = i + 1,
                    ID                  = ranks[i].ID,
                    Name                = ranks[i].Name,
                    NewUserCount        = Utility.SetNum(ranks[i].NewUserCount),
                    NewUserCountDiff    = Utility.SetNum(ranks[i].NewUserCount - ranks[i].LastNewUserCount),
                    ActiveUserCount     = Utility.SetNum(ranks[i].ActiveUserCount),
                    RetainedUserRate    = ranks[i].LastNewUserCount == 0 ? "" : ((decimal)ranks[i].RetainedUserCount / ranks[i].LastNewUserCount * 100).ToString("0.00") + "%",
                    RetainedUserAvgRate = (ranks[i].RetainedUserCountDailyRate * 100).ToString("0.00") + "%",
                    AvgDownCount        = (ranks[i].DownUserCount == 0 ? 0.00 : (ranks[i].DownCount * 1.0 / ranks[i].DownUserCount)).ToString("0.00"),
                    AvgDownCount_One    = (ranks[i].DownCountNotUpdate == 0 ? 0.00 : (ranks[i].DownCountNotUpdate * 1.0 / ranks[i].DownUserCountNotUpdate)).ToString("0.00")
                });
            }
            Repeater1.DataSource = list;
            Repeater1.DataBind();
        }
        protected void GetQueryString()
        {
            //默认模式
            if (HeadControl1.IsFirstLoad)
            {
                SoftID   = CookieSoftid;
                Platform = CookiePlatid;
                //StatDate = UtilityService.GetInstance().GetMaxTimeCache(PeriodSelector1.SelectedPeriod, ReportType.UserUseNewActivity,CacheTimeOption.TenMinutes);
                //StatDate = StatDate.Date;
                EndTime   = DateTime.Now.Date.AddDays(-1);
                BeginTime = EndTime.AddDays(-30);
                //HeadControl1.SingleTime = StatDate;
                HeadControl1.SoftID = SoftID.ToString();
                HeadControl1.PlatID = Platform.ToString();
            }
            else
            {
                SoftID   = Convert.ToInt32(HeadControl1.SoftID);
                Platform = Convert.ToInt32(HeadControl1.PlatID);
                //StatDate =HeadControl1.SingleTime;
                BeginTime = HeadControl1.BeginTime;
                EndTime   = HeadControl1.EndTime;
                //UtilityHelp.SpecificateSingleTime(ref StatDate, (Report_Period)Convert.ToInt32(PeriodSelector1.SelectedPeriod));
                SetRequestCookie(SoftID, Platform);
            }
            int period = Convert.ToInt32(PeriodSelector1.SelectedPeriod);


            OrderBy = string.IsNullOrEmpty(Request["orderby"]) ? (string.IsNullOrEmpty(Request["hOrderBy"]) ? 0 : Convert.ToInt32(Request["hOrderBy"])) : Convert.ToInt32(Request["orderby"]);
            Desc    = string.IsNullOrEmpty(Request["Desc"]) ? (string.IsNullOrEmpty(Request["hDesc"]) ? true : Convert.ToBoolean(Request["hDesc"])) : Convert.ToBoolean(Request["desc"]);

            List <Sjqd_StatUsers> users = new StatUsersService().GetRankOfChannels(SoftID, Platform, 0, (int)PeriodSelector1.SelectedPeriod, ref BeginTime, ref EndTime);

            HeadControl1.BeginTime = BeginTime;
            HeadControl1.EndTime   = EndTime;
            //SetDescriptDate(EndTime, (Report_Period)period);

            GetRankOfCitiesUrl      = string.Format("/Services/GetMore.ashx?Action=GetRankOfAreas&AreaType=3&SoftIds={0}&Platforms={1}&Period={2}&StartDate={3:yyyy-MM-dd}&EndDate={4:yyyy-MM-dd}&OrderBy={5}&Desc={6}&v={7}&ChannelTypes={8}", SoftID, Platform, period, BeginTime, EndTime, OrderBy, Desc, DateTime.Now.Ticks, (int)ChannelTypeOptions.Customer);
            GetRankOfProvincesUrl   = string.Format("/Services/GetMore.ashx?Action=GetRankOfAreas&AreaType=2&SoftIds={0}&Platforms={1}&Period={2}&StartDate={3:yyyy-MM-dd}&EndDate={4:yyyy-MM-dd}&OrderBy={5}&Desc={6}&v={7}&ChannelTypes={8}", SoftID, Platform, period, BeginTime, EndTime, OrderBy, Desc, DateTime.Now.Ticks, (int)ChannelTypeOptions.Customer);
            GetRankOfCountriesUrl   = string.Format("/Services/GetMore.ashx?Action=GetRankOfAreas&AreaType=1&SoftIds={0}&Platforms={1}&Period={2}&StartDate={3:yyyy-MM-dd}&EndDate={4:yyyy-MM-dd}&OrderBy={5}&Desc={6}&v={7}&ChannelTypes={8}", SoftID, Platform, period, BeginTime, EndTime, OrderBy, Desc, DateTime.Now.Ticks, (int)ChannelTypeOptions.Customer);
            GetRankOfVersionsUrl    = string.Format("/Services/GetMore.ashx?Action=GetRankOfVersions&SoftIds={0}&Platforms={1}&Period={2}&StartDate={3:yyyy-MM-dd}&EndDate={4:yyyy-MM-dd}&OrderBy={5}&Desc={6}&v={7}&ChannelTypes={8}", SoftID, Platform, period, BeginTime, EndTime, OrderBy, Desc, DateTime.Now.Ticks, (int)ChannelTypeOptions.Customer);
            GetRankOfSubChannelsUrl = string.Format("/Services/GetMore.ashx?Action=GetRankOfSubChannels&SoftIds={0}&Platforms={1}&Period={2}&StartDate={3:yyyy-MM-dd}&EndDate={4:yyyy-MM-dd}&OrderBy={5}&Desc={6}&v={7}&ChannelTypes={8}", SoftID, Platform, period, BeginTime, EndTime, OrderBy, Desc, DateTime.Now.Ticks, (int)ChannelTypeOptions.Customer);



            if (Desc)
            {
                users = (OrderBy == 0 ? users.OrderByDescending(a => a.NewUserCount) : users.OrderByDescending(a => a.NewUserCount - a.LastNewUserCount)).ToList();
            }
            else
            {
                users = (OrderBy == 0 ? users.OrderBy(a => a.NewUserCount) : users.OrderBy(a => a.NewUserCount - a.LastNewUserCount)).ToList();
            }
            List <object> list = new List <object>();

            for (int i = 0; i < users.Count; i++)
            {
                list.Add(new
                {
                    RankIndex        = i + 1,
                    ChannelID        = users[i].ID,
                    ChannelName      = users[i].Name,
                    NewUserCount     = Utility.SetNum(users[i].NewUserCount),
                    NewUserCountDiff = Utility.SetNum(users[i].NewUserCount - users[i].LastNewUserCount),
                    ActiveUserCount  = Utility.SetNum(users[i].ActiveUserCount),
                    ActiveUserRate   = users[i].TotalUserCount == 0 ? "" : ((decimal)users[i].ActiveUserCount / users[i].TotalUserCount * 100).ToString("0.00") + "%",
                    OneTimeUserCount = users[i].TotalUserCount == 0 ? "" : Utility.SetNum(users[i].OneTimeUserCount) + (users[i].TotalUserCount == 0 ? "(--)" : ("(" + ((decimal)users[i].OneTimeUserCount / users[i].TotalUserCount * 100).ToString("0.00") + "%)")),
                    RetainedUserRate = users[i].OriginalNewUserCount == 0 ? "" : ((decimal)users[i].RetainedUserCount / users[i].OriginalNewUserCount * 100).ToString("0.00") + "%",
                    TotalUserCount   = Utility.SetNum(users[i].TotalUserCount)
                });
            }
            Repeater1.DataSource = list;
            Repeater1.DataBind();
        }