Esempio n. 1
0
        /// <summary>
        /// 形成每一个tab
        /// </summary>
        /// <param name="users"></param>
        /// <param name="tableindex"></param>
        /// <returns></returns>
        protected string GetOneTableHtml(List <SoftUser> users, int tableindex)
        {
            users = users.OrderByDescending(p => p.StatDate).ToList();
            var    channels  = HeadControl1.Channel1.ChannelValues;
            string tableName = string.Empty;

            if (QuDao)
            {
                tableName = users[0].SoftId + "_" + users[0].Platform + "_" + (int)Period + "_" + BeginTime.ToShortDateString() + "_" + EndTime.ToShortDateString() + "_" + channels[QuDaoList[tableindex]].ChannelValue + "_" + (int)channels[QuDaoList[tableindex]].ChannelType + "_" + (HeadControl1.isChecked ? 1 : 0);
            }
            else
            {
                tableName = users[0].SoftId + "_" + users[0].Platform + "_" + (int)Period + "_" + BeginTime.ToShortDateString() + "_" + EndTime.ToShortDateString() + "_" + "-1" + "_" + "-1" + "_" + (HeadControl1.isChecked ? 1 : 0);
            }
            StringBuilder sb;

            if (tableindex == 0)
            {
                sb = new StringBuilder(string.Format("<table id=\"tab{0}\" name=\"" + tableName + "\" class=\" tablesorter \" cellspacing=\"1\">", tableindex));
            }
            else
            {
                sb = new StringBuilder(string.Format("<table id=\"tab{0}\" name=\"" + tableName + "\"  class=\" tablesorter \" style=\"display:none\"  cellspacing=\"1\">", tableindex));
            }

            //是否是内部软件
            bool isInternalSoft = AvailableSofts.FirstOrDefault(a => a.SoftType == SoftTypeOptions.InternalSoft && a.ID == users[0].SoftId) != null;

            return(TableTemplateHelper.BuildStatUsersTable(users[0].SoftId, (MobileOption)users[0].Platform, isInternalSoft, QuDao, Period, "active", HeadControl1.isChecked, users, false, tableindex, tableName));
        }
Esempio n. 2
0
        /// <summary>
        /// 形成每一个tab
        /// </summary>
        /// <param name="orderUsers"></param>
        /// <param name="tableindex"></param>
        /// <returns></returns>
        protected string GetOneTableHtml(List <SoftUser> users, int tableindex)
        {
            List <SoftUser> orderUsers = users.OrderByDescending(p => p.StatDate).ToList();
            var             channels   = HeadControl1.Channel1.ChannelValues;
            string          tableName  = string.Empty;

            if (QuDao)
            {
                tableName = orderUsers[0].SoftId + "_" + orderUsers[0].Platform + "_" + (int)Period + "_" + BeginTime.ToShortDateString() + "_" + EndTime.ToShortDateString() + "_"
                            + channels[QuDaoList[tableindex]].ChannelValue + "_" + (int)channels[QuDaoList[tableindex]].ChannelType;
            }
            else
            {
                tableName = orderUsers[0].SoftId + "_" + orderUsers[0].Platform + "_" + (int)Period + "_" + BeginTime.ToShortDateString() + "_" + EndTime.ToShortDateString() + "_" + "-1" + "_" + "-1";
            }
            //是否是内部软件
            bool isInternalSoft = SelectedSofts.FirstOrDefault(a => a.SoftType == SoftTypeOptions.InternalSoft && a.ID == orderUsers[0].SoftId) != null;

            return(TableTemplateHelper.BuildStatUsersTable(orderUsers[0].SoftId, (MobileOption)orderUsers[0].Platform, isInternalSoft, QuDao, Period, "new", false, orderUsers, false, tableindex, tableName));
        }
Esempio n. 3
0
        /// <summary>
        /// 形成每一个tab
        /// </summary>
        /// <param name="users"></param>
        /// <param name="tableindex"></param>
        /// <returns></returns>
        protected string GetTableString(List <SoftUser> users, int tableindex)
        {
            users = users.OrderByDescending(p => p.StatDate).ToList();
            string tableName = string.Empty;

            //没有选择渠道
            if (HeadControl1.Channel1.ChannelValues.Count == 0)
            {
                tableName = users[0].SoftId + "_" + users[0].Platform + "_" + (int)Period + "_" +
                            BeginTime.ToShortDateString() + "_" + EndTime.ToShortDateString() + "_" + 0 + "_" + 1 + "_" +
                            (usercate.Value != "11" ? "0" : "1");
            }
            else
            {
                var channels = HeadControl1.Channel1.ChannelValues;
                tableName = users[0].SoftId + "_" + users[0].Platform + "_" + (int)Period + "_" +
                            BeginTime.ToShortDateString() + "_" + EndTime.ToShortDateString() + "_" +
                            channels[QuDaoList[tableindex]].ChannelValue + "_" +
                            (int)channels[QuDaoList[tableindex]].ChannelType + "_" +
                            (usercate.Value != "11" ? "0" : "1");
            }
            return(TableTemplateHelper.BuildStatUsersTable(users[0].SoftId, (MobileOption)users[0].Platform, false, true, Period, "new,active", true, users, false, tableindex, tableName));
        }
Esempio n. 4
0
        public void GetExcelNewUser()
        {
            try
            {
                net91com.Stat.Core.PeriodOptions Period = HttpContext.Current.Request["inputzhouqi"].ToEnum <net91com.Stat.Core.PeriodOptions>(net91com.Stat.Core.PeriodOptions.Daily);
                DateTime begintime   = Convert.ToDateTime(HttpContext.Current.Request["inputtimestart"]);
                DateTime endtime     = Convert.ToDateTime(HttpContext.Current.Request["inputtimeend"]);
                int      excelsoft   = Convert.ToInt32(HttpContext.Current.Request["excelsoft"]);
                int      channelcate = Convert.ToInt32(HttpContext.Current.Request["channelcate"]);
                int      channeltype = Convert.ToInt32(HttpContext.Current.Request["channeltype"]);
                ///检查权限
                CheckHasRight(excelsoft, "Reports/NewUserReport.aspx");

                int excelplatform = Convert.ToInt32(HttpContext.Current.Request["excelplatform"]);
                SetStandardTime(Period, begintime, endtime);
                List <SoftUser> users;
                if (channelcate == -1)
                {
                    if (Period != net91com.Stat.Core.PeriodOptions.Hours && Period != net91com.Stat.Core.PeriodOptions.TimeOfDay)
                    {
                        users = Sjqd_StatUsersService.GetInstance().GetSoftUserListCache(begintime, endtime, excelsoft, (int)excelplatform, Period, loginService, CacheTimeOption.TenMinutes).OrderByDescending(p => p.StatDate).ToList();
                    }
                    else
                    {
                        //users = StatUsersByHourService.GetInstance().GetHourUserDataCache(excelsoft, excelplatform, begintime, endtime, Period, loginService,CacheTimeOption.TenMinutes).OrderByDescending(p => p.StatDate).ToList();
                        net91com.Reports.Services.CommonServices.SjqdUserStat.StatUsersService suService = new net91com.Reports.Services.CommonServices.SjqdUserStat.StatUsersService();
                        List <net91com.Reports.Entities.DataBaseEntity.Sjqd_StatUsers>         ssUsers;
                        ssUsers = suService.GetStatUsersByHour(excelsoft, excelplatform, ChannelTypeOptions.Category, 0, (int)Period, begintime, endtime);
                        users   = new List <SoftUser>();
                        foreach (net91com.Reports.Entities.DataBaseEntity.Sjqd_StatUsers u in ssUsers)
                        {
                            SoftUser softuser = new SoftUser();
                            softuser.StatDate  = u.StatDate;
                            softuser.SoftId    = excelsoft;
                            softuser.Platform  = excelplatform;
                            softuser.ActiveNum = u.ActiveUserCount - u.NewUserCount;
                            softuser.Hour      = u.StatHour;
                            softuser.NewNum    = u.NewUserCount;
                            softuser.UseNum    = u.ActiveUserCount;
                            users.Add(softuser);
                        }
                        users = users.OrderBy(p => p.StatDate).ToList();
                    }
                }
                else
                {
                    if (Period != net91com.Stat.Core.PeriodOptions.Hours && Period != net91com.Stat.Core.PeriodOptions.TimeOfDay)
                    {
                        users = Sjqd_StatUsersByChannelsService.GetInstance().GetSoftUserChanelListCache(begintime, endtime, excelsoft, excelplatform, Period,
                                                                                                         (ChannelTypeOptions)channeltype, channelcate, "", false, loginService, CacheTimeOption.TenMinutes).OrderBy(p => p.StatDate).ToList();
                    }
                    else
                    {
                        net91com.Reports.Services.CommonServices.SjqdUserStat.StatUsersService suService = new net91com.Reports.Services.CommonServices.SjqdUserStat.StatUsersService();
                        List <net91com.Reports.Entities.DataBaseEntity.Sjqd_StatUsers>         ssUsers;
                        ssUsers = suService.GetStatUsersByHour(excelsoft, excelplatform, (ChannelTypeOptions)channeltype, channelcate, (int)Period, begintime, endtime);
                        users   = new List <SoftUser>();
                        foreach (net91com.Reports.Entities.DataBaseEntity.Sjqd_StatUsers u in ssUsers)
                        {
                            SoftUser softuser = new SoftUser();
                            softuser.StatDate  = u.StatDate;
                            softuser.SoftId    = excelsoft;
                            softuser.Platform  = excelplatform;
                            softuser.ActiveNum = u.ActiveUserCount - u.NewUserCount;
                            softuser.Hour      = u.StatHour;
                            softuser.NewNum    = u.NewUserCount;
                            softuser.UseNum    = u.ActiveUserCount;
                            users.Add(softuser);
                        }
                        users = users.OrderBy(p => p.StatDate).ToList();
                    }
                }
                HttpResponse resp;
                resp = HttpContext.Current.Response;
                resp.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8");
                string filename = "新增用户.xls";

                AddHead(filename);

                //是否是内部软件
                bool isInternalSoft = AvailableSofts.FirstOrDefault(a => a.ID == excelsoft) != null;
                resp.Write(TableTemplateHelper.BuildStatUsersTable(excelsoft, (MobileOption)excelplatform, isInternalSoft, channelcate != -1, Period, "new", false, users, true, 0, ""));
                resp.End();
            }
            catch (Exception)
            {
                HttpContext.Current.Response.Write("");
            }
        }